Dolibarrize module ticket

This commit is contained in:
Laurent Destailleur 2018-03-11 23:40:25 +01:00
parent 6ac070823f
commit ae82d045f8
27 changed files with 101 additions and 104 deletions

View File

@ -26,6 +26,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.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."/ticketsup/class/ticketsup.class.php";
require_once DOL_DOCUMENT_ROOT."/core/lib/ticketsup.lib.php"; require_once DOL_DOCUMENT_ROOT."/core/lib/ticketsup.lib.php";
// Translations // Translations
$langs->load("ticketsup"); $langs->load("ticketsup");
@ -214,9 +215,12 @@ if ($action == 'setvarother') {
} }
} }
/* /*
* View * View
*/ */
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
$form = new Form($db); $form = new Form($db);
@ -226,28 +230,22 @@ $page_name = "TicketsupSetup";
llxHeader('', $langs->trans($page_name), $help_url); llxHeader('', $langs->trans($page_name), $help_url);
// Subheader // Subheader
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
. $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans($page_name), $linkback); print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
// Configuration header // Configuration header
$head = ticketsupAdminPrepareHead(); $head = ticketsupAdminPrepareHead();
dol_fiche_head(
$head,
'settings',
$langs->trans("Module56000Name"),
0,
"ticketsup"
);
print '<div class="info"><p>' . $langs->trans("TicketsupSetupDictionaries") . ' : <a href="' . dol_buildpath('/admin/dict.php', 1) . '" >' . dol_buildpath('/admin/dict.php', 2) . '</a></p></div>'; dol_fiche_head($head, 'settings', $langs->trans("Module56000Name"), -1, "ticketsup");
print '<p>' . $langs->trans("TicketsupPublicAccess") . ' : <a href="' . dol_buildpath('/ticketsup/public/index.php', 1) . '" target="_blank" >' . dol_buildpath('/ticketsup/public/index.php', 2) . '</a></p>'; print $langs->trans("TicketsupSetupDictionaries") . ' : <a href="' . dol_buildpath('/admin/dict.php', 1) . '" >' . dol_buildpath('/admin/dict.php', 2) . '</a><br>';
//print '<p>'. $langs->trans("TicketsupSetupPage").'</p>'; print $langs->trans("TicketsupPublicAccess") . ' : <a href="' . dol_buildpath('/ticketsup/public/index.php', 1) . '" target="_blank" >' . dol_buildpath('/ticketsup/public/index.php', 2) . '</a>';
dol_fiche_end(); dol_fiche_end();
/* /*
* Projects Numbering model * Projects Numbering model
*/ */

View File

@ -47,11 +47,15 @@ if (!$user->admin) {
accessforbidden(); accessforbidden();
} }
/* /*
* Actions * Actions
*/ */
include DOL_DOCUMENT_ROOT . '/core/actions_extrafields.inc.php'; include DOL_DOCUMENT_ROOT . '/core/actions_extrafields.inc.php';
/* /*
* View * View
*/ */
@ -63,17 +67,11 @@ $page_name = "TicketsupSetup";
llxHeader('', $langs->trans($page_name), $help_url); llxHeader('', $langs->trans($page_name), $help_url);
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>'; $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans("TicketsupSetup"), $linkback, 'setup'); print load_fiche_titre($langs->trans("TicketsupSetup"), $linkback, 'title_setup');
$head = ticketsupAdminPrepareHead(); $head = ticketsupAdminPrepareHead();
dol_fiche_head( dol_fiche_head($head, 'attributes', $langs->trans("Module56000Name"), -1, "ticketsup");
$head,
'attributes',
$langs->trans("Module56000Name"),
0,
"ticketsup"
);
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

View File

@ -31,7 +31,7 @@ class box_last_modified_ticketsup extends ModeleBoxes
{ {
public $boxcode = "box_last_modified_ticketsup"; public $boxcode = "box_last_modified_ticketsup";
public $boximg = "ticketsup@ticketsup"; public $boximg = "ticketsup";
public $boxlabel; public $boxlabel;
public $depends = array("ticketsup"); public $depends = array("ticketsup");
public $db; public $db;

View File

@ -31,7 +31,7 @@ class box_last_ticketsup extends ModeleBoxes
{ {
public $boxcode = "box_last_ticketsup"; public $boxcode = "box_last_ticketsup";
public $boximg = "ticketsup@ticketsup"; public $boximg = "ticketsup";
public $boxlabel; public $boxlabel;
public $depends = array("ticketsup"); public $depends = array("ticketsup");
public $db; public $db;

View File

@ -122,7 +122,7 @@ class FormTicketsup
$langs->load("other"); $langs->load("other");
$langs->load("mails"); $langs->load("mails");
$langs->load("ticketsup@ticketsup"); $langs->load("ticketsup");
$form = new Form($this->db); $form = new Form($this->db);
$formcompany = new FormCompany($this->db); $formcompany = new FormCompany($this->db);
@ -148,6 +148,7 @@ class FormTicketsup
} }
print '<input type="hidden" name="fk_user_create" value="' . $this->fk_user_create . '">'; print '<input type="hidden" name="fk_user_create" value="' . $this->fk_user_create . '">';
print '<div class="tabBar tabBarWithBottom">';
print '<table class="border" width="' . $width . '">'; print '<table class="border" width="' . $width . '">';
@ -392,6 +393,7 @@ class FormTicketsup
} }
print '</table>'; print '</table>';
print '</div>';
print '<center>'; print '<center>';
print '<input class="button" type="submit" name="add_ticket" value="' . $langs->trans(($this->withthreadid > 0 ? "SendResponse" : "NewTicket")) . '" />'; print '<input class="button" type="submit" name="add_ticket" value="' . $langs->trans(($this->withthreadid > 0 ? "SendResponse" : "NewTicket")) . '" />';

View File

@ -205,7 +205,7 @@ class Translate
// Check cache // Check cache
if (! empty($this->_tab_loaded[$newdomain])) // File already loaded for this domain 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; return 0;
} }
@ -231,7 +231,7 @@ class Translate
$filelangexists=is_file($file_lang_osencoded); $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) if ($filelangexists)
{ {

View File

@ -31,7 +31,7 @@ function ticketsupAdminPrepareHead()
{ {
global $langs, $conf; global $langs, $conf;
$langs->load("ticketsup@ticketsup"); $langs->load("ticketsup");
$h = 0; $h = 0;
$head = array(); $head = array();

View File

@ -74,7 +74,7 @@ class modTicketsup extends DolibarrModules
// use this->picto='pictovalue' // use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png // If file is in module/img directory under name object_pictovalue.png
// use this->picto='pictovalue@module' // 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...) // Defined all module parts (triggers, login, substitutions, menus, css, etc...)
// for default path (eg: /ticketsup/core/xxxxx) (0=disable, 1=enable) // for default path (eg: /ticketsup/core/xxxxx) (0=disable, 1=enable)
// for specific path of parts (eg: /ticketsup/core/modules/barcode) // for specific path of parts (eg: /ticketsup/core/modules/barcode)
@ -135,7 +135,7 @@ class modTicketsup extends DolibarrModules
$conf->ticketsup->enabled=0; $conf->ticketsup->enabled=0;
} }
$this->dictionaries = array( $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"), '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"), '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'), '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 @@ class modTicketsup extends DolibarrModules
$r = 0; $r = 0;
// Example: // Example:
$this->boxes[$r][1] = "box_last_ticketsup@ticketsup"; $this->boxes[$r][1] = "box_last_ticketsup";
$r++; $r++;
$this->boxes[$r][1] = "box_last_modified_ticketsup@ticketsup"; $this->boxes[$r][1] = "box_last_modified_ticketsup";
$r++; $r++;
// Permissions // Permissions
@ -209,7 +209,7 @@ class modTicketsup extends DolibarrModules
'mainmenu' => 'ticketsup', 'mainmenu' => 'ticketsup',
'leftmenu' => '1', // Use 1 if you also want to add left menu entries using this descriptor. 'leftmenu' => '1', // Use 1 if you also want to add left menu entries using this descriptor.
'url' => '/ticketsup/index.php', '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, '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. '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 '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 @@ class modTicketsup extends DolibarrModules
'mainmenu' => 'ticketsup', 'mainmenu' => 'ticketsup',
'leftmenu' => 'ticketsup', 'leftmenu' => 'ticketsup',
'url' => '/ticketsup/index.php', 'url' => '/ticketsup/index.php',
'langs' => 'ticketsup@ticketsup', 'langs' => 'ticketsup',
'position' => 101, 'position' => 101,
'enabled' => 1, 'enabled' => 1,
'perms' => '$user->rights->ticketsup->read', 'perms' => '$user->rights->ticketsup->read',
@ -236,7 +236,7 @@ class modTicketsup extends DolibarrModules
'titre' => 'NewTicket', 'titre' => 'NewTicket',
'mainmenu' => 'ticketsup', 'mainmenu' => 'ticketsup',
'url' => '/ticketsup/new.php?action=create_ticket', 'url' => '/ticketsup/new.php?action=create_ticket',
'langs' => 'ticketsup@ticketsup', 'langs' => 'ticketsup',
'position' => 102, 'position' => 102,
'enabled' => 1, 'enabled' => 1,
'perms' => '$user->rights->ticketsup->write', 'perms' => '$user->rights->ticketsup->write',
@ -250,7 +250,7 @@ class modTicketsup extends DolibarrModules
'mainmenu' => 'ticketsup', 'mainmenu' => 'ticketsup',
'leftmenu' => 'ticketsuplist', 'leftmenu' => 'ticketsuplist',
'url' => '/ticketsup/list.php', 'url' => '/ticketsup/list.php',
'langs' => 'ticketsup@ticketsup', 'langs' => 'ticketsup',
'position' => 103, 'position' => 103,
'enabled' => 1, 'enabled' => 1,
'perms' => '$user->rights->ticketsup->read', 'perms' => '$user->rights->ticketsup->read',
@ -264,7 +264,7 @@ class modTicketsup extends DolibarrModules
'mainmenu' => 'ticketsup', 'mainmenu' => 'ticketsup',
'leftmenu' => 'ticketsuplist', 'leftmenu' => 'ticketsuplist',
'url' => '/ticketsup/list.php?search_fk_status=non_closed', 'url' => '/ticketsup/list.php?search_fk_status=non_closed',
'langs' => 'ticketsup@ticketsup', 'langs' => 'ticketsup',
'position' => 104, 'position' => 104,
'enabled' => 1, 'enabled' => 1,
'perms' => '$user->rights->ticketsup->read', 'perms' => '$user->rights->ticketsup->read',
@ -278,7 +278,7 @@ class modTicketsup extends DolibarrModules
'mainmenu' => 'ticketsup', 'mainmenu' => 'ticketsup',
'leftmenu' => 'ticketsupmy', 'leftmenu' => 'ticketsupmy',
'url' => '/ticketsup/list.php?mode=my_assign', 'url' => '/ticketsup/list.php?mode=my_assign',
'langs' => 'ticketsup@ticketsup', 'langs' => 'ticketsup',
'position' => 105, 'position' => 105,
'enabled' => 1, 'enabled' => 1,
'perms' => '$user->rights->ticketsup->read', 'perms' => '$user->rights->ticketsup->read',
@ -291,7 +291,7 @@ class modTicketsup extends DolibarrModules
'titre' => 'MenuTicketsupMyAssignNonClosed', 'titre' => 'MenuTicketsupMyAssignNonClosed',
'mainmenu' => 'ticketsup', 'mainmenu' => 'ticketsup',
'url' => '/ticketsup/list.php?mode=my_assign&search_fk_status=non_closed', 'url' => '/ticketsup/list.php?mode=my_assign&search_fk_status=non_closed',
'langs' => 'ticketsup@ticketsup', 'langs' => 'ticketsup',
'position' => 106, 'position' => 106,
'enabled' => 1, 'enabled' => 1,
'perms' => '$user->rights->ticketsup->read', 'perms' => '$user->rights->ticketsup->read',

View File

@ -49,7 +49,7 @@ abstract class ModeleNumRefTicketsup
public function info() public function info()
{ {
global $langs; global $langs;
$langs->load("ticketsup@ticketsup"); $langs->load("ticketsup");
return $langs->trans("NoDescription"); return $langs->trans("NoDescription");
} }
@ -61,7 +61,7 @@ abstract class ModeleNumRefTicketsup
public function getExample() public function getExample()
{ {
global $langs; global $langs;
$langs->load("ticketsup@ticketsup"); $langs->load("ticketsup");
return $langs->trans("NoExample"); return $langs->trans("NoExample");
} }

View File

@ -43,7 +43,7 @@ class mod_ticketsup_universal extends ModeleNumRefTicketsup
{ {
global $conf, $langs; global $conf, $langs;
$langs->load("ticketsup@ticketsup"); $langs->load("ticketsup");
$langs->load("admin"); $langs->load("admin");
$form = new Form($this->db); $form = new Form($this->db);

View File

@ -50,7 +50,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
$this->family = "ticketsup"; $this->family = "ticketsup";
$this->description = "Triggers of the module ticketsup"; $this->description = "Triggers of the module ticketsup";
$this->version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' or version
$this->picto = 'ticketsup@ticketsup'; $this->picto = 'ticketsup';
} }
/** /**
@ -176,7 +176,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
$filename = array(); $filename = array();
$mimetype = array(); $mimetype = array();
$langs->load('ticketsup@ticketsup'); $langs->load('ticketsup');
$object->fetch('', $object->track_id); $object->fetch('', $object->track_id);

View File

@ -146,6 +146,7 @@ CREATE TABLE llx_ticketsup
tms timestamp tms timestamp
)ENGINE=innodb; )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 UNIQUE uk_ticketsup_rowid_track_id (rowid, track_id);
ALTER TABLE llx_ticketsup ADD INDEX id_ticketsup_track_id (track_id); ALTER TABLE llx_ticketsup ADD INDEX id_ticketsup_track_id (track_id);

View File

@ -37,5 +37,6 @@ CREATE TABLE llx_ticketsup
datec datetime, datec datetime,
date_read datetime, date_read datetime,
date_close datetime, date_close datetime,
notify_tiers_at_create,
tms timestamp tms timestamp
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -180,7 +180,7 @@ TicketMessageSuccessfullyAdded=Message successfully added
TicketMessagesList=Message list TicketMessagesList=Message list
NoMsgForThisTicket=No message for this ticket NoMsgForThisTicket=No message for this ticket
Properties=Classification Properties=Classification
LastNewTickets=Last %s tickets newest (not read) LatestNewTickets=Last %s tickets newest (not read)
TicketSeverity=Severity TicketSeverity=Severity
ShowTicket=See ticket ShowTicket=See ticket
RelatedTickets=Related tickets RelatedTickets=Related tickets

View File

@ -56,7 +56,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
$langs->load("companies"); $langs->load("companies");
$langs->load("other"); $langs->load("other");
$langs->load("mails"); $langs->load("mails");
$langs->load("ticketsup@ticketsup"); $langs->load("ticketsup");
// Get parameters // Get parameters
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');

View File

@ -51,7 +51,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
// Load traductions files requiredby by page // Load traductions files requiredby by page
$langs->load("companies"); $langs->load("companies");
$langs->load("other"); $langs->load("other");
$langs->load("ticketsup@ticketsup"); $langs->load("ticketsup");
$langs->load("errors"); $langs->load("errors");
// Get parameters // Get parameters

View File

@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/ticketsup/lib/ticketsup.lib.php';
// Load traductions files requiredby by page // Load traductions files requiredby by page
$langs->load("companies"); $langs->load("companies");
$langs->load("other"); $langs->load("other");
$langs->load("ticketsup@ticketsup"); $langs->load("ticketsup");
// Get parameters // Get parameters
$track_id = GETPOST('track_id', 'alpha'); $track_id = GETPOST('track_id', 'alpha');

View File

@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/ticketsup/lib/ticketsup.lib.php';
// Load traductions files requiredby by page // Load traductions files requiredby by page
$langs->load("companies"); $langs->load("companies");
$langs->load("other"); $langs->load("other");
$langs->load("ticketsup@ticketsup"); $langs->load("ticketsup");
// Get parameters // Get parameters
$track_id = GETPOST('track_id', 'alpha'); $track_id = GETPOST('track_id', 'alpha');

View File

@ -48,7 +48,7 @@ if (!class_exists('Contact')) {
// Load traductions files requiredby by page // Load traductions files requiredby by page
$langs->load("companies"); $langs->load("companies");
$langs->load("other"); $langs->load("other");
$langs->load("ticketsup@ticketsup"); $langs->load("ticketsup");
// Get parameters // Get parameters
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
@ -208,7 +208,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
} }
$head = ticketsup_prepare_head($object->dao); $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; $object->dao->label = $object->dao->ref;
// Author // Author
if ($object->dao->fk_user_create > 0) { if ($object->dao->fk_user_create > 0) {

View File

@ -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 * @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 @@ class Ticketsup extends CommonObject
$lien = '<a href="' . dol_buildpath("/ticketsup/card.php?track_id=" . $this->track_id, 1) . '">'; $lien = '<a href="' . dol_buildpath("/ticketsup/card.php?track_id=" . $this->track_id, 1) . '">';
$lienfin = '</a>'; $lienfin = '</a>';
$picto = 'ticketsup@ticketsup'; $picto = 'ticketsup';
if (!$this->public) { if (!$this->public) {
$picto = 'ticketsup@ticketsup'; $picto = 'ticketsup';
} }
$label = $langs->trans("ShowTicket") . ': ' . $this->ref . ' - ' . $this->subject; $label = $langs->trans("ShowTicket") . ': ' . $this->ref . ' - ' . $this->subject;
@ -1501,7 +1501,7 @@ class Ticketsup extends CommonObject
$nb_sent = 0; $nb_sent = 0;
$langs->load('ticketsup@ticketsup'); $langs->load('ticketsup');
// Retrieve email of all contacts (internal and external) // Retrieve email of all contacts (internal and external)
$contacts = $this->listeContact(-1, 'internal'); $contacts = $this->listeContact(-1, 'internal');

View File

@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
// Load traductions files requiredby by page // Load traductions files requiredby by page
$langs->load("companies"); $langs->load("companies");
$langs->load("ticketsup@ticketsup"); $langs->load("ticketsup");
// Get parameters // Get parameters
$socid = GETPOST("socid", 'int'); $socid = GETPOST("socid", 'int');
@ -144,7 +144,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
$object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'"; $object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'";
} }
$head = ticketsup_prepare_head($object); $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; $object->label = $object->ref;
// Author // Author
if ($object->fk_user_create > 0) { if ($object->fk_user_create > 0) {

View File

@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
$langs->load("companies"); $langs->load("companies");
$langs->load('other'); $langs->load('other');
$langs->load("ticketsup");
$action = GETPOST('action'); $action = GETPOST('action');
$confirm = GETPOST('confirm'); $confirm = GETPOST('confirm');
@ -122,7 +123,7 @@ if ($object->id) {
$object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'"; $object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'";
} }
$head = ticketsup_prepare_head($object); $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; $object->label = $object->ref;
// Author // Author
if ($object->fk_user_create > 0) { if ($object->fk_user_create > 0) {

View File

@ -36,7 +36,7 @@ if (!class_exists('Contact')) {
// Load traductions files requiredby by page // Load traductions files requiredby by page
$langs->load("companies"); $langs->load("companies");
$langs->load("other"); $langs->load("other");
$langs->load("ticketsup@ticketsup"); $langs->load("ticketsup");
// Get parameters // Get parameters
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
@ -102,7 +102,7 @@ if ($action == 'view') {
$object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'"; $object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'";
} }
$head = ticketsup_prepare_head($object->dao); $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; $object->dao->label = $object->dao->ref;
// Author // Author
if ($object->dao->fk_user_create > 0) { if ($object->dao->fk_user_create > 0) {

View File

@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/dolgraph.class.php';
// Load traductions files requiredby by page // Load traductions files requiredby by page
$langs->load("companies"); $langs->load("companies");
$langs->load("other"); $langs->load("other");
$langs->load("ticketsup@ticketsup"); $langs->load("ticketsup");
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
@ -55,17 +55,17 @@ $endyear = $year;
$object = new ActionsTicketsup($db); $object = new ActionsTicketsup($db);
/*******************************************************************
* ACTIONS
*
* Put here all code to do according to value of "action" parameter
********************************************************************/
/*************************************************** /*
* PAGE * Actions
* */
* Put here all code to build page
****************************************************/ // None
/*
* View
*/
llxHeader('', $langs->trans('TicketsIndex'), ''); llxHeader('', $langs->trans('TicketsIndex'), '');
@ -295,7 +295,7 @@ if ($result) {
$i = 0; $i = 0;
$transRecordedType = $langs->trans("LastNewTickets", $max); $transRecordedType = $langs->trans("LatestNewTickets", $max);
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th>' . $transRecordedType . '</th>'; print '<tr class="liste_titre"><th>' . $transRecordedType . '</th>';
print '<th>' . $langs->trans('Ref') . '</th>'; print '<th>' . $langs->trans('Ref') . '</th>';
@ -347,7 +347,7 @@ if ($result) {
$db->free(); $db->free();
} else { } else {
print '<tr><td colspan="6"><div class="info">' . $langs->trans('NoTicketsFound') . '</div></td></tr>'; print '<tr><td colspan="6" class="opacitymedium">' . $langs->trans('NoTicketsFound') . '</td></tr>';
} }
print "</table>"; print "</table>";

View File

@ -34,7 +34,6 @@ if (!empty($conf->projet->enabled)) {
include_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
} }
// Load traductions files requiredby by page
// Load traductions files requiredby by page // Load traductions files requiredby by page
$langs->loadLangs( $langs->loadLangs(
array( array(
@ -60,7 +59,7 @@ $id = GETPOST('id','int');
$msg_id = GETPOST('msg_id', 'int'); $msg_id = GETPOST('msg_id', 'int');
$socid = GETPOST('socid', 'int'); $socid = GETPOST('socid', 'int');
$projectid = GETPOST('projectid', 'int'); $projectid = GETPOST('projectid', 'int');
$search_fk_status = GETPOST('search_fk_status', 'alpha');
$mode = GETPOST('mode', 'alpha'); $mode = GETPOST('mode', 'alpha');
// Load variable for pagination // Load variable for pagination
@ -186,16 +185,15 @@ if (empty($reshook))
} }
/***************************************************
* PAGE /*
* * View
* Put here all code to build page */
****************************************************/
$help_url = 'FR:DocumentationModuleTicket'; $help_url = 'FR:DocumentationModuleTicket';
llxHeader('', $langs->trans('TicketList'), $help_url); llxHeader('', $langs->trans('TicketList'), $help_url);
$form = new Form($db); $form = new Form($db);
$formTicket = new FormTicketsup($db); $formTicket = new FormTicketsup($db);
$user_assign = new User($db); $user_assign = new User($db);
@ -203,9 +201,6 @@ $user_create = new User($db);
$socstatic = new Societe($db); $socstatic = new Societe($db);
$search_fk_status = GETPOST('search_fk_status', 'alpha');
// Build and execute select // Build and execute select
// -------------------------------------------------------------------- // --------------------------------------------------------------------
$sql = 'SELECT '; $sql = 'SELECT ';
@ -447,7 +442,7 @@ print '<input type="hidden" name="mode" value="' . $mode . '" >';
print_barre_liste($langs->trans('TicketList'), $page, 'list.php', $param, $sortfield, $sortorder, '', $num, $num_total, 'img/ticketsup-32.png', 1); print_barre_liste($langs->trans('TicketList'), $page, 'list.php', $param, $sortfield, $sortorder, '', $num, $num_total, 'img/ticketsup-32.png', 1);
if ($mode == 'my_assign') { if ($mode == 'my_assign') {
print '<div class="info">' . $langs->trans('TicketAssignedToMeInfos') . '</div>'; print '<div class="opacitymedium">' . $langs->trans('TicketAssignedToMeInfos') . '</div><br>';
} }
// Add code for pre mass action (confirmation or email presend form) // Add code for pre mass action (confirmation or email presend form)
$topicmail="SendTicketsupRef"; $topicmail="SendTicketsupRef";

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) - 2013-2016 Jean-François FERRY <hello@librethic.io> /* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
* 2016 Christophe Battarel <christophe@altairis.fr> * Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -50,13 +50,19 @@ if (!$user->rights->ticketsup->read || !$user->rights->ticketsup->write) {
$object = new ActionsTicketsup($db); $object = new ActionsTicketsup($db);
/*
* Actions
*/
$object->doActions($action); $object->doActions($action);
/***************************************************
* PAGE
* /*
* Put here all code to build page * View
****************************************************/ */
$help_url = 'FR:DocumentationModuleTicket'; $help_url = 'FR:DocumentationModuleTicket';
$page_title = $object->getTitle($action); $page_title = $object->getTitle($action);
llxHeader('', $page_title, $help_url); llxHeader('', $page_title, $help_url);
@ -85,11 +91,6 @@ if ($action == 'create_ticket') {
$formticket->showForm(); $formticket->showForm();
} }
/***************************************************
* LINKED OBJECT BLOCK
*
* Put here code to view linked object
****************************************************/
//$somethingshown=$object->showLinkedObjectBlock(); //$somethingshown=$object->showLinkedObjectBlock();
// End of page // End of page

View File

@ -29,7 +29,7 @@ if (empty($conf) || ! is_object($conf))
<?php <?php
$langs = $GLOBALS['langs']; $langs = $GLOBALS['langs'];
$langs->load('ticketsup@ticketsup'); $langs->load('ticketsup');
$linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
echo '<br>'; echo '<br>';
print_titre($langs->trans('RelatedTickets')); print_titre($langs->trans('RelatedTickets'));
@ -47,7 +47,7 @@ foreach ($linkedObjectBlock as $object) {
<tr class="oddeven"> <tr class="oddeven">
<td> <td>
<a href="<?php echo dol_buildpath("/ticketsup/card.php", 1).'?track_id='.$object->track_id; ?>"> <a href="<?php echo dol_buildpath("/ticketsup/card.php", 1).'?track_id='.$object->track_id; ?>">
<?php echo img_object($langs->trans("ShowTicket"), "ticketsup@ticketsup") . ' ' . (! empty($object->subject) ? ' '.$object->subject : ''); ?> <?php echo img_object($langs->trans("ShowTicket"), "ticketsup") . ' ' . (! empty($object->subject) ? ' '.$object->subject : ''); ?>
</a> </a>
</td> </td>
<td align="center"><?php echo dol_print_date($object->datec, 'day'); ?></td> <td align="center"><?php echo dol_print_date($object->datec, 'day'); ?></td>