From ae82d045f8f23ad77b17551c1e4123b17c6bb5a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Mar 2018 23:40:25 +0100 Subject: [PATCH] Dolibarrize module ticket --- htdocs/admin/ticketsup.php | 28 ++++++++--------- htdocs/admin/ticketsup_extrafields.php | 14 ++++----- .../boxes/box_last_modified_ticketsup.php | 2 +- htdocs/core/boxes/box_last_ticketsup.php | 2 +- .../core/class/html.formticketsup.class.php | 6 ++-- htdocs/core/class/translate.class.php | 4 +-- htdocs/core/lib/ticketsup.lib.php | 2 +- htdocs/core/modules/modTicketsup.class.php | 22 +++++++------- htdocs/core/modules/modules_ticketsup.php | 4 +-- .../ticketsup/mod_ticketsup_universal.php | 2 +- ...face_50_modTicketsup_TicketEmail.class.php | 4 +-- .../install/mysql/migration/7.0.0-8.0.0.sql | 1 + htdocs/install/mysql/tables/llx_ticketsup.sql | 3 +- htdocs/langs/en_US/ticketsup.lang | 2 +- htdocs/public/ticketsup/create_ticket.php | 2 +- htdocs/public/ticketsup/index.php | 2 +- htdocs/public/ticketsup/list.php | 2 +- htdocs/public/ticketsup/view.php | 2 +- htdocs/ticketsup/card.php | 4 +-- htdocs/ticketsup/class/ticketsup.class.php | 8 ++--- htdocs/ticketsup/contacts.php | 4 +-- htdocs/ticketsup/document.php | 3 +- htdocs/ticketsup/history.php | 4 +-- htdocs/ticketsup/index.php | 30 +++++++++---------- htdocs/ticketsup/list.php | 19 +++++------- htdocs/ticketsup/new.php | 25 ++++++++-------- .../ticketsup/tpl/linkedobjectblock.tpl.php | 4 +-- 27 files changed, 101 insertions(+), 104 deletions(-) diff --git a/htdocs/admin/ticketsup.php b/htdocs/admin/ticketsup.php index f0dfb8c690a06..4f6839d1e5917 100644 --- a/htdocs/admin/ticketsup.php +++ b/htdocs/admin/ticketsup.php @@ -18,14 +18,15 @@ /** * \file admin/ticketsup.php - * \ingroup ticketsup - * \brief This file is a module setup page + * \ingroup ticketsup + * \brief This file is a module setup page */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; require_once DOL_DOCUMENT_ROOT."/ticketsup/class/ticketsup.class.php"; require_once DOL_DOCUMENT_ROOT."/core/lib/ticketsup.lib.php"; + // Translations $langs->load("ticketsup"); @@ -214,9 +215,12 @@ } } + + /* * View */ + $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); $form = new Form($db); @@ -226,28 +230,22 @@ llxHeader('', $langs->trans($page_name), $help_url); // Subheader -$linkback = '' -. $langs->trans("BackToModuleList") . ''; -print load_fiche_titre($langs->trans($page_name), $linkback); +$linkback = '' . $langs->trans("BackToModuleList") . ''; + +print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); // Configuration header $head = ticketsupAdminPrepareHead(); -dol_fiche_head( - $head, - 'settings', - $langs->trans("Module56000Name"), - 0, - "ticketsup" -); -print '

' . $langs->trans("TicketsupSetupDictionaries") . ' : ' . dol_buildpath('/admin/dict.php', 2) . '

'; +dol_fiche_head($head, 'settings', $langs->trans("Module56000Name"), -1, "ticketsup"); -print '

' . $langs->trans("TicketsupPublicAccess") . ' : ' . dol_buildpath('/ticketsup/public/index.php', 2) . '

'; +print $langs->trans("TicketsupSetupDictionaries") . ' : ' . dol_buildpath('/admin/dict.php', 2) . '
'; -//print '

'. $langs->trans("TicketsupSetupPage").'

'; +print $langs->trans("TicketsupPublicAccess") . ' : ' . dol_buildpath('/ticketsup/public/index.php', 2) . ''; dol_fiche_end(); + /* * Projects Numbering model */ diff --git a/htdocs/admin/ticketsup_extrafields.php b/htdocs/admin/ticketsup_extrafields.php index 09fe827ca7c69..5709472e858f7 100644 --- a/htdocs/admin/ticketsup_extrafields.php +++ b/htdocs/admin/ticketsup_extrafields.php @@ -47,11 +47,15 @@ accessforbidden(); } + /* * Actions */ + include DOL_DOCUMENT_ROOT . '/core/actions_extrafields.inc.php'; + + /* * View */ @@ -63,17 +67,11 @@ llxHeader('', $langs->trans($page_name), $help_url); $linkback = '' . $langs->trans("BackToModuleList") . ''; -print load_fiche_titre($langs->trans("TicketsupSetup"), $linkback, 'setup'); +print load_fiche_titre($langs->trans("TicketsupSetup"), $linkback, 'title_setup'); $head = ticketsupAdminPrepareHead(); -dol_fiche_head( - $head, - 'attributes', - $langs->trans("Module56000Name"), - 0, - "ticketsup" -); +dol_fiche_head($head, 'attributes', $langs->trans("Module56000Name"), -1, "ticketsup"); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/core/boxes/box_last_modified_ticketsup.php b/htdocs/core/boxes/box_last_modified_ticketsup.php index 08bf47ad46c98..fd49653eced9a 100644 --- a/htdocs/core/boxes/box_last_modified_ticketsup.php +++ b/htdocs/core/boxes/box_last_modified_ticketsup.php @@ -31,7 +31,7 @@ class box_last_modified_ticketsup extends ModeleBoxes { public $boxcode = "box_last_modified_ticketsup"; - public $boximg = "ticketsup@ticketsup"; + public $boximg = "ticketsup"; public $boxlabel; public $depends = array("ticketsup"); public $db; diff --git a/htdocs/core/boxes/box_last_ticketsup.php b/htdocs/core/boxes/box_last_ticketsup.php index 3eecceb74aec2..6044bb179f530 100644 --- a/htdocs/core/boxes/box_last_ticketsup.php +++ b/htdocs/core/boxes/box_last_ticketsup.php @@ -31,7 +31,7 @@ class box_last_ticketsup extends ModeleBoxes { public $boxcode = "box_last_ticketsup"; - public $boximg = "ticketsup@ticketsup"; + public $boximg = "ticketsup"; public $boxlabel; public $depends = array("ticketsup"); public $db; diff --git a/htdocs/core/class/html.formticketsup.class.php b/htdocs/core/class/html.formticketsup.class.php index 08dbc4e0fe638..2bf4192179325 100644 --- a/htdocs/core/class/html.formticketsup.class.php +++ b/htdocs/core/class/html.formticketsup.class.php @@ -122,7 +122,7 @@ public function showForm($width = '100%') $langs->load("other"); $langs->load("mails"); - $langs->load("ticketsup@ticketsup"); + $langs->load("ticketsup"); $form = new Form($this->db); $formcompany = new FormCompany($this->db); @@ -148,6 +148,7 @@ public function showForm($width = '100%') } print ''; + print '
'; print ''; @@ -194,7 +195,7 @@ public function showForm($width = '100%') } }); }); - + function runJsCodeForEvent'.$htmlname.'(obj) { console.log("Run runJsCodeForEvent'.$htmlname.'"); var id = $("#'.$htmlname.'").val(); @@ -392,6 +393,7 @@ function(response) { } print '
'; + print '
'; print '
'; print ''; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 69fe031459d05..62abbbbcc189c 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -205,7 +205,7 @@ function load($domain,$alt=0,$stopafterdirection=0,$forcelangdir='',$loadfromfil // Check cache if (! empty($this->_tab_loaded[$newdomain])) // File already loaded for this domain { - //dol_syslog("Translate::Load already loaded for newdomain=".$newdomain); + dol_syslog("Translate::Load already loaded for newdomain=".$newdomain); return 0; } @@ -231,7 +231,7 @@ function load($domain,$alt=0,$stopafterdirection=0,$forcelangdir='',$loadfromfil $filelangexists=is_file($file_lang_osencoded); - //dol_syslog(get_class($this).'::Load Try to read for alt='.$alt.' langofdir='.$langofdir.' newdomain='.$domain.' modulename='.$modulename.' file_lang='.$file_lang." => filelangexists=".$filelangexists); + dol_syslog(get_class($this).'::Load Try to read for alt='.$alt.' langofdir='.$langofdir.' newdomain='.$domain.' modulename='.$modulename.' file_lang='.$file_lang." => filelangexists=".$filelangexists); if ($filelangexists) { diff --git a/htdocs/core/lib/ticketsup.lib.php b/htdocs/core/lib/ticketsup.lib.php index b25f3d1a4cd7c..ca27e9e8024b0 100644 --- a/htdocs/core/lib/ticketsup.lib.php +++ b/htdocs/core/lib/ticketsup.lib.php @@ -31,7 +31,7 @@ function ticketsupAdminPrepareHead() { global $langs, $conf; - $langs->load("ticketsup@ticketsup"); + $langs->load("ticketsup"); $h = 0; $head = array(); diff --git a/htdocs/core/modules/modTicketsup.class.php b/htdocs/core/modules/modTicketsup.class.php index 38299617788d6..7e824cdf47bd6 100644 --- a/htdocs/core/modules/modTicketsup.class.php +++ b/htdocs/core/modules/modTicketsup.class.php @@ -74,7 +74,7 @@ public function __construct($db) // use this->picto='pictovalue' // If file is in module/img directory under name object_pictovalue.png // use this->picto='pictovalue@module' - $this->picto = 'ticketsup@ticketsup'; // mypicto@ticketsup + $this->picto = 'ticketsup'; // mypicto@ticketsup // Defined all module parts (triggers, login, substitutions, menus, css, etc...) // for default path (eg: /ticketsup/core/xxxxx) (0=disable, 1=enable) // for specific path of parts (eg: /ticketsup/core/modules/barcode) @@ -135,7 +135,7 @@ public function __construct($db) $conf->ticketsup->enabled=0; } $this->dictionaries = array( - 'langs' => 'ticketsup@ticketsup', + 'langs' => 'ticketsup', 'tabname' => array(MAIN_DB_PREFIX . "c_ticketsup_type", MAIN_DB_PREFIX . "c_ticketsup_category", MAIN_DB_PREFIX . "c_ticketsup_severity"), 'tablib' => array("TicketsupDictType", "TicketsupDictCategory", "TicketsupDictSeverity"), 'tabsql' => array('SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticketsup_type as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticketsup_category as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticketsup_severity as f'), @@ -153,10 +153,10 @@ public function __construct($db) $r = 0; // Example: - $this->boxes[$r][1] = "box_last_ticketsup@ticketsup"; + $this->boxes[$r][1] = "box_last_ticketsup"; $r++; - $this->boxes[$r][1] = "box_last_modified_ticketsup@ticketsup"; + $this->boxes[$r][1] = "box_last_modified_ticketsup"; $r++; // Permissions @@ -209,7 +209,7 @@ public function __construct($db) 'mainmenu' => 'ticketsup', 'leftmenu' => '1', // Use 1 if you also want to add left menu entries using this descriptor. 'url' => '/ticketsup/index.php', - 'langs' => 'ticketsup@ticketsup', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'langs' => 'ticketsup', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position' => 100, 'enabled' => '1', // Define condition to show or hide menu entry. Use '$conf->ticketsup->enabled' if entry must be visible if module is enabled. 'perms' => '$user->rights->ticketsup->read', // Use 'perms'=>'$user->rights->ticketsup->level1->level2' if you want your menu with a permission rules @@ -223,7 +223,7 @@ public function __construct($db) 'mainmenu' => 'ticketsup', 'leftmenu' => 'ticketsup', 'url' => '/ticketsup/index.php', - 'langs' => 'ticketsup@ticketsup', + 'langs' => 'ticketsup', 'position' => 101, 'enabled' => 1, 'perms' => '$user->rights->ticketsup->read', @@ -236,7 +236,7 @@ public function __construct($db) 'titre' => 'NewTicket', 'mainmenu' => 'ticketsup', 'url' => '/ticketsup/new.php?action=create_ticket', - 'langs' => 'ticketsup@ticketsup', + 'langs' => 'ticketsup', 'position' => 102, 'enabled' => 1, 'perms' => '$user->rights->ticketsup->write', @@ -250,7 +250,7 @@ public function __construct($db) 'mainmenu' => 'ticketsup', 'leftmenu' => 'ticketsuplist', 'url' => '/ticketsup/list.php', - 'langs' => 'ticketsup@ticketsup', + 'langs' => 'ticketsup', 'position' => 103, 'enabled' => 1, 'perms' => '$user->rights->ticketsup->read', @@ -264,7 +264,7 @@ public function __construct($db) 'mainmenu' => 'ticketsup', 'leftmenu' => 'ticketsuplist', 'url' => '/ticketsup/list.php?search_fk_status=non_closed', - 'langs' => 'ticketsup@ticketsup', + 'langs' => 'ticketsup', 'position' => 104, 'enabled' => 1, 'perms' => '$user->rights->ticketsup->read', @@ -278,7 +278,7 @@ public function __construct($db) 'mainmenu' => 'ticketsup', 'leftmenu' => 'ticketsupmy', 'url' => '/ticketsup/list.php?mode=my_assign', - 'langs' => 'ticketsup@ticketsup', + 'langs' => 'ticketsup', 'position' => 105, 'enabled' => 1, 'perms' => '$user->rights->ticketsup->read', @@ -291,7 +291,7 @@ public function __construct($db) 'titre' => 'MenuTicketsupMyAssignNonClosed', 'mainmenu' => 'ticketsup', 'url' => '/ticketsup/list.php?mode=my_assign&search_fk_status=non_closed', - 'langs' => 'ticketsup@ticketsup', + 'langs' => 'ticketsup', 'position' => 106, 'enabled' => 1, 'perms' => '$user->rights->ticketsup->read', diff --git a/htdocs/core/modules/modules_ticketsup.php b/htdocs/core/modules/modules_ticketsup.php index 9eb652c31f428..e6e47adaa9f08 100644 --- a/htdocs/core/modules/modules_ticketsup.php +++ b/htdocs/core/modules/modules_ticketsup.php @@ -49,7 +49,7 @@ public function isEnabled() public function info() { global $langs; - $langs->load("ticketsup@ticketsup"); + $langs->load("ticketsup"); return $langs->trans("NoDescription"); } @@ -61,7 +61,7 @@ public function info() public function getExample() { global $langs; - $langs->load("ticketsup@ticketsup"); + $langs->load("ticketsup"); return $langs->trans("NoExample"); } diff --git a/htdocs/core/modules/ticketsup/mod_ticketsup_universal.php b/htdocs/core/modules/ticketsup/mod_ticketsup_universal.php index 8c0c8c8fe0cdf..881ba5a7f1550 100644 --- a/htdocs/core/modules/ticketsup/mod_ticketsup_universal.php +++ b/htdocs/core/modules/ticketsup/mod_ticketsup_universal.php @@ -43,7 +43,7 @@ public function info() { global $conf, $langs; - $langs->load("ticketsup@ticketsup"); + $langs->load("ticketsup"); $langs->load("admin"); $form = new Form($this->db); diff --git a/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php index 1990f184f846e..16b317cc10896 100644 --- a/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php @@ -50,7 +50,7 @@ public function __construct($db) $this->family = "ticketsup"; $this->description = "Triggers of the module ticketsup"; $this->version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' or version - $this->picto = 'ticketsup@ticketsup'; + $this->picto = 'ticketsup'; } /** @@ -176,7 +176,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf $filename = array(); $mimetype = array(); - $langs->load('ticketsup@ticketsup'); + $langs->load('ticketsup'); $object->fetch('', $object->track_id); diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index e9543583b03f0..37e22e182a7ff 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -146,6 +146,7 @@ CREATE TABLE llx_ticketsup tms timestamp )ENGINE=innodb; +ALTER TABLE llx_ticketsup ADD COLUMN notify_tiers_at_create integer; ALTER TABLE llx_ticketsup ADD UNIQUE uk_ticketsup_rowid_track_id (rowid, track_id); ALTER TABLE llx_ticketsup ADD INDEX id_ticketsup_track_id (track_id); diff --git a/htdocs/install/mysql/tables/llx_ticketsup.sql b/htdocs/install/mysql/tables/llx_ticketsup.sql index 5449cf4825d6f..f79cda977122a 100644 --- a/htdocs/install/mysql/tables/llx_ticketsup.sql +++ b/htdocs/install/mysql/tables/llx_ticketsup.sql @@ -18,7 +18,7 @@ CREATE TABLE llx_ticketsup ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1, - ref varchar(128) NOT NULL, + ref varchar(128) NOT NULL, track_id varchar(128) NOT NULL, fk_soc integer DEFAULT 0, fk_project integer DEFAULT 0, @@ -37,5 +37,6 @@ CREATE TABLE llx_ticketsup datec datetime, date_read datetime, date_close datetime, + notify_tiers_at_create, tms timestamp )ENGINE=innodb; diff --git a/htdocs/langs/en_US/ticketsup.lang b/htdocs/langs/en_US/ticketsup.lang index 986a18829367a..8187e8220d9da 100644 --- a/htdocs/langs/en_US/ticketsup.lang +++ b/htdocs/langs/en_US/ticketsup.lang @@ -180,7 +180,7 @@ TicketMessageSuccessfullyAdded=Message successfully added TicketMessagesList=Message list NoMsgForThisTicket=No message for this ticket Properties=Classification -LastNewTickets=Last %s tickets newest (not read) +LatestNewTickets=Last %s tickets newest (not read) TicketSeverity=Severity ShowTicket=See ticket RelatedTickets=Related tickets diff --git a/htdocs/public/ticketsup/create_ticket.php b/htdocs/public/ticketsup/create_ticket.php index bc5fc5842191c..a0cb6f787ac4c 100644 --- a/htdocs/public/ticketsup/create_ticket.php +++ b/htdocs/public/ticketsup/create_ticket.php @@ -56,7 +56,7 @@ $langs->load("companies"); $langs->load("other"); $langs->load("mails"); -$langs->load("ticketsup@ticketsup"); +$langs->load("ticketsup"); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/public/ticketsup/index.php b/htdocs/public/ticketsup/index.php index f913ce9c70d49..8352282c4af01 100644 --- a/htdocs/public/ticketsup/index.php +++ b/htdocs/public/ticketsup/index.php @@ -51,7 +51,7 @@ // Load traductions files requiredby by page $langs->load("companies"); $langs->load("other"); -$langs->load("ticketsup@ticketsup"); +$langs->load("ticketsup"); $langs->load("errors"); // Get parameters diff --git a/htdocs/public/ticketsup/list.php b/htdocs/public/ticketsup/list.php index adea8def5ea4c..34413168bc027 100644 --- a/htdocs/public/ticketsup/list.php +++ b/htdocs/public/ticketsup/list.php @@ -42,7 +42,7 @@ // Load traductions files requiredby by page $langs->load("companies"); $langs->load("other"); -$langs->load("ticketsup@ticketsup"); +$langs->load("ticketsup"); // Get parameters $track_id = GETPOST('track_id', 'alpha'); diff --git a/htdocs/public/ticketsup/view.php b/htdocs/public/ticketsup/view.php index 68e18e67d14ff..c0069d9f6eefe 100644 --- a/htdocs/public/ticketsup/view.php +++ b/htdocs/public/ticketsup/view.php @@ -42,7 +42,7 @@ // Load traductions files requiredby by page $langs->load("companies"); $langs->load("other"); -$langs->load("ticketsup@ticketsup"); +$langs->load("ticketsup"); // Get parameters $track_id = GETPOST('track_id', 'alpha'); diff --git a/htdocs/ticketsup/card.php b/htdocs/ticketsup/card.php index b5ffa4b63d8a7..5bf64d34cc8e3 100644 --- a/htdocs/ticketsup/card.php +++ b/htdocs/ticketsup/card.php @@ -48,7 +48,7 @@ // Load traductions files requiredby by page $langs->load("companies"); $langs->load("other"); -$langs->load("ticketsup@ticketsup"); +$langs->load("ticketsup"); // Get parameters $id = GETPOST('id', 'int'); @@ -208,7 +208,7 @@ } $head = ticketsup_prepare_head($object->dao); - dol_fiche_head($head, 'tabTicketsup', $langs->trans("Ticket"), 0, 'ticketsup@ticketsup'); + dol_fiche_head($head, 'tabTicketsup', $langs->trans("Ticket"), 0, 'ticketsup'); $object->dao->label = $object->dao->ref; // Author if ($object->dao->fk_user_create > 0) { diff --git a/htdocs/ticketsup/class/ticketsup.class.php b/htdocs/ticketsup/class/ticketsup.class.php index e507e2e89a7f0..902bb6943efce 100644 --- a/htdocs/ticketsup/class/ticketsup.class.php +++ b/htdocs/ticketsup/class/ticketsup.class.php @@ -53,7 +53,7 @@ class Ticketsup extends CommonObject /** * @var string String with name of icon for ticketsupcore. Must be the part after the 'object_' into object_ticketsupcore.png */ - public $picto = 'ticketsup@ticketsup'; + public $picto = 'ticketsup'; /** @@ -1309,9 +1309,9 @@ public function getNomUrl($withpicto = 0, $option = '') $lien = ''; $lienfin = ''; - $picto = 'ticketsup@ticketsup'; + $picto = 'ticketsup'; if (!$this->public) { - $picto = 'ticketsup@ticketsup'; + $picto = 'ticketsup'; } $label = $langs->trans("ShowTicket") . ': ' . $this->ref . ' - ' . $this->subject; @@ -1501,7 +1501,7 @@ private function sendLogByEmail($user, $message) $nb_sent = 0; - $langs->load('ticketsup@ticketsup'); + $langs->load('ticketsup'); // Retrieve email of all contacts (internal and external) $contacts = $this->listeContact(-1, 'internal'); diff --git a/htdocs/ticketsup/contacts.php b/htdocs/ticketsup/contacts.php index 72b72ac0e57bc..9ef592b22a7c3 100644 --- a/htdocs/ticketsup/contacts.php +++ b/htdocs/ticketsup/contacts.php @@ -36,7 +36,7 @@ // Load traductions files requiredby by page $langs->load("companies"); -$langs->load("ticketsup@ticketsup"); +$langs->load("ticketsup"); // Get parameters $socid = GETPOST("socid", 'int'); @@ -144,7 +144,7 @@ $object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'"; } $head = ticketsup_prepare_head($object); - dol_fiche_head($head, 'tabTicketContacts', $langs->trans("Ticket"), 0, 'ticketsup@ticketsup'); + dol_fiche_head($head, 'tabTicketContacts', $langs->trans("Ticket"), 0, 'ticketsup'); $object->label = $object->ref; // Author if ($object->fk_user_create > 0) { diff --git a/htdocs/ticketsup/document.php b/htdocs/ticketsup/document.php index f9d96beaf1f92..f221dce73c2c5 100644 --- a/htdocs/ticketsup/document.php +++ b/htdocs/ticketsup/document.php @@ -35,6 +35,7 @@ $langs->load("companies"); $langs->load('other'); +$langs->load("ticketsup"); $action = GETPOST('action'); $confirm = GETPOST('confirm'); @@ -122,7 +123,7 @@ $object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'"; } $head = ticketsup_prepare_head($object); - dol_fiche_head($head, 'tabTicketDocument', $langs->trans("Ticket"), 0, 'ticketsup@ticketsup'); + dol_fiche_head($head, 'tabTicketDocument', $langs->trans("Ticket"), 0, 'ticketsup'); $object->label = $object->ref; // Author if ($object->fk_user_create > 0) { diff --git a/htdocs/ticketsup/history.php b/htdocs/ticketsup/history.php index 48ba39a2b0218..9bd69ade897a2 100644 --- a/htdocs/ticketsup/history.php +++ b/htdocs/ticketsup/history.php @@ -36,7 +36,7 @@ // Load traductions files requiredby by page $langs->load("companies"); $langs->load("other"); -$langs->load("ticketsup@ticketsup"); +$langs->load("ticketsup"); // Get parameters $id = GETPOST('id', 'int'); @@ -102,7 +102,7 @@ $object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'"; } $head = ticketsup_prepare_head($object->dao); - dol_fiche_head($head, 'tabTicketLogs', $langs->trans("Ticket"), 0, 'ticketsup@ticketsup'); + dol_fiche_head($head, 'tabTicketLogs', $langs->trans("Ticket"), 0, 'ticketsup'); $object->dao->label = $object->dao->ref; // Author if ($object->dao->fk_user_create > 0) { diff --git a/htdocs/ticketsup/index.php b/htdocs/ticketsup/index.php index 505812f84c6fa..e596d9149c192 100644 --- a/htdocs/ticketsup/index.php +++ b/htdocs/ticketsup/index.php @@ -29,7 +29,7 @@ // Load traductions files requiredby by page $langs->load("companies"); $langs->load("other"); -$langs->load("ticketsup@ticketsup"); +$langs->load("ticketsup"); $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); @@ -55,17 +55,17 @@ $object = new ActionsTicketsup($db); -/******************************************************************* - * ACTIONS - * - * Put here all code to do according to value of "action" parameter - ********************************************************************/ -/*************************************************** - * PAGE - * - * Put here all code to build page - ****************************************************/ +/* + * Actions + */ + +// None + + +/* + * View + */ llxHeader('', $langs->trans('TicketsIndex'), ''); @@ -241,10 +241,10 @@ $px1->SetCssPrefix("cssboxes"); $px1->mode = 'depth'; //$px1->SetTitle($langs->trans("TicketStatByStatus")); - + $px1->draw($filenamenb, $fileurlnb); print $px1->show(); - + print $stringtoshow; } } @@ -295,7 +295,7 @@ $i = 0; - $transRecordedType = $langs->trans("LastNewTickets", $max); + $transRecordedType = $langs->trans("LatestNewTickets", $max); print ''; print ''; print ''; @@ -347,7 +347,7 @@ $db->free(); } else { - print ''; + print ''; } print "
' . $transRecordedType . '' . $langs->trans('Ref') . '
' . $langs->trans('NoTicketsFound') . '
' . $langs->trans('NoTicketsFound') . '
"; diff --git a/htdocs/ticketsup/list.php b/htdocs/ticketsup/list.php index 43c405c5578d7..ea56c133b6b10 100644 --- a/htdocs/ticketsup/list.php +++ b/htdocs/ticketsup/list.php @@ -34,7 +34,6 @@ include_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; } -// Load traductions files requiredby by page // Load traductions files requiredby by page $langs->loadLangs( array( @@ -60,7 +59,7 @@ $msg_id = GETPOST('msg_id', 'int'); $socid = GETPOST('socid', 'int'); $projectid = GETPOST('projectid', 'int'); - +$search_fk_status = GETPOST('search_fk_status', 'alpha'); $mode = GETPOST('mode', 'alpha'); // Load variable for pagination @@ -186,16 +185,15 @@ } -/*************************************************** - * PAGE - * - * Put here all code to build page - ****************************************************/ + +/* + * View + */ + $help_url = 'FR:DocumentationModuleTicket'; llxHeader('', $langs->trans('TicketList'), $help_url); $form = new Form($db); - $formTicket = new FormTicketsup($db); $user_assign = new User($db); @@ -203,9 +201,6 @@ $socstatic = new Societe($db); -$search_fk_status = GETPOST('search_fk_status', 'alpha'); - - // Build and execute select // -------------------------------------------------------------------- $sql = 'SELECT '; @@ -447,7 +442,7 @@ print_barre_liste($langs->trans('TicketList'), $page, 'list.php', $param, $sortfield, $sortorder, '', $num, $num_total, 'img/ticketsup-32.png', 1); if ($mode == 'my_assign') { - print '
' . $langs->trans('TicketAssignedToMeInfos') . '
'; + print '
' . $langs->trans('TicketAssignedToMeInfos') . '

'; } // Add code for pre mass action (confirmation or email presend form) $topicmail="SendTicketsupRef"; diff --git a/htdocs/ticketsup/new.php b/htdocs/ticketsup/new.php index 18e8fbf5a173a..3d1a3c7c9f2de 100644 --- a/htdocs/ticketsup/new.php +++ b/htdocs/ticketsup/new.php @@ -1,6 +1,6 @@ - * 2016 Christophe Battarel +/* Copyright (C) 2013-2016 Jean-François FERRY + * Copyright (C) 2016 Christophe Battarel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,13 +50,19 @@ $object = new ActionsTicketsup($db); + +/* + * Actions + */ + $object->doActions($action); -/*************************************************** - * PAGE - * - * Put here all code to build page - ****************************************************/ + + +/* + * View + */ + $help_url = 'FR:DocumentationModuleTicket'; $page_title = $object->getTitle($action); llxHeader('', $page_title, $help_url); @@ -85,11 +91,6 @@ $formticket->showForm(); } -/*************************************************** - * LINKED OBJECT BLOCK - * - * Put here code to view linked object - ****************************************************/ //$somethingshown=$object->showLinkedObjectBlock(); // End of page diff --git a/htdocs/ticketsup/tpl/linkedobjectblock.tpl.php b/htdocs/ticketsup/tpl/linkedobjectblock.tpl.php index dc03dd32c3cb6..824f392d638f8 100644 --- a/htdocs/ticketsup/tpl/linkedobjectblock.tpl.php +++ b/htdocs/ticketsup/tpl/linkedobjectblock.tpl.php @@ -29,7 +29,7 @@ load('ticketsup@ticketsup'); +$langs->load('ticketsup'); $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; echo '
'; print_titre($langs->trans('RelatedTickets')); @@ -47,7 +47,7 @@ subject) ? ' '.$object->subject : ''); ?> + trans("ShowTicket"), "ticketsup") . ' ' . (! empty($object->subject) ? ' '.$object->subject : ''); ?> datec, 'day'); ?>