2
0
forked from Wavyzz/dolibarr

Fix conflict with external ticketsup module

This commit is contained in:
Laurent Destailleur
2018-06-04 21:49:29 +02:00
parent 7a8fac4198
commit 87d073b5cd
87 changed files with 943 additions and 939 deletions

View File

@@ -17,18 +17,18 @@
*/
/**
* \file admin/ticketsup.php
* \ingroup ticketsup
* \file admin/ticket.php
* \ingroup ticket
* \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";
require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php";
require_once DOL_DOCUMENT_ROOT."/core/lib/ticket.lib.php";
// Load translation files required by the page
$langs->load("ticketsup");
$langs->load("ticket");
// Access control
if (!$user->admin) {
@@ -40,11 +40,11 @@ $value = GETPOST('value', 'alpha');
$action = GETPOST('action', 'alpha');
$label = GETPOST('label', 'alpha');
$scandir = GETPOST('scandir', 'alpha');
$type = 'ticketsup';
$type = 'ticket';
if ($action == 'updateMask') {
$maskconstticket = GETPOST('maskconstticketsup', 'alpha');
$maskticket = GETPOST('maskticketsup', 'alpha');
$maskconstticket = GETPOST('maskconstticket', 'alpha');
$maskticket = GETPOST('maskticket', 'alpha');
if ($maskconstticket) {
$res = dolibarr_set_const($db, $maskconstticket, $maskticket, 'chaine', 0, '', $conf->entity);
@@ -226,7 +226,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
$form = new Form($db);
$help_url = "FR:Module_Ticket";
$page_name = "TicketsupSetup";
$page_name = "TicketSetup";
llxHeader('', $langs->trans($page_name), $help_url);
// Subheader
@@ -235,13 +235,13 @@ $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans(
print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
// Configuration header
$head = ticketsupAdminPrepareHead();
$head = ticketAdminPrepareHead();
dol_fiche_head($head, 'settings', $langs->trans("Module56000Name"), -1, "ticketsup");
dol_fiche_head($head, 'settings', $langs->trans("Module56000Name"), -1, "ticket");
print $langs->trans("TicketsupSetupDictionaries") . ' : <a href="' . dol_buildpath('/admin/dict.php', 1) . '" >' . dol_buildpath('/admin/dict.php', 2) . '</a><br>';
print $langs->trans("TicketSetupDictionaries") . ' : <a href="' . dol_buildpath('/admin/dict.php', 1) . '" >' . dol_buildpath('/admin/dict.php', 2) . '</a><br>';
print $langs->trans("TicketsupPublicAccess") . ' : <a href="' . dol_buildpath('/public/ticketsup/index.php', 1) . '" target="_blank" >' . dol_buildpath('/public/ticketsup/index.php', 2) . '</a>';
print $langs->trans("TicketPublicAccess") . ' : <a href="' . dol_buildpath('/public/ticket/index.php', 1) . '" target="_blank" >' . dol_buildpath('/public/ticket/index.php', 2) . '</a>';
dol_fiche_end();
@@ -250,7 +250,7 @@ dol_fiche_end();
* Projects Numbering model
*/
print_titre($langs->trans("TicketSupNumberingModules"));
print_titre($langs->trans("TicketNumberingModules"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@@ -264,7 +264,7 @@ print "</tr>\n";
clearstatcache();
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir . "core/modules/ticketsup/");
$dir = dol_buildpath($reldir . "core/modules/ticket/");
if (is_dir($dir)) {
$handle = opendir($dir);
@@ -314,7 +314,7 @@ foreach ($dirmodels as $reldir) {
}
print '</td>';
$ticket = new Ticketsup($db);
$ticket = new Ticket($db);
$ticket->initAsSpecimen();
// Info
@@ -526,7 +526,7 @@ print "</tr>\n";
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
print '<tr>';
print '<td colspan="3"><div class="info">' . $langs->trans("TicketSupCkEditorEmailNotActivated") . '</div></td>';
print '<td colspan="3"><div class="info">' . $langs->trans("TicketCkEditorEmailNotActivated") . '</div></td>';
print "</tr>\n";
}

View File

@@ -16,18 +16,18 @@
*/
/**
* \file ticketsup/admin/ticketsup_extrafields.php
* \ingroup ticketsup
* \file ticket/admin/ticket_extrafields.php
* \ingroup ticket
* \brief Page to setup extra fields of ticket
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT."/core/lib/ticketsup.lib.php";
require_once DOL_DOCUMENT_ROOT."/core/lib/ticket.lib.php";
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
// Load translation files required by the page
$langs->loadLangs(array('ticketsup', 'admin'));
$langs->loadLangs(array('ticket', 'admin'));
$extrafields = new ExtraFields($db);
$form = new Form($db);
@@ -41,7 +41,7 @@ foreach ($tmptype2label as $key => $val) {
$action = GETPOST('action', 'alpha');
$attrname = GETPOST('attrname', 'alpha');
$elementtype = 'ticketsup'; //Must be the $table_element of the class that manage extrafield
$elementtype = 'ticket'; //Must be the $table_element of the class that manage extrafield
if (!$user->admin) {
accessforbidden();
@@ -60,18 +60,18 @@ include DOL_DOCUMENT_ROOT . '/core/actions_extrafields.inc.php';
* View
*/
$textobject = $langs->transnoentitiesnoconv("TicketSup");
$textobject = $langs->transnoentitiesnoconv("Ticket");
$help_url = "FR:Module_Ticket";
$page_name = "TicketsupSetup";
$page_name = "TicketSetup";
llxHeader('', $langs->trans($page_name), $help_url);
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans("TicketsupSetup"), $linkback, 'title_setup');
print load_fiche_titre($langs->trans("TicketSetup"), $linkback, 'title_setup');
$head = ticketsupAdminPrepareHead();
$head = ticketAdminPrepareHead();
dol_fiche_head($head, 'attributes', $langs->trans("Module56000Name"), -1, "ticketsup");
dol_fiche_head($head, 'attributes', $langs->trans("Module56000Name"), -1, "ticket");
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

View File

@@ -18,8 +18,8 @@
*/
/**
* \file core/boxes/box_last_modified_ticketsup.php
* \ingroup ticketsup
* \file core/boxes/box_last_modified_ticket.php
* \ingroup ticket
* \brief This box shows latest modified tickets
*/
require_once DOL_DOCUMENT_ROOT . "/core/boxes/modules_boxes.php";
@@ -27,13 +27,13 @@ require_once DOL_DOCUMENT_ROOT . "/core/boxes/modules_boxes.php";
/**
* Class to manage the box
*/
class box_last_modified_ticketsup extends ModeleBoxes
class box_last_modified_ticket extends ModeleBoxes
{
public $boxcode = "box_last_modified_ticketsup";
public $boximg = "ticketsup";
public $boxcode = "box_last_modified_ticket";
public $boximg = "ticket";
public $boxlabel;
public $depends = array("ticketsup");
public $depends = array("ticket");
public $db;
public $param;
public $info_box_head = array();
@@ -47,7 +47,7 @@ class box_last_modified_ticketsup extends ModeleBoxes
global $langs;
$langs->load("boxes");
$this->boxlabel = $langs->transnoentitiesnoconv("BoxLastModifiedTicketsup");
$this->boxlabel = $langs->transnoentitiesnoconv("BoxLastModifiedTicket");
}
/**
@@ -62,25 +62,25 @@ class box_last_modified_ticketsup extends ModeleBoxes
$this->max = $max;
dol_include_once("/ticketsup/class/ticketsup.class.php");
dol_include_once("/ticket/class/ticket.class.php");
$text = $langs->trans("BoxLastModifiedTicketsupDescription", $max);
$text = $langs->trans("BoxLastModifiedTicketDescription", $max);
$this->info_box_head = array(
'text' => $text,
'limit' => dol_strlen($text)
);
$this->info_box_contents[0][0] = array('td' => 'align="left"',
'text' => $langs->trans("BoxLastModifiedTicketsupContent"));
'text' => $langs->trans("BoxLastModifiedTicketContent"));
if ($user->rights->ticketsup->read) {
if ($user->rights->ticket->read) {
$sql = "SELECT t.rowid as id, t.ref, t.track_id, t.fk_soc, t.fk_user_create, t.fk_user_assign, t.subject, t.message, t.fk_statut, t.type_code, t.category_code, t.severity_code, t.datec, t.date_read, t.date_close, t.origin_email ";
$sql.= ", type.label as type_label, category.label as category_label, severity.label as severity_label";
$sql.= ", s.nom as company_name";
$sql.= " FROM ".MAIN_DB_PREFIX."ticketsup as t";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticketsup_type as type ON type.code=t.type_code";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticketsup_category as category ON category.code=t.category_code";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticketsup_severity as severity ON severity.code=t.severity_code";
$sql.= " FROM ".MAIN_DB_PREFIX."ticket as t";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code=t.type_code";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code=t.category_code";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code=t.severity_code";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=t.fk_soc";
$sql.= " WHERE t.entity = ".$conf->entity;
@@ -107,7 +107,7 @@ class box_last_modified_ticketsup extends ModeleBoxes
$dateclose=$db->jdate($objp->date_cloture);
$late = '';
$ticketsup = new Ticketsup($this->db);
$ticket = new Ticket($this->db);
$r=0;
@@ -116,21 +116,21 @@ class box_last_modified_ticketsup extends ModeleBoxes
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'url' => dol_buildpath("/ticketsup/card.php?track_id=".$objp->track_id, 1));
'url' => dol_buildpath("/ticket/card.php?track_id=".$objp->track_id, 1));
$r++;
// Id
$this->info_box_contents[$i][$r] = array(
'td' => 'align="left"',
'text' => $objp->ref,
'url' => dol_buildpath("/ticketsup/card.php?track_id=".$objp->track_id, 1));
'url' => dol_buildpath("/ticket/card.php?track_id=".$objp->track_id, 1));
$r++;
// Subject
$this->info_box_contents[$i][$r] = array(
'td' => 'align="left"',
'text' => $objp->subject, // Some event have no ref
'url' => dol_buildpath("/ticketsup/card.php?track_id=".$objp->track_id, 1));
'url' => dol_buildpath("/ticket/card.php?track_id=".$objp->track_id, 1));
$r++;
// Customer
@@ -151,7 +151,7 @@ class box_last_modified_ticketsup extends ModeleBoxes
$r++;
// Statut
$ticketstat = new Ticketsup($this->db);
$ticketstat = new Ticket($this->db);
$ticketstat->fk_statut = $objp->fk_statut;
$this->info_box_contents[$i][$r] = array(
'td' => 'align="right"',
@@ -163,7 +163,7 @@ class box_last_modified_ticketsup extends ModeleBoxes
}
if ($num==0) {
$this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("BoxLastModifiedTicketsupNoRecordedTickets"));
$this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("BoxLastModifiedTicketNoRecordedTickets"));
}
} else {
dol_print_error($db);

View File

@@ -18,8 +18,8 @@
*/
/**
* \file core/boxes/box_ticketsup_latest.php
* \ingroup ticketsup
* \file core/boxes/box_ticket_latest.php
* \ingroup ticket
* \brief This box shows latest created tickets
*/
require_once DOL_DOCUMENT_ROOT . "/core/boxes/modules_boxes.php";
@@ -27,13 +27,13 @@ require_once DOL_DOCUMENT_ROOT . "/core/boxes/modules_boxes.php";
/**
* Class to manage the box
*/
class box_last_ticketsup extends ModeleBoxes
class box_last_ticket extends ModeleBoxes
{
public $boxcode = "box_last_ticketsup";
public $boximg = "ticketsup";
public $boxcode = "box_last_ticket";
public $boximg = "ticket";
public $boxlabel;
public $depends = array("ticketsup");
public $depends = array("ticket");
public $db;
public $param;
public $info_box_head = array();
@@ -47,7 +47,7 @@ class box_last_ticketsup extends ModeleBoxes
global $langs;
$langs->load("boxes");
$this->boxlabel = $langs->transnoentitiesnoconv("BoxLastTicketsup");
$this->boxlabel = $langs->transnoentitiesnoconv("BoxLastTicket");
}
/**
@@ -62,25 +62,25 @@ class box_last_ticketsup extends ModeleBoxes
$this->max = $max;
dol_include_once("/ticketsup/class/ticketsup.class.php");
dol_include_once("/ticket/class/ticket.class.php");
$text = $langs->trans("BoxLastTicketsupDescription", $max);
$text = $langs->trans("BoxLastTicketDescription", $max);
$this->info_box_head = array(
'text' => $text,
'limit' => dol_strlen($text),
);
$this->info_box_contents[0][0] = array('td' => 'align="left"',
'text' => $langs->trans("BoxLastTicketsupContent"));
'text' => $langs->trans("BoxLastTicketContent"));
if ($user->rights->ticketsup->read) {
if ($user->rights->ticket->read) {
$sql = "SELECT t.rowid as id, t.ref, t.track_id, t.fk_soc, t.fk_user_create, t.fk_user_assign, t.subject, t.message, t.fk_statut, t.type_code, t.category_code, t.severity_code, t.datec, t.date_read, t.date_close, t.origin_email ";
$sql .= ", type.label as type_label, category.label as category_label, severity.label as severity_label";
$sql .= ", s.nom as company_name";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticketsup as t";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_type as type ON type.code=t.type_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_category as category ON category.code=t.category_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_severity as severity ON severity.code=t.severity_code";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_type as type ON type.code=t.type_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_category as category ON category.code=t.category_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_severity as severity ON severity.code=t.severity_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid=t.fk_soc";
$sql .= " WHERE t.entity = " . $conf->entity;
@@ -109,7 +109,7 @@ class box_last_ticketsup extends ModeleBoxes
$dateclose = $db->jdate($objp->date_cloture);
$late = '';
$ticketsup = new Ticketsup($this->db);
$ticket = new Ticket($this->db);
$r = 0;
@@ -117,21 +117,21 @@ class box_last_ticketsup extends ModeleBoxes
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'url' => dol_buildpath("/ticketsup/card.php?track_id=" . $objp->track_id, 1));
'url' => dol_buildpath("/ticket/card.php?track_id=" . $objp->track_id, 1));
$r++;
// Id
$this->info_box_contents[$i][$r] = array(
'td' => 'align="left"',
'text' => $objp->ref,
'url' => dol_buildpath("/ticketsup/card.php?track_id=" . $objp->track_id, 1));
'url' => dol_buildpath("/ticket/card.php?track_id=" . $objp->track_id, 1));
$r++;
// Subject
$this->info_box_contents[$i][$r] = array(
'td' => 'align="left"',
'text' => $objp->subject, // Some event have no ref
'url' => dol_buildpath("/ticketsup/card.php?track_id=" . $objp->track_id, 1));
'url' => dol_buildpath("/ticket/card.php?track_id=" . $objp->track_id, 1));
$r++;
// Customer
@@ -151,7 +151,7 @@ class box_last_ticketsup extends ModeleBoxes
$r++;
// Statut
$ticketstat = new Ticketsup($this->db);
$ticketstat = new Ticket($this->db);
$ticketstat->fk_statut = $objp->fk_statut;
$this->info_box_contents[$i][$r] = array(
'td' => 'align="right"',
@@ -163,7 +163,7 @@ class box_last_ticketsup extends ModeleBoxes
}
if ($num == 0) {
$this->info_box_contents[$i][0] = array('td' => 'align="center"', 'text' => $langs->trans("BoxLastTicketsupNoRecordedTickets"));
$this->info_box_contents[$i][0] = array('td' => 'align="center"', 'text' => $langs->trans("BoxLastTicketNoRecordedTickets"));
}
} else {
dol_print_error($db);

View File

@@ -6320,7 +6320,7 @@ abstract class CommonObject
/**
* Show photos of an object (nbmax maximum), into several columns
*
* @param string $modulepart 'product', 'ticketsup', ...
* @param string $modulepart 'product', 'ticket', ...
* @param string $sdir Directory to scan (full absolute path)
* @param int $size 0=original size, 1='small' use thumbnail if possible
* @param int $nbmax Nombre maximum de photos (0=pas de max)
@@ -6346,7 +6346,7 @@ abstract class CommonObject
$dir = $sdir . '/';
$pdir = '/';
if ($modulepart == 'ticketsup')
if ($modulepart == 'ticket')
{
$dir .= get_exdir(0, 0, 0, 0, $this, $modulepart).$this->track_id.'/';
$pdir .= get_exdir(0, 0, 0, 0, $this, $modulepart).$this->track_id.'/';

View File

@@ -1011,7 +1011,7 @@ class FormFile
global $form;
$disablecrop=1;
if (in_array($modulepart, array('societe','product','produit','service','expensereport','holiday','member','project','ticketsup','user'))) $disablecrop=0;
if (in_array($modulepart, array('societe','product','produit','service','expensereport','holiday','member','project','ticket','user'))) $disablecrop=0;
// Define relative path used to store the file
if (empty($relativepath))

View File

@@ -17,8 +17,8 @@
*/
/**
* \file ticketsup/class/html.ticketsup.class.php
* \ingroup core
* \file ticket/class/html.ticket.class.php
* \ingroup ticket
* \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire
*/
require_once DOL_DOCUMENT_ROOT . "/core/class/html.form.class.php";
@@ -31,13 +31,13 @@ if (!class_exists('FormCompany')) {
/**
* Classe permettant la generation du formulaire d'un nouveau ticket.
*
* @package Ticketsup
* @package Ticket
* \remarks Utilisation: $formticketsup = new FormTicketsup($db)
* \remarks $formticketsup->proprietes=1 ou chaine ou tableau de valeurs
* \remarks $formticketsup->show_form() affiche le formulaire
* \remarks Utilisation: $formticket = new FormTicket($db)
* \remarks $formticket->proprietes=1 ou chaine ou tableau de valeurs
* \remarks $formticket->show_form() affiche le formulaire
*/
class FormTicketsup
class FormTicket
{
public $db;
@@ -122,18 +122,18 @@ class FormTicketsup
$langs->load("other");
$langs->load("mails");
$langs->load("ticketsup");
$langs->load("ticket");
$form = new Form($this->db);
$formcompany = new FormCompany($this->db);
$ticketstatic = new Ticketsup($this->db);
$ticketstatic = new Ticket($this->db);
$soc = new Societe($this->db);
if (!empty($this->withfromsocid) && $this->withfromsocid > 0) {
$soc->fetch($this->withfromsocid);
}
$ticketstat = new TicketSup($this->db);
$ticketstat = new Ticket($this->db);
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label($ticketstat->table_element);
@@ -142,7 +142,7 @@ class FormTicketsup
if ($withdolfichehead) dol_fiche_head(null, 'card', '', 0, '');
print '<form method="POST" '.($withdolfichehead?'':'style="margin-bottom: 30px;" ').'name="ticketsup" id="form_create_ticket" enctype="multipart/form-data" action="' . $this->param["returnurl"] . '">';
print '<form method="POST" '.($withdolfichehead?'':'style="margin-bottom: 30px;" ').'name="ticket" id="form_create_ticket" enctype="multipart/form-data" action="' . $this->param["returnurl"] . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="' . $this->action . '">';
foreach ($this->param as $key => $value) {
@@ -150,9 +150,7 @@ class FormTicketsup
}
print '<input type="hidden" name="fk_user_create" value="' . $this->fk_user_create . '">';
dol_fiche_head('');
print '<table class="tableticket centpercent">';
print '<table class="border">';
if ($this->withref) {
// Ref
@@ -397,7 +395,6 @@ class FormTicketsup
}
print '</table>';
print '</div>';
if ($withdolfichehead) dol_fiche_end();
@@ -419,7 +416,7 @@ class FormTicketsup
*
* @param string $selected Id du type pre-selectionne
* @param string $htmlname Nom de la zone select
* @param string $filtertype To filter on field type in llx_c_ticketsup_type (array('code'=>xx,'label'=>zz))
* @param string $filtertype To filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz))
* @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
* @param int $empty 1=peut etre vide, 0 sinon
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
@@ -431,7 +428,7 @@ class FormTicketsup
{
global $langs, $user;
$ticketstat = new Ticketsup($this->db);
$ticketstat = new Ticket($this->db);
dol_syslog(get_class($this) . "::select_types_tickets " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
@@ -519,7 +516,7 @@ class FormTicketsup
*
* @param string $selected Id categorie pre-selectionnée
* @param string $htmlname Nom de la zone select
* @param string $filtertype To filter on field type in llx_c_ticketsup_category (array('code'=>xx,'label'=>zz))
* @param string $filtertype To filter on field type in llx_c_ticket_category (array('code'=>xx,'label'=>zz))
* @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
* @param int $empty 1=peut etre vide, 0 sinon
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
@@ -531,7 +528,7 @@ class FormTicketsup
{
global $langs, $user;
$ticketstat = new Ticketsup($this->db);
$ticketstat = new Ticket($this->db);
dol_syslog(get_class($this) . "::selectCategoryTickets " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
@@ -620,7 +617,7 @@ class FormTicketsup
*
* @param string $selected Id severity pre-selectionnée
* @param string $htmlname Nom de la zone select
* @param string $filtertype To filter on field type in llx_c_ticketsup_severity (array('code'=>xx,'label'=>zz))
* @param string $filtertype To filter on field type in llx_c_ticket_severity (array('code'=>xx,'label'=>zz))
* @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
* @param int $empty 1=peut etre vide, 0 sinon
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
@@ -632,7 +629,7 @@ class FormTicketsup
{
global $langs, $user;
$ticketstat = new Ticketsup($this->db);
$ticketstat = new Ticket($this->db);
dol_syslog(get_class($this) . "::selectSeveritiesTickets " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
@@ -787,7 +784,7 @@ class FormTicketsup
print '});
</script>';
print '<form method="post" name="ticketsup" enctype="multipart/form-data" action="' . $this->param["returnurl"] . '">';
print '<form method="post" name="ticket" enctype="multipart/form-data" action="' . $this->param["returnurl"] . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="' . $this->action . '">';
foreach ($this->param as $key => $value) {
@@ -814,7 +811,7 @@ class FormTicketsup
// External users can't send message email
if ($user->rights->ticketsup->write && !$user->socid) {
if ($user->rights->ticket->write && !$user->socid) {
print '<tr><td width="30%"></td><td colspan="2">';
$checkbox_selected = ( GETPOST('send_email') == "1" ? ' checked' : '');
print '<input type="checkbox" name="send_email" value="1" id="send_msg_email" '.$checkbox_selected.'/> ';
@@ -863,7 +860,7 @@ class FormTicketsup
// Destinataires
print '<tr class="email_line"><td>' . $langs->trans('MailRecipients') . '</td><td colspan="2">';
$ticketstat = new Ticketsup($this->db);
$ticketstat = new Ticket($this->db);
$res = $ticketstat->fetch('', '', $this->track_id);
if ($res) {
// Retrieve email of all contacts (internal and external)
@@ -908,7 +905,7 @@ class FormTicketsup
// Intro
// External users can't send message email
if ($user->rights->ticketsup->write && !$user->socid) {
if ($user->rights->ticket->write && !$user->socid) {
$mail_intro = GETPOST('mail_intro') ? GETPOST('mail_intro') : $conf->global->TICKETS_MESSAGE_MAIL_INTRO;
print '<tr class="email_line"><td><label for="mail_intro">' . $langs->trans("TicketMessageMailIntro") . '</label>';
@@ -951,7 +948,7 @@ class FormTicketsup
$doleditor = new DolEditor('message', $defaultmessage, '100%', 350, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
$doleditor->Create();
print '</td><td align="center">';
if ($user->rights->ticketsup->write && !$user->socid) {
if ($user->rights->ticket->write && !$user->socid) {
print $form->textwithpicto('', $langs->trans("TicketMessageHelp"), 1, 'help');
}
@@ -959,7 +956,7 @@ class FormTicketsup
// Signature
// External users can't send message email
if ($user->rights->ticketsup->write && !$user->socid) {
if ($user->rights->ticket->write && !$user->socid) {
$mail_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : $conf->global->TICKETS_MESSAGE_MAIL_SIGNATURE;
print '<tr class="email_line"><td><label for="mail_intro">' . $langs->trans("TicketMessageMailSignature") . '</label>';

View File

@@ -1357,13 +1357,13 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
//}
}
}
elseif ($object->element == 'ticketsup')
elseif ($object->element == 'ticket')
{
$width=80; $cssclass='photoref';
$showimage=$object->is_photo_available($conf->ticketsup->multidir_output[$entity].'/'.$object->track_id);
$showimage=$object->is_photo_available($conf->ticket->multidir_output[$entity].'/'.$object->track_id);
$maxvisiblephotos=(isset($conf->global->TICKETSUP_MAX_VISIBLE_PHOTO)?$conf->global->TICKETSUP_MAX_VISIBLE_PHOTO:2);
if ($conf->browser->phone) $maxvisiblephotos=1;
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos('ticketsup', $conf->ticketsup->multidir_output[$entity],'small',$maxvisiblephotos,0,0,0,$width,0).'</div>';
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos('ticket', $conf->ticket->multidir_output[$entity],'small',$maxvisiblephotos,0,0,0,$width,0).'</div>';
else
{
if (!empty($conf->global->TICKETSUP_NODISPLAYIFNOPHOTO)) {

View File

@@ -2282,7 +2282,7 @@ function getModuleDirForApiClass($module)
$moduledirforclass = 'fichinter';
}
elseif ($module == 'tickets') {
$moduledirforclass = 'ticketsup';
$moduledirforclass = 'ticket';
}
return $moduledirforclass;

View File

@@ -17,9 +17,9 @@
*/
/**
* \file core/lib/ticketsup.lib.php
* \ingroup ticketsup
* \brief This file is a library for TicketSup module
* \file core/lib/ticket.lib.php
* \ingroup ticket
* \brief This file is a library for Ticket module
*/
/**
@@ -27,72 +27,72 @@
*
* @return array
*/
function ticketsupAdminPrepareHead()
function ticketAdminPrepareHead()
{
global $langs, $conf;
$langs->load("ticketsup");
$langs->load("ticket");
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/admin/ticketsup.php';
$head[$h][1] = $langs->trans("TicketSupSettings");
$head[$h][0] = DOL_URL_ROOT.'/admin/ticket.php';
$head[$h][1] = $langs->trans("TicketSettings");
$head[$h][2] = 'settings';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/admin/ticketsup_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsTicketSup");
$head[$h][0] = DOL_URL_ROOT.'/admin/ticket_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsTicket");
$head[$h][2] = 'attributes';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
//$this->tabs = array(
// 'entity:+tabname:Title:@ticketsup:/ticketsup/mypage.php?id=__ID__'
// 'entity:+tabname:Title:@ticket:/ticket/mypage.php?id=__ID__'
//); // to add new tab
//$this->tabs = array(
// 'entity:-tabname:Title:@ticketsup:/ticketsup/mypage.php?id=__ID__'
// 'entity:-tabname:Title:@ticket:/ticket/mypage.php?id=__ID__'
//); // to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticketsupadmin');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticketadmin');
return $head;
}
/**
* Build tabs for a Ticketsup object
* Build tabs for a Ticket object
*
* @param Ticketsup $object Object Ticket
* @param Ticket $object Object Ticket
* @return array Array of tabs
*/
function ticketsup_prepare_head($object)
function ticket_prepare_head($object)
{
global $db, $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/ticketsup/card.php?action=view&track_id=' . $object->track_id;
$head[$h][0] = DOL_URL_ROOT.'/ticket/card.php?action=view&track_id=' . $object->track_id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'tabTicketsup';
$head[$h][2] = 'tabTicket';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && empty($user->socid))
{
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$head[$h][0] = DOL_URL_ROOT.'/ticketsup/contact.php?track_id='.$object->track_id;
$head[$h][0] = DOL_URL_ROOT.'/ticket/contact.php?track_id='.$object->track_id;
$head[$h][1] = $langs->trans('ContactsAddresses');
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact';
$h++;
}
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticketsup');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket');
// Attached files
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$upload_dir = $conf->ticketsup->dir_output . "/" . $object->track_id;
$upload_dir = $conf->ticket->dir_output . "/" . $object->track_id;
$nbFiles = count(dol_dir_list($upload_dir, 'files'));
$head[$h][0] = dol_buildpath('/ticketsup/document.php', 1) . '?track_id=' . $object->track_id;
$head[$h][0] = dol_buildpath('/ticket/document.php', 1) . '?track_id=' . $object->track_id;
$head[$h][1] = $langs->trans("Documents");
if ($nbFiles > 0) {
$head[$h][1] .= ' <span class="badge">' . $nbFiles . '</span>';
@@ -103,13 +103,13 @@ function ticketsup_prepare_head($object)
// History
$head[$h][0] = DOL_URL_ROOT.'/ticketsup/history.php?track_id=' . $object->track_id;
$head[$h][0] = DOL_URL_ROOT.'/ticket/history.php?track_id=' . $object->track_id;
$head[$h][1] = $langs->trans('Events');
$head[$h][2] = 'tabTicketLogs';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticketsup','remove');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket','remove');
return $head;
@@ -195,7 +195,7 @@ function showlogo()
$urllogo = DOL_URL_ROOT . '/theme/dolibarr_logo.png';
}
print '<center>';
print '<a href="' . ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE : dol_buildpath('/public/ticketsup/index.php', 1)) . '"><img alt="Logo" id="logosubscribe" title="" src="' . $urllogo . '" style="max-width: 440px" /></a><br>';
print '<a href="' . ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE : dol_buildpath('/public/ticket/index.php', 1)) . '"><img alt="Logo" id="logosubscribe" title="" src="' . $urllogo . '" style="max-width: 440px" /></a><br>';
print '<strong>' . ($conf->global->TICKETS_PUBLIC_INTERFACE_TOPIC ? $conf->global->TICKETS_PUBLIC_INTERFACE_TOPIC : $langs->trans("TicketSystem")) . '</strong>';
print '</center><br>';
}

View File

@@ -18,19 +18,19 @@
*/
/**
* \defgroup ticketsup Ticketsup module
* \brief Ticketsup module descriptor.
* \file core/modules/modTicketsup.class.php
* \ingroup ticketsup
* \brief Description and activation file for module Ticketsup
* \defgroup ticket Ticket module
* \brief Ticket module descriptor.
* \file core/modules/modTicket.class.php
* \ingroup ticket
* \brief Description and activation file for module Ticket
*/
require_once DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php";
/**
* Description and activation class for module Ticketsup
* Description and activation class for module Ticket
*/
class modTicketsup extends DolibarrModules
class modTicket extends DolibarrModules
{
/**
@@ -49,7 +49,7 @@ class modTicketsup extends DolibarrModules
// (See in Home -> System information -> Dolibarr for list of used modules id).
$this->numero = 56000;
// Key text used to identify module (for permissions, menus, etc...)
$this->rights_class = 'ticketsup';
$this->rights_class = 'ticket';
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
@@ -74,11 +74,11 @@ class modTicketsup extends DolibarrModules
// use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png
// use this->picto='pictovalue@module'
$this->picto = 'ticketsup'; // mypicto@ticketsup
$this->picto = 'ticket'; // mypicto@ticket
// 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)
// for specific css file (eg: /ticketsup/css/ticketsup.css.php)
// for default path (eg: /ticket/core/xxxxx) (0=disable, 1=enable)
// for specific path of parts (eg: /ticket/core/modules/barcode)
// for specific css file (eg: /ticket/css/ticket.css.php)
$this->module_parts = array(
// Set this to 1 if module has its own trigger directory
'triggers' => 1,
@@ -87,12 +87,12 @@ class modTicketsup extends DolibarrModules
);
// Data directories to create when module is enabled.
// Example: this->dirs = array("/ticketsup/temp");
// Example: this->dirs = array("/ticket/temp");
$this->dirs = array();
// Config pages. Put here list of php pages
// stored into ticketsup/admin directory, used to setup module.
$this->config_page_url = array("ticketsup.php");
// stored into ticket/admin directory, used to setup module.
$this->config_page_url = array("ticket.php");
// Dependencies
// List of modules id that must be enabled if this module is enabled
@@ -101,36 +101,36 @@ class modTicketsup extends DolibarrModules
$this->requiredby = array();
// Minimum version of PHP required by module
$this->phpmin = array(5, 3);
$this->langfiles = array("ticketsup");
$this->langfiles = array("ticket");
// Constants
// List of particular constants to add when module is enabled
// (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
// Example:
$this->const = array();
$this->const[1] = array('TICKETS_ENABLE_PUBLIC_INTERFACE', 'chaine', '1', 'Enable ticket public interface');
$this->const[2] = array('TICKETSUP_ADDON', 'chaine', 'mod_ticketsup_simple', 'Ticketsup ref module');
$this->const[2] = array('TICKETSUP_ADDON', 'chaine', 'mod_ticket_simple', 'Ticket ref module');
$this->tabs = array(
'thirdparty:+ticketsup:Tickets:@ticketsup:$user->rights->ticketsup->read:/ticketsup/list.php?socid=__ID__',
'project:+ticketsup:Tickets:@ticketsup:$user->rights->ticketsup->read:/ticketsup/list.php?projectid=__ID__',
'thirdparty:+ticket:Tickets:@ticket:$user->rights->ticket->read:/ticket/list.php?socid=__ID__',
'project:+ticket:Tickets:@ticket:$user->rights->ticket->read:/ticket/list.php?projectid=__ID__',
);
// Dictionnaries
if (! isset($conf->ticketsup->enabled)) {
$conf->ticketsup=new stdClass();
$conf->ticketsup->enabled=0;
if (! isset($conf->ticket->enabled)) {
$conf->ticket=new stdClass();
$conf->ticket->enabled=0;
}
$this->dictionaries = array(
'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'),
'langs' => 'ticket',
'tabname' => array(MAIN_DB_PREFIX . "c_ticket_type", MAIN_DB_PREFIX . "c_ticket_category", MAIN_DB_PREFIX . "c_ticket_severity"),
'tablib' => array("TicketDictType", "TicketDictCategory", "TicketDictSeverity"),
'tabsql' => array('SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_type as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_category as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_severity as f'),
'tabsqlsort' => array("pos ASC", "pos ASC", "pos ASC"),
'tabfield' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"),
'tabfieldvalue' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"),
'tabfieldinsert' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"),
'tabrowid' => array("rowid", "rowid", "rowid"),
'tabcond' => array($conf->ticketsup->enabled, $conf->ticketsup->enabled, $conf->ticketsup->enabled),
'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled),
);
// Boxes
@@ -139,10 +139,10 @@ class modTicketsup extends DolibarrModules
$r = 0;
// Example:
$this->boxes[$r][1] = "box_last_ticketsup";
$this->boxes[$r][1] = "box_last_ticket";
$r++;
$this->boxes[$r][1] = "box_last_modified_ticketsup";
$this->boxes[$r][1] = "box_last_modified_ticket";
$r++;
// Permissions
@@ -191,95 +191,95 @@ class modTicketsup extends DolibarrModules
$this->menu[$r] = array('fk_menu' => 0, // Put 0 if this is a top menu
'type' => 'top', // This is a Top menu entry
'titre' => 'Ticket',
'mainmenu' => 'ticketsup',
'mainmenu' => 'ticket',
'leftmenu' => '1', // Use 1 if you also want to add left menu entries using this descriptor.
'url' => '/ticketsup/index.php',
'langs' => 'ticketsup', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'url' => '/ticket/index.php',
'langs' => 'ticket', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position' => 100,
'enabled' => '$conf->ticketsup->enabled', // 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
'enabled' => '$conf->ticket->enabled', // Define condition to show or hide menu entry. Use '$conf->ticket->enabled' if entry must be visible if module is enabled.
'perms' => '$user->rights->ticket->read', // Use 'perms'=>'$user->rights->ticket->level1->level2' if you want your menu with a permission rules
'target' => '',
'user' => 2); // 0=Menu for internal users, 1=external users, 2=both
$r++;
$this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticketsup',
$this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticket',
'type' => 'left',
'titre' => 'Ticket',
'mainmenu' => 'ticketsup',
'leftmenu' => 'ticketsup',
'url' => '/ticketsup/index.php',
'langs' => 'ticketsup',
'mainmenu' => 'ticket',
'leftmenu' => 'ticket',
'url' => '/ticket/index.php',
'langs' => 'ticket',
'position' => 101,
'enabled' => '$conf->ticketsup->enabled',
'perms' => '$user->rights->ticketsup->read',
'enabled' => '$conf->ticket->enabled',
'perms' => '$user->rights->ticket->read',
'target' => '',
'user' => 2);
$r++;
$this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticketsup,fk_leftmenu=ticketsup',
$this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket',
'type' => 'left',
'titre' => 'NewTicket',
'mainmenu' => 'ticketsup',
'url' => '/ticketsup/new.php?action=create_ticket',
'langs' => 'ticketsup',
'mainmenu' => 'ticket',
'url' => '/ticket/new.php?action=create_ticket',
'langs' => 'ticket',
'position' => 102,
'enabled' => '$conf->ticketsup->enabled',
'perms' => '$user->rights->ticketsup->write',
'enabled' => '$conf->ticket->enabled',
'perms' => '$user->rights->ticket->write',
'target' => '',
'user' => 2);
$r++;
$this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticketsup,fk_leftmenu=ticketsup',
$this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket',
'type' => 'left',
'titre' => 'List',
'mainmenu' => 'ticketsup',
'leftmenu' => 'ticketsuplist',
'url' => '/ticketsup/list.php',
'langs' => 'ticketsup',
'mainmenu' => 'ticket',
'leftmenu' => 'ticketlist',
'url' => '/ticket/list.php',
'langs' => 'ticket',
'position' => 103,
'enabled' => '$conf->ticketsup->enabled',
'perms' => '$user->rights->ticketsup->read',
'enabled' => '$conf->ticket->enabled',
'perms' => '$user->rights->ticket->read',
'target' => '',
'user' => 2);
$r++;
$this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticketsup,fk_leftmenu=ticketsuplist',
$this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticketlist',
'type' => 'left',
'titre' => 'MenuListNonClosed',
'mainmenu' => 'ticketsup',
'leftmenu' => 'ticketsuplist',
'url' => '/ticketsup/list.php?search_fk_status=non_closed',
'langs' => 'ticketsup',
'mainmenu' => 'ticket',
'leftmenu' => 'ticketlist',
'url' => '/ticket/list.php?search_fk_status=non_closed',
'langs' => 'ticket',
'position' => 104,
'enabled' => '$conf->ticketsup->enabled',
'perms' => '$user->rights->ticketsup->read',
'enabled' => '$conf->ticket->enabled',
'perms' => '$user->rights->ticket->read',
'target' => '',
'user' => 2);
$r++;
$this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticketsup,fk_leftmenu=ticketsup',
$this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket',
'type' => 'left',
'titre' => 'MenuTicketsupMyAssign',
'mainmenu' => 'ticketsup',
'leftmenu' => 'ticketsupmy',
'url' => '/ticketsup/list.php?mode=my_assign',
'langs' => 'ticketsup',
'titre' => 'MenuTicketMyAssign',
'mainmenu' => 'ticket',
'leftmenu' => 'ticketmy',
'url' => '/ticket/list.php?mode=my_assign',
'langs' => 'ticket',
'position' => 105,
'enabled' => '$conf->ticketsup->enabled',
'perms' => '$user->rights->ticketsup->read',
'enabled' => '$conf->ticket->enabled',
'perms' => '$user->rights->ticket->read',
'target' => '',
'user' => 0);
$r++;
$this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticketsup,fk_leftmenu=ticketsupmy',
$this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticketmy',
'type' => 'left',
'titre' => 'MenuTicketsupMyAssignNonClosed',
'mainmenu' => 'ticketsup',
'url' => '/ticketsup/list.php?mode=my_assign&search_fk_status=non_closed',
'langs' => 'ticketsup',
'titre' => 'MenuTicketMyAssignNonClosed',
'mainmenu' => 'ticket',
'url' => '/ticket/list.php?mode=my_assign&search_fk_status=non_closed',
'langs' => 'ticket',
'position' => 106,
'enabled' => '$conf->ticketsup->enabled',
'perms' => '$user->rights->ticketsup->read',
'enabled' => '$conf->ticket->enabled',
'perms' => '$user->rights->ticket->read',
'target' => '',
'user' => 0);
$r++;
@@ -297,11 +297,11 @@ class modTicketsup extends DolibarrModules
{
$sql = array(
array("sql" => "insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110120, 'ticketsup', 'internal', 'SUPPORTTEC', 'Utilisateur assigné au ticket', 1);", "ignoreerror" => 1),
array("sql" => "insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110121, 'ticketsup', 'internal', 'CONTRIBUTOR', 'Intervenant', 1);", "ignoreerror" => 1),
array("sql" => "insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110122, 'ticketsup', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1);", "ignoreerror" => 1),
array("sql" => "insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110123, 'ticketsup', 'external', 'CONTRIBUTOR', 'Intervenant', 1);", "ignoreerror" => 1),
array("sql" => "insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values ('','TICKETMESSAGE_SENTBYMAIL','Send email for ticket','Executed when a response is made on a ticket','ticketsup','');", "ignoreerror" => 1),
array("sql" => "insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110120, 'ticket', 'internal', 'SUPPORTTEC', 'Utilisateur assigné au ticket', 1);", "ignoreerror" => 1),
array("sql" => "insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110121, 'ticket', 'internal', 'CONTRIBUTOR', 'Intervenant', 1);", "ignoreerror" => 1),
array("sql" => "insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110122, 'ticket', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1);", "ignoreerror" => 1),
array("sql" => "insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110123, 'ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1);", "ignoreerror" => 1),
array("sql" => "insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values ('','TICKETMESSAGE_SENTBYMAIL','Send email for ticket','Executed when a response is made on a ticket','ticket','');", "ignoreerror" => 1),
);
return $this->_init($sql, $options);

View File

@@ -27,7 +27,7 @@
/**
* Classe mere des modeles de numerotation des references de projets
*/
abstract class ModeleNumRefTicketsup
abstract class ModeleNumRefTicket
{
public $error = '';
@@ -49,7 +49,7 @@ abstract class ModeleNumRefTicketsup
public function info()
{
global $langs;
$langs->load("ticketsup");
$langs->load("ticket");
return $langs->trans("NoDescription");
}
@@ -61,7 +61,7 @@ abstract class ModeleNumRefTicketsup
public function getExample()
{
global $langs;
$langs->load("ticketsup");
$langs->load("ticket");
return $langs->trans("NoExample");
}

View File

@@ -18,17 +18,17 @@
*/
/**
* \file htdocs/core/modules/ticketsup/mod_ticketsup_simple.php
* \ingroup ticketsup
* \brief File with class to manage the numbering module Simple for ticketsup references
* \file htdocs/core/modules/ticket/mod_ticket_simple.php
* \ingroup ticket
* \brief File with class to manage the numbering module Simple for ticket references
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/modules_ticketsup.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/modules_ticket.php';
/**
* Class to manage the numbering module Simple for ticketsup references
* Class to manage the numbering module Simple for ticket references
*/
class mod_ticketsup_simple extends ModeleNumRefTicketsup
class mod_ticket_simple extends ModeleNumRefTicket
{
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
public $prefix = 'TS';
@@ -72,7 +72,7 @@ class mod_ticketsup_simple extends ModeleNumRefTicketsup
$posindice = 8;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM " . $posindice . ") AS SIGNED)) as max";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticketsup";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket";
$search = $this->prefix . "____-%";
$sql .= " WHERE ref LIKE '" . $search ."'";
$sql .= " AND entity = " . $conf->entity;
@@ -97,17 +97,17 @@ class mod_ticketsup_simple extends ModeleNumRefTicketsup
* Return next value
*
* @param Societe $objsoc Object third party
* @param Project $ticketsup Object ticketsup
* @param Project $ticket Object ticket
* @return string Value if OK, 0 if KO
*/
public function getNextValue($objsoc, $ticketsup)
public function getNextValue($objsoc, $ticket)
{
global $db, $conf;
// D'abord on recupere la valeur max
$posindice = 8;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM " . $posindice . ") AS SIGNED)) as max";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticketsup";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket";
$search = $this->prefix . "____-%";
$sql .= " WHERE ref LIKE '" . $search ."'";
$sql .= " AND entity = " . $conf->entity;
@@ -121,11 +121,11 @@ class mod_ticketsup_simple extends ModeleNumRefTicketsup
$max = 0;
}
} else {
dol_syslog("mod_ticketsup_simple::getNextValue", LOG_DEBUG);
dol_syslog("mod_ticket_simple::getNextValue", LOG_DEBUG);
return -1;
}
$date = empty($ticketsup->datec) ? dol_now() : $ticketsup->datec;
$date = empty($ticket->datec) ? dol_now() : $ticket->datec;
//$yymm = strftime("%y%m",time());
$yymm = strftime("%y%m", $date);
@@ -137,7 +137,7 @@ class mod_ticketsup_simple extends ModeleNumRefTicketsup
$num = sprintf("%04s", $max + 1);
}
dol_syslog("mod_ticketsup_simple::getNextValue return " . $this->prefix . $yymm . "-" . $num);
dol_syslog("mod_ticket_simple::getNextValue return " . $this->prefix . $yymm . "-" . $num);
return $this->prefix . $yymm . "-" . $num;
}

View File

@@ -17,17 +17,17 @@
*/
/**
* \file ticketsup/core/modules/ticketsup/mod_ticketsup_universal.php
* \ingroup ticketsup
* \file ticket/core/modules/ticket/mod_ticket_universal.php
* \ingroup ticket
* \brief Fichier contenant la classe du modele de numerotation de reference de projet Universal
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/modules_ticketsup.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/modules_ticket.php';
/**
* Classe du modele de numerotation de reference de projet Universal
*/
class mod_ticketsup_universal extends ModeleNumRefTicketsup
class mod_ticket_universal extends ModeleNumRefTicket
{
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
public $error = '';
@@ -43,7 +43,7 @@ class mod_ticketsup_universal extends ModeleNumRefTicketsup
{
global $conf, $langs;
$langs->load("ticketsup");
$langs->load("ticket");
$langs->load("admin");
$form = new Form($this->db);
@@ -52,18 +52,18 @@ class mod_ticketsup_universal extends ModeleNumRefTicketsup
$texte .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
$texte .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
$texte .= '<input type="hidden" name="action" value="updateMask">';
$texte .= '<input type="hidden" name="maskconstticketsup" value="TICKETSUP_UNIVERSAL_MASK">';
$texte .= '<input type="hidden" name="maskconstticket" value="TICKETSUP_UNIVERSAL_MASK">';
$texte .= '<table class="nobordernopadding" width="100%">';
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Ticketsup"), $langs->transnoentities("Ticketsup"));
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Ticket"), $langs->transnoentities("Ticket"));
$tooltip .= $langs->trans("GenericMaskCodes2");
$tooltip .= $langs->trans("GenericMaskCodes3");
$tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("Ticketsup"), $langs->transnoentities("Ticketsup"));
$tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("Ticket"), $langs->transnoentities("Ticket"));
$tooltip .= $langs->trans("GenericMaskCodes5");
// Parametrage du prefix
$texte .= '<tr><td>' . $langs->trans("Mask") . ':</td>';
$texte .= '<td align="right">' . $form->textwithpicto('<input type="text" class="flat" size="24" name="maskticketsup" value="' . $conf->global->TICKETSUP_UNIVERSAL_MASK . '">', $tooltip, 1, 1) . '</td>';
$texte .= '<td align="right">' . $form->textwithpicto('<input type="text" class="flat" size="24" name="maskticket" value="' . $conf->global->TICKETSUP_UNIVERSAL_MASK . '">', $tooltip, 1, 1) . '</td>';
$texte .= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button" value="' . $langs->trans("Modify") . '" name="Button"></td>';
@@ -99,10 +99,10 @@ class mod_ticketsup_universal extends ModeleNumRefTicketsup
* Return next value
*
* @param Societe $objsoc Object third party
* @param Project $ticketsup Object ticketsup
* @param Project $ticket Object ticket
* @return string Value if OK, 0 if KO
*/
public function getNextValue($objsoc, $ticketsup)
public function getNextValue($objsoc, $ticket)
{
global $db, $conf;
@@ -116,8 +116,8 @@ class mod_ticketsup_universal extends ModeleNumRefTicketsup
return 0;
}
$date = empty($ticketsup->date_c) ? dol_now() : $ticketsup->datec;
$numFinal = get_next_value($db, $mask, 'ticketsup', 'ref', '', $objsoc->code_client, $date);
$date = empty($ticket->date_c) ? dol_now() : $ticket->datec;
$numFinal = get_next_value($db, $mask, 'ticket', 'ref', '', $objsoc->code_client, $date);
return $numFinal;
}

View File

@@ -83,10 +83,10 @@ elseif ($modulepart == 'societe')
if (! $user->rights->societe->lire) accessforbidden();
$accessallowed=1;
}
elseif ($modulepart == 'ticketsup')
elseif ($modulepart == 'ticket')
{
$result=restrictedArea($user,'ticketsup',$id,'ticketsup');
if (! $user->rights->ticketsup->read) accessforbidden();
$result=restrictedArea($user,'ticket',$id,'ticket');
if (! $user->rights->ticket->read) accessforbidden();
$accessallowed=1;
}
@@ -177,15 +177,15 @@ elseif ($modulepart == 'expensereport')
$dir=$conf->expensereport->dir_output; // By default
}
}
elseif ($modulepart == 'ticketsup')
elseif ($modulepart == 'ticket')
{
require_once DOL_DOCUMENT_ROOT.'/ticketsup/class/ticketsup.class.php';
$object = new Ticketsup($db);
require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
$object = new Ticket($db);
if ($id > 0)
{
$result = $object->fetch($id);
if ($result <= 0) dol_print_error($db,'Failed to load object');
$dir=$conf->ticketsup->dir_output; // By default
$dir=$conf->ticket->dir_output; // By default
}
}
else {
@@ -200,7 +200,7 @@ if (empty($backtourl))
else if (in_array($modulepart, array('member'))) $backtourl=DOL_URL_ROOT."/adherents/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
else if (in_array($modulepart, array('project'))) $backtourl=DOL_URL_ROOT."/projet/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
else if (in_array($modulepart, array('societe'))) $backtourl=DOL_URL_ROOT."/societe/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
else if (in_array($modulepart, array('ticketsup'))) $backtourl=DOL_URL_ROOT."/ticketsup/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
else if (in_array($modulepart, array('ticket'))) $backtourl=DOL_URL_ROOT."/ticket/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
else if (in_array($modulepart, array('user'))) $backtourl=DOL_URL_ROOT."/user/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
}

View File

@@ -41,7 +41,7 @@ if (empty($permtoedit)) $permtoedit=-1;
// If you enable the move up/down of files here, check that page that include template set its sortorder on 'position_name' instead of 'name'
// Also the object->fk_element must be defined.
$disablemove=1;
if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticketsup', 'holiday', 'expensereport'))) $disablemove=0;
if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket', 'holiday', 'expensereport'))) $disablemove=0;

View File

@@ -18,7 +18,7 @@
*/
/**
* \file htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php
* \file htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php
* \ingroup core
* \brief File of trigger for ticket module
*/
@@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
/**
* Class of triggers for ticketsup module
* Class of triggers for ticket module
*/
class InterfaceTicketEmail extends DolibarrTriggers
{
@@ -42,10 +42,10 @@ class InterfaceTicketEmail extends DolibarrTriggers
$this->db = $db;
$this->name = preg_replace('/^Interface/i', '', get_class($this));
$this->family = "ticketsup";
$this->description = "Triggers of the module ticketsup";
$this->family = "ticket";
$this->description = "Triggers of the module ticket";
$this->version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' or version
$this->picto = 'ticketsup';
$this->picto = 'ticket';
}
/**
@@ -139,7 +139,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
$message .= '</ul>';
$message .= '<p>' . $langs->trans('Message') . ' : <br>' . $object->message . '</p>';
$message .= '<p><a href="' . dol_buildpath('/ticketsup/card.php', 2) . '?track_id=' . $object->track_id . '">' . $langs->trans('SeeThisTicketIntomanagementInterface') . '</a></p>';
$message .= '<p><a href="' . dol_buildpath('/ticket/card.php', 2) . '?track_id=' . $object->track_id . '">' . $langs->trans('SeeThisTicketIntomanagementInterface') . '</a></p>';
$sendto = $userstat->email;
$from = dolGetFirstLastname($user->firstname, $user->lastname) . '<' . $user->email . '>';
@@ -175,14 +175,14 @@ class InterfaceTicketEmail extends DolibarrTriggers
case 'TICKET_CREATE':
dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id);
$langs->load('ticketsup');
$langs->load('ticket');
$object->fetch('', $object->track_id); // Should be useless
// Send email to notification email
if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && empty($object->context['disableticketsupemail']))
if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && empty($object->context['disableticketemail']))
{
$sendto = $conf->global->TICKETS_NOTIFICATION_EMAIL_TO;
@@ -215,7 +215,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
}
$message_admin.='<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
$message_admin.='<p><a href="'.dol_buildpath('/ticketsup/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
$message_admin.='<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKETS_NOTIFICATION_EMAIL_FROM.'>';
$replyto = $from;
@@ -241,7 +241,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
// Send email to customer
if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && empty($object->context['disableticketsupemail']) && $object->notify_tiers_at_create)
if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && empty($object->context['disableticketemail']) && $object->notify_tiers_at_create)
{
$sendto = '';
if (empty($user->socid) && empty($user->email)) {
@@ -287,7 +287,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
$message_customer.='</ul>';
$message_customer.='<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE?$conf->global->TICKETS_URL_PUBLIC_INTERFACE.'/':dol_buildpath('/public/ticketsup/view.php', 2)).'?track_id='.$object->track_id;
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE?$conf->global->TICKETS_URL_PUBLIC_INTERFACE.'/':dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id;
$message_customer.='<p>' . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : <a href="'.$url_public_ticket.'">'.$url_public_ticket.'</a></p>';
$message_customer.='<p>'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'</p>';

View File

@@ -14,7 +14,7 @@
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
--
-- Contenu de la table llx_c_ticketsup_category
-- Contenu de la table llx_c_ticket_category
--
INSERT INTO llx_c_ticketsup_category (code, pos, label, active, use_default, description) VALUES('OTHER', '10', 'Other', 1, 1, NULL);
INSERT INTO llx_c_ticket_category (code, pos, label, active, use_default, description) VALUES('OTHER', '10', 'Other', 1, 1, NULL);

View File

@@ -14,10 +14,10 @@
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
--
-- Contenu de la table llx_c_ticketsup_severity
-- Contenu de la table llx_c_ticket_severity
--
INSERT INTO llx_c_ticketsup_severity (code, pos, label, color, active, use_default, description) VALUES('LOW', '10', 'Low', '', 1, 0, NULL);
INSERT INTO llx_c_ticketsup_severity (code, pos, label, color, active, use_default, description) VALUES('NORMAL', '20', 'Normal', '', 1, 1, NULL);
INSERT INTO llx_c_ticketsup_severity (code, pos, label, color, active, use_default, description) VALUES('HIGH', '30', 'High', '', 1, 0, NULL);
INSERT INTO llx_c_ticketsup_severity (code, pos, label, color, active, use_default, description) VALUES('BLOCKING', '40', 'Critical / blocking', '', 1, 0, NULL);
INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description) VALUES('LOW', '10', 'Low', '', 1, 0, NULL);
INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description) VALUES('NORMAL', '20', 'Normal', '', 1, 1, NULL);
INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description) VALUES('HIGH', '30', 'High', '', 1, 0, NULL);
INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description) VALUES('BLOCKING', '40', 'Critical / blocking', '', 1, 0, NULL);

View File

@@ -0,0 +1,24 @@
-- Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- 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
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
--
-- Contenu de la table llx_c_ticket_type
--
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('COM', '10', 'Commercial question', 1, 1, NULL);
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('ISSUE', '20', 'Issue or problem' , 1, 0, NULL);
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('REQUEST', '25', 'Change or enhancement request', 1, 0, NULL);
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('PROJECT', '30', 'Project', 0, 0, NULL);
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('OTHER', '40', 'Other', 1, 0, NULL);

View File

@@ -1,24 +0,0 @@
-- Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- 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
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
--
-- Contenu de la table llx_c_ticketsup_type
--
INSERT INTO llx_c_ticketsup_type (code, pos, label, active, use_default, description) VALUES('COM', '10', 'Commercial question', 1, 1, NULL);
INSERT INTO llx_c_ticketsup_type (code, pos, label, active, use_default, description) VALUES('ISSUE', '20', 'Issue or problem' , 1, 0, NULL);
INSERT INTO llx_c_ticketsup_type (code, pos, label, active, use_default, description) VALUES('REQUEST', '25', 'Change or enhancement request', 1, 0, NULL);
INSERT INTO llx_c_ticketsup_type (code, pos, label, active, use_default, description) VALUES('PROJECT', '30', 'Project', 0, 0, NULL);
INSERT INTO llx_c_ticketsup_type (code, pos, label, active, use_default, description) VALUES('OTHER', '40', 'Other', 1, 0, NULL);

View File

@@ -85,3 +85,10 @@ insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) v
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (181, 'project_task', 'internal', 'TASKCONTRIBUTOR', 'Intervenant', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (190, 'project_task', 'external', 'TASKEXECUTIVE', 'Responsable', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (191, 'project_task', 'external', 'TASKCONTRIBUTOR', 'Intervenant', 1);
-- Tickets
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(155, 'ticket', 'internal', 'SUPPORTTEC', 'Utilisateur contact support', 1, NULL);
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(156, 'ticket', 'internal', 'CONTRIBUTOR', 'Intervenant', 1, NULL);
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(157, 'ticket', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1, NULL);
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(158, 'ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1, NULL);

View File

@@ -1,5 +0,0 @@
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(110120, 'ticketsup', 'internal', 'SUPPORTTEC', 'Utilisateur contact support', 1, NULL);
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(110121, 'ticketsup', 'internal', 'CONTRIBUTOR', 'Intervenant', 1, NULL);
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(110122, 'ticketsup', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1, NULL);
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(110123, 'ticketsup', 'external', 'CONTRIBUTOR', 'Intervenant', 1, NULL);

View File

@@ -195,7 +195,9 @@ UPDATE llx_societe_rib set type = 'ban' where type = '' OR type IS NULL;
-- VMYSQL4.3 ALTER TABLE llx_societe_rib MODIFY COLUMN type varchar(32) NOT NULL;
-- VPGSQL8.2 ALTER TABLE llx_societe_rib ALTER COLUMN type SET NOT NULL;
CREATE TABLE llx_ticketsup
-- Module ticket
CREATE TABLE llx_ticket
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,
@@ -222,11 +224,11 @@ CREATE TABLE llx_ticketsup
tms timestamp
)ENGINE=innodb;
ALTER TABLE llx_ticketsup ADD COLUMN notify_tiers_at_create integer;
ALTER TABLE llx_ticketsup DROP INDEX uk_ticketsup_rowid_track_id;
ALTER TABLE llx_ticketsup ADD UNIQUE uk_ticketsup_track_id (track_id);
ALTER TABLE llx_ticket ADD COLUMN notify_tiers_at_create integer;
ALTER TABLE llx_ticket DROP INDEX uk_ticket_rowid_track_id;
ALTER TABLE llx_ticket ADD UNIQUE uk_ticket_track_id (track_id);
CREATE TABLE llx_ticketsup_msg
CREATE TABLE llx_ticket_msg
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,
@@ -238,9 +240,9 @@ CREATE TABLE llx_ticketsup_msg
)ENGINE=innodb;
ALTER TABLE llx_ticketsup_msg ADD CONSTRAINT fk_ticketsup_msg_fk_track_id FOREIGN KEY (fk_track_id) REFERENCES llx_ticketsup (track_id);
ALTER TABLE llx_ticket_msg ADD CONSTRAINT fk_ticket_msg_fk_track_id FOREIGN KEY (fk_track_id) REFERENCES llx_ticket (track_id);
CREATE TABLE llx_ticketsup_logs
CREATE TABLE llx_ticket_logs
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,
@@ -250,9 +252,9 @@ CREATE TABLE llx_ticketsup_logs
message text
)ENGINE=innodb;
ALTER TABLE llx_ticketsup_logs ADD CONSTRAINT fk_ticketsup_logs_fk_track_id FOREIGN KEY (fk_track_id) REFERENCES llx_ticketsup (track_id);
ALTER TABLE llx_ticket_logs ADD CONSTRAINT fk_ticket_logs_fk_track_id FOREIGN KEY (fk_track_id) REFERENCES llx_ticket (track_id);
CREATE TABLE llx_ticketsup_extrafields
CREATE TABLE llx_ticket_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
@@ -263,7 +265,7 @@ CREATE TABLE llx_ticketsup_extrafields
-- Create dictionaries tables for ticket
create table llx_c_ticketsup_severity
create table llx_c_ticket_severity
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,
@@ -276,7 +278,7 @@ create table llx_c_ticketsup_severity
description varchar(255)
)ENGINE=innodb;
create table llx_c_ticketsup_type
create table llx_c_ticket_type
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,
@@ -288,7 +290,7 @@ create table llx_c_ticketsup_type
description varchar(255)
)ENGINE=innodb;
create table llx_c_ticketsup_category
create table llx_c_ticket_category
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,
@@ -300,27 +302,30 @@ create table llx_c_ticketsup_category
description varchar(255)
)ENGINE=innodb;
ALTER TABLE llx_c_ticketsup_category ADD UNIQUE INDEX uk_code (code, entity);
ALTER TABLE llx_c_ticketsup_severity ADD UNIQUE INDEX uk_code (code, entity);
ALTER TABLE llx_c_ticketsup_type ADD UNIQUE INDEX uk_code (code, entity);
ALTER TABLE llx_c_ticket_category ADD UNIQUE INDEX uk_code (code, entity);
ALTER TABLE llx_c_ticket_severity ADD UNIQUE INDEX uk_code (code, entity);
ALTER TABLE llx_c_ticket_type ADD UNIQUE INDEX uk_code (code, entity);
-- Load data
INSERT INTO llx_c_ticketsup_severity (code, pos, label, color, active, use_default, description) VALUES('LOW', '10', 'Low', '', 1, 0, NULL);
INSERT INTO llx_c_ticketsup_severity (code, pos, label, color, active, use_default, description) VALUES('NORMAL', '20', 'Normal', '', 1, 1, NULL);
INSERT INTO llx_c_ticketsup_severity (code, pos, label, color, active, use_default, description) VALUES('HIGH', '30', 'High', '', 1, 0, NULL);
INSERT INTO llx_c_ticketsup_severity (code, pos, label, color, active, use_default, description) VALUES('BLOCKING', '40', 'Critical / blocking', '', 1, 0, NULL);
INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description) VALUES('LOW', '10', 'Low', '', 1, 0, NULL);
INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description) VALUES('NORMAL', '20', 'Normal', '', 1, 1, NULL);
INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description) VALUES('HIGH', '30', 'High', '', 1, 0, NULL);
INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description) VALUES('BLOCKING', '40', 'Critical / blocking', '', 1, 0, NULL);
INSERT INTO llx_c_ticketsup_type (code, pos, label, active, use_default, description) VALUES('COM', '10', 'Commercial question', 1, 1, NULL);
INSERT INTO llx_c_ticketsup_type (code, pos, label, active, use_default, description) VALUES('ISSUE', '20', 'Issue or problem' , 1, 0, NULL);
INSERT INTO llx_c_ticketsup_type (code, pos, label, active, use_default, description) VALUES('REQUEST', '25', 'Change or enhancement request', 1, 0, NULL);
INSERT INTO llx_c_ticketsup_type (code, pos, label, active, use_default, description) VALUES('PROJECT', '30', 'Project', 0, 0, NULL);
INSERT INTO llx_c_ticketsup_type (code, pos, label, active, use_default, description) VALUES('OTHER', '40', 'Other', 1, 0, NULL);
INSERT INTO llx_c_ticketsup_category (code, pos, label, active, use_default, description) VALUES('OTHER', '10', 'Other', 1, 1, NULL);
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('COM', '10', 'Commercial question', 1, 1, NULL);
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('ISSUE', '20', 'Issue or problem' , 1, 0, NULL);
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('REQUEST', '25', 'Change or enhancement request', 1, 0, NULL);
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('PROJECT', '30', 'Project', 0, 0, NULL);
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('OTHER', '40', 'Other', 1, 0, NULL);
INSERT INTO llx_c_ticket_category (code, pos, label, active, use_default, description) VALUES('OTHER', '10', 'Other', 1, 1, NULL);
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(155, 'ticket', 'internal', 'SUPPORTTEC', 'Utilisateur contact support', 1, NULL);
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(156, 'ticket', 'internal', 'CONTRIBUTOR', 'Intervenant', 1, NULL);
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(157, 'ticket', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1, NULL);
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(158, 'ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1, NULL);

View File

@@ -15,4 +15,4 @@
--
--
ALTER TABLE llx_c_ticketsup_category ADD UNIQUE INDEX uk_code (code, entity);
ALTER TABLE llx_c_ticket_category ADD UNIQUE INDEX uk_code (code, entity);

View File

@@ -15,7 +15,7 @@
--
--
create table llx_c_ticketsup_category
create table llx_c_ticket_category
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,

View File

@@ -15,4 +15,4 @@
--
--
ALTER TABLE llx_c_ticketsup_severity ADD UNIQUE INDEX uk_code (code, entity);
ALTER TABLE llx_c_ticket_severity ADD UNIQUE INDEX uk_code (code, entity);

View File

@@ -15,7 +15,7 @@
--
--
create table llx_c_ticketsup_severity
create table llx_c_ticket_severity
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,

View File

@@ -15,4 +15,4 @@
--
--
ALTER TABLE llx_c_ticketsup_type ADD UNIQUE INDEX uk_code (code, entity);
ALTER TABLE llx_c_ticket_type ADD UNIQUE INDEX uk_code (code, entity);

View File

@@ -15,7 +15,7 @@
--
--
create table llx_c_ticketsup_type
create table llx_c_ticket_type
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,

View File

@@ -1,4 +1,4 @@
-- SQL definition for module ticketsup
-- SQL definition for module ticket
-- Copyright (C) 2013 Jean-François FERRY <hello@librethic.io>
--
-- This program is free software: you can redistribute it and/or modify
@@ -14,4 +14,4 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
ALTER TABLE llx_ticketsup ADD UNIQUE uk_ticketsup_track_id (track_id);
ALTER TABLE llx_ticket ADD UNIQUE uk_ticket_track_id (track_id);

View File

@@ -1,4 +1,4 @@
-- SQL definition for module ticketsup
-- SQL definition for module ticket
-- Copyright (C) 2013 Jean-François FERRY <hello@librethic.io>
--
-- This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
CREATE TABLE llx_ticketsup
CREATE TABLE llx_ticket
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,

View File

@@ -15,7 +15,7 @@
--
--
create table llx_ticketsup_extrafields
create table llx_ticket_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,

View File

@@ -1,4 +1,4 @@
-- SQL definition for module ticketsup
-- SQL definition for module ticket
-- Copyright (C) 2013 Jean-François FERRY <hello@librethic.io>
--
-- This program is free software: you can redistribute it and/or modify
@@ -14,4 +14,4 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
ALTER TABLE llx_ticketsup_msg ADD CONSTRAINT fk_ticketsup_msg_fk_track_id FOREIGN KEY (fk_track_id) REFERENCES llx_ticketsup (track_id);
ALTER TABLE llx_ticket_logs ADD CONSTRAINT fk_ticket_logs_fk_track_id FOREIGN KEY (fk_track_id) REFERENCES llx_ticket (track_id);

View File

@@ -1,4 +1,4 @@
-- SQL definition for module ticketsup
-- SQL definition for module ticket
-- Copyright (C) 2013 Jean-François FERRY <hello@librethic.io>
--
-- This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
CREATE TABLE llx_ticketsup_logs
CREATE TABLE llx_ticket_logs
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,

View File

@@ -1,4 +1,4 @@
-- SQL definition for module ticketsup
-- SQL definition for module ticket
-- Copyright (C) 2013 Jean-François FERRY <hello@librethic.io>
--
-- This program is free software: you can redistribute it and/or modify
@@ -14,4 +14,4 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
ALTER TABLE llx_ticketsup_logs ADD CONSTRAINT fk_ticketsup_logs_fk_track_id FOREIGN KEY (fk_track_id) REFERENCES llx_ticketsup (track_id);
ALTER TABLE llx_ticket_msg ADD CONSTRAINT fk_ticket_msg_fk_track_id FOREIGN KEY (fk_track_id) REFERENCES llx_ticket (track_id);

View File

@@ -1,4 +1,4 @@
-- SQL definition for module ticketsup
-- SQL definition for module ticket
-- Copyright (C) 2013 Jean-François FERRY <hello@librethic.io>
--
-- This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
CREATE TABLE llx_ticketsup_msg
CREATE TABLE llx_ticket_msg
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,

View File

@@ -1,4 +1,4 @@
# en_US lang file for module ticketsup
# en_US lang file for module ticket
# Copyright (C) 2013 Jean-François FERRY <hello@librethic.io>
#
# This program is free software: you can redistribute it and/or modify
@@ -27,9 +27,9 @@ Permission56003=Delete tickets
Permission56004=Manage tickets
Permission56005=See tickets of all third parties (not effective for external users, always be limited to the thirdparty they depend on)
TicketsupDictType=Tickets type
TicketsupDictCategory=Tickets categories
TicketsupDictSeverity=Tickets severity
TicketDictType=Tickets type
TicketDictCategory=Tickets categories
TicketDictSeverity=Tickets severity
TicketTypeShortBUGSOFT=Dysfonctionnement logiciel
TicketTypeShortBUGHARD=Dysfonctionnement matériel
TicketTypeShortCOM=Commercial question
@@ -43,14 +43,14 @@ TicketSeverityShortHIGH=High
TicketSeverityShortBLOCKING=Critical/Blocking
ErrorBadEmailAddress=Field '%s' incorrect
MenuTicketsupMyAssign=My tickets
MenuTicketsupMyAssignNonClosed=My open tickets
MenuTicketMyAssign=My tickets
MenuTicketMyAssignNonClosed=My open tickets
MenuListNonClosed=Open tickets
TypeContact_ticketsup_internal_CONTRIBUTOR=Contributor
TypeContact_ticketsup_internal_SUPPORTTEC=Assigned user
TypeContact_ticketsup_external_SUPPORTCLI=Customer contact / incident tracking
TypeContact_ticketsup_external_CONTRIBUTOR=External contributor
TypeContact_ticket_internal_CONTRIBUTOR=Contributor
TypeContact_ticket_internal_SUPPORTTEC=Assigned user
TypeContact_ticket_external_SUPPORTCLI=Customer contact / incident tracking
TypeContact_ticket_external_CONTRIBUTOR=External contributor
OriginEmail=Email source
Notify_TICKETMESSAGE_SENTBYMAIL=Send ticket answer by email
@@ -71,16 +71,16 @@ Category=Category
Severity=Severity
# Email templates
MailToSendTicketsupMessage=To send email from ticket message
MailToSendTicketMessage=To send email from ticket message
#
# Admin page
#
TicketsupSetup=Ticket module setup
TicketSupSettings=Settings
TicketsupSetupPage=
TicketsupPublicAccess=A public interface requiring no identification is available at the following url
TicketsupSetupDictionaries=The type of application categories and severity level are configurable from dictionaries
TicketSetup=Ticket module setup
TicketSettings=Settings
TicketSetupPage=
TicketPublicAccess=A public interface requiring no identification is available at the following url
TicketSetupDictionaries=The type of application categories and severity level are configurable from dictionaries
TicketParamModule=Module variable setup
TicketParamMail=Email setup
TicketEmailNotificationFrom=Notification email from
@@ -102,8 +102,8 @@ TicketPublicInterfaceTopicLabelAdmin=Interface title
TicketPublicInterfaceTopicHelp=This text will appear as the title of the public interface.
TicketPublicInterfaceTextHelpMessageLabelAdmin=Help text to the message entry
TicketPublicInterfaceTextHelpMessageHelpAdmin=This text will appear above the message input area of the user.
ExtraFieldsTicketSup=Extra attributes
TicketSupCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL content to 1 to get it.
ExtraFieldsTicket=Extra attributes
TicketCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL content to 1 to get it.
TicketsDisableEmail=Do not send ticket creation or message send emails
TicketsDisableEmailHelp=By default, emails are sent when new tickets or messages created. Enable this option to disable *all* email notifications
TicketsLogEnableEmail=Enable log by email
@@ -121,17 +121,17 @@ TicketsActivatePublicInterface=Activate public interface
TicketsActivatePublicInterfaceHelp=Public interface allow any visitors to create tickets.
TicketsAutoAssignTicket=Automatically assign the user who created the ticket
TicketsAutoAssignTicketHelp=When creating a ticket, the user can be automatically assigned to the ticket.
TicketSupNumberingModules=Tickets numbering module
TicketNumberingModules=Tickets numbering module
TicketNotifyTiersAtCreation=Notify thirdparty at creation
#
# About page
#
About=About
TicketSupAbout=About ticket module
TicketSupAboutModule=The development of this module has been initiated by the company Libr&thic.
TicketSupAboutModuleHelp=You can get help by using the contact form on the website <a href="http://librethic.io">librethic.io</a>
TicketSupAboutModuleImprove=Feel free to suggest improvements! Please visit <a href="https://code.librethic.io/Dolibarr/modules/ticketsup">the project page</a> on Doliforge website to report bugs and add tasks.
TicketAbout=About ticket module
TicketAboutModule=The development of this module has been initiated by the company Libr&thic.
TicketAboutModuleHelp=You can get help by using the contact form on the website <a href="http://librethic.io">librethic.io</a>
TicketAboutModuleImprove=Feel free to suggest improvements! Please visit <a href="https://code.librethic.io/Dolibarr/modules/ticket">the project page</a> on Doliforge website to report bugs and add tasks.
#
# Index & list page
@@ -147,7 +147,7 @@ TicketStatByStatus=Tickets by status
#
# Ticket card
#
Ticketsup=Incident ticket
Ticket=Incident ticket
TicketCard=Ticket card
CreateTicket=Create new ticket
EditTicket=Edit ticket
@@ -219,7 +219,7 @@ TicketMessagePrivateHelp=This message will not display to external users
TicketEmailOriginIssuer=Issuer at origin of the tickets
InitialMessage=Initial Message
LinkToAContract=Link to a contract
TicketSupPleaseSelectAContract=Select a contract
TicketPleaseSelectAContract=Select a contract
UnableToCreateInterIfNoSocid=Can not create an intervention when no third party are defined
TicketMailExchanges=Mail exchanges
TicketInitialMessageModified=Initial message modified
@@ -287,11 +287,11 @@ TicketNotificationNumberEmailSent=Notification email sent : %s
#
# Boxes
#
BoxLastTicketsup=Latest created tickets
BoxLastTicketsupDescription=Latest %s created tickets
BoxLastTicketsupContent=
BoxLastTicketsupNoRecordedTickets=No recent unread tickets
BoxLastModifiedTicketsup=Latest modified tickets
BoxLastModifiedTicketsupDescription=Latest %s modified tickets
BoxLastModifiedTicketsupContent=
BoxLastModifiedTicketsupNoRecordedTickets=No recent modified tickets
BoxLastTicket=Latest created tickets
BoxLastTicketDescription=Latest %s created tickets
BoxLastTicketContent=
BoxLastTicketNoRecordedTickets=No recent unread tickets
BoxLastModifiedTicket=Latest modified tickets
BoxLastModifiedTicketDescription=Latest %s modified tickets
BoxLastModifiedTicketContent=
BoxLastModifiedTicketNoRecordedTickets=No recent modified tickets

View File

@@ -1,4 +1,4 @@
# en_US lang file for module ticketsup
# en_US lang file for module ticket
# Copyright (C) 2013 Jean-François FERRY <hello@librethic.io>
#
# This program is free software: you can redistribute it and/or modify
@@ -27,9 +27,9 @@ Permission56003=Supprimer tickets
Permission56004=Gérer les tickets
Permission56005=See tickets of all third parties (not effective for external users, always be limited to the thirdparty they depend on)
TicketsupDictType=Type de ticket
TicketsupDictCategory=Catégories de tickets
TicketsupDictSeverity=Sévérité des tickets
TicketDictType=Type de ticket
TicketDictCategory=Catégories de tickets
TicketDictSeverity=Sévérité des tickets
TicketTypeShortBUGSOFT=Dysfonctionnement logiciel
TicketTypeShortBUGHARD=Dysfonctionnement matériel
TicketTypeShortCOM=Question commerciale
@@ -43,14 +43,14 @@ TicketSeverityShortHIGH=Élevé
TicketSeverityShortBLOCKING=Critique/Bloquant
ErrorBadEmailAddress=Champ '%s' incorrect
MenuTicketsupMyAssign=Mes tickets
MenuTicketsupMyAssignNonClosed=Mes tickets ouverts
MenuTicketMyAssign=Mes tickets
MenuTicketMyAssignNonClosed=Mes tickets ouverts
MenuListNonClosed=Tickets ouverts
TypeContact_ticketsup_internal_CONTRIBUTOR=Contributeur
TypeContact_ticketsup_internal_SUPPORTTEC=Utilisateur assigné
TypeContact_ticketsup_external_SUPPORTCLI=Customer contact / incident tracking
TypeContact_ticketsup_external_CONTRIBUTOR=Contributeur externe
TypeContact_ticket_internal_CONTRIBUTOR=Contributeur
TypeContact_ticket_internal_SUPPORTTEC=Utilisateur assigné
TypeContact_ticket_external_SUPPORTCLI=Customer contact / incident tracking
TypeContact_ticket_external_CONTRIBUTOR=Contributeur externe
OriginEmail=Email source
Notify_TICKETMESSAGE_SENTBYMAIL=Envoyée la réponse par email
@@ -71,16 +71,16 @@ Category=Catégorie
Severity=Sévérité
# Email templates
MailToSendTicketsupMessage=To send email from ticket message
MailToSendTicketMessage=To send email from ticket message
#
# Admin page
#
TicketsupSetup=Ticket module setup
TicketSupSettings=Paramètres
TicketsupSetupPage=
TicketsupPublicAccess=A public interface requiring no identification is available at the following url
TicketsupSetupDictionaries=The type of application categories and severity level are configurable from dictionaries
TicketSetup=Ticket module setup
TicketSettings=Paramètres
TicketSetupPage=
TicketPublicAccess=A public interface requiring no identification is available at the following url
TicketSetupDictionaries=The type of application categories and severity level are configurable from dictionaries
TicketParamModule=Module variable setup
TicketParamMail=Configuration de la messagerie
TicketEmailNotificationFrom=Email from de notification
@@ -102,8 +102,8 @@ TicketPublicInterfaceTopicLabelAdmin=Titre de l'interface
TicketPublicInterfaceTopicHelp=Ce texte apparaîtra comme titre sur l'interface publique.
TicketPublicInterfaceTextHelpMessageLabelAdmin=Help text to the message entry
TicketPublicInterfaceTextHelpMessageHelpAdmin=This text will appear above the message input area of the user.
ExtraFieldsTicketSup=Attributs complémentaires
TicketSupCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL contant equal to 1
ExtraFieldsTicket=Attributs complémentaires
TicketCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL contant equal to 1
TicketsDisableEmail=Do not send ticket creation or message send emails
TicketsDisableEmailHelp=By default, emails are sent when new tickets or messages created. Enable this option to disable *all* email notifications
TicketsLogEnableEmail=Activer l'alerte par mail
@@ -121,16 +121,16 @@ TicketsActivatePublicInterface=Activer l'interface publique
TicketsActivatePublicInterfaceHelp=Public interface allow any visitors to create tickets.
TicketsAutoAssignTicket=Automatically assign the user who created the ticket
TicketsAutoAssignTicketHelp=When creating a ticket, the user can be automatically assigned to the ticket.
TicketSupNumberingModules=Tickets numbering module
TicketNumberingModules=Tickets numbering module
TicketNotifyTiersAtCreation=Notifier le tiers à la création
#
# About page
#
TicketSupAboutModule=The development of this module has been initiated by the company Libr&thic.
TicketSupAboutModuleHelp=You can get help by using the contact form on the website <a href="http://librethic.io">librethic.io</a>
TicketSupAboutModuleImprove=Feel free to suggest improvements! Please visit <a href="https://code.librethic.io/Dolibarr/modules/ticketsup">the project page</a> on Doliforge website to report bugs and add tasks.
TicketSupAboutModuleThanks=Thanks to <a href="http://sayatnowa.com">nwa</a> who creates icons for this module./
TicketAboutModule=The development of this module has been initiated by the company Libr&thic.
TicketAboutModuleHelp=You can get help by using the contact form on the website <a href="http://librethic.io">librethic.io</a>
TicketAboutModuleImprove=Feel free to suggest improvements! Please visit <a href="https://code.librethic.io/Dolibarr/modules/ticket">the project page</a> on Doliforge website to report bugs and add tasks.
TicketAboutModuleThanks=Thanks to <a href="http://sayatnowa.com">nwa</a> who creates icons for this module./
#
# Index & list page
@@ -146,7 +146,7 @@ TicketStatByStatus=Tickets par statut
#
# Ticket card
#
Ticketsup=Ticket
Ticket=Ticket
TicketCard=Ticket card
CreateTicket=Créer nouveau ticket
EditTicket=Modifier ticket
@@ -219,7 +219,7 @@ TicketMessagePrivateHelp=This message will not display to external users
TicketEmailOriginIssuer=Issuer at origin of the tickets
InitialMessage=Message initial
LinkToAContract=Link to a contract
TicketSupPleaseSelectAContract=Sélectionner un contrat
TicketPleaseSelectAContract=Sélectionner un contrat
UnableToCreateInterIfNoSocid=Impossible de créer une intervention si aucun tiers n'est défini
TicketMailExchanges=Mail exchanges
TicketInitialMessageModified=Message initial modifié
@@ -287,11 +287,11 @@ TicketNotificationNumberEmailSent=Email de notification envoyé: %s
#
# Boxes
#
BoxLastTicketsup=Derniers tickets créés
BoxLastTicketsupDescription=Latest %s created tickets
BoxLastTicketsupContent=
BoxLastTicketsupNoRecordedTickets=Pas de ticket non lu
BoxLastModifiedTicketsup=Latest modified tickets
BoxLastModifiedTicketsupDescription=Latest %s modified tickets
BoxLastModifiedTicketsupContent=
BoxLastModifiedTicketsupNoRecordedTickets=Pas de tickets modifiés récemment
BoxLastTicket=Derniers tickets créés
BoxLastTicketDescription=Latest %s created tickets
BoxLastTicketContent=
BoxLastTicketNoRecordedTickets=Pas de ticket non lu
BoxLastModifiedTicket=Latest modified tickets
BoxLastModifiedTicketDescription=Latest %s modified tickets
BoxLastModifiedTicketContent=
BoxLastModifiedTicketNoRecordedTickets=Pas de tickets modifiés récemment

View File

@@ -17,8 +17,8 @@
*/
/**
* \file htdocs/public/ticketsup/index.php
* \ingroup ticketsup
* \file htdocs/public/ticket/index.php
* \ingroup ticket
* \brief Display public form to add new ticket
*/
@@ -30,14 +30,14 @@ if (!defined('NOLOGIN')) define("NOLOGIN", 1); // This means this out
if (!defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/ticketsup/class/actions_ticketsup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticketsup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ticketsup.lib.php';
require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticket.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
// Load translation files required by the page
$langs->loadLangs(array('companies', 'other', 'mails', 'ticketsup'));
$langs->loadLangs(array('companies', 'other', 'mails', 'ticket'));
// Get parameters
$id = GETPOST('id', 'int');
@@ -45,7 +45,7 @@ $msg_id = GETPOST('msg_id', 'int');
$action = GETPOST('action', 'alpha');
$object = new Ticketsup($db);
$object = new Ticket($db);
$extrafields = new ExtraFields($db);
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
@@ -63,7 +63,7 @@ if (GETPOST('addfile') && !GETPOST('add_ticket')) {
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
// Set tmp directory TODO Use a dedicated directory for temp mails files
$vardir = $conf->ticketsup->dir_output;
$vardir = $conf->ticket->dir_output;
$upload_dir_tmp = $vardir . '/temp';
if (!dol_is_dir($upload_dir_tmp)) {
dol_mkdir($upload_dir_tmp);
@@ -79,7 +79,7 @@ if (GETPOST('removedfile') && !GETPOST('add_ticket')) {
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
// Set tmp directory
$vardir = $conf->ticketsup->dir_output . '/';
$vardir = $conf->ticket->dir_output . '/';
$upload_dir_tmp = $vardir . '/temp';
// TODO Delete only files that was uploaded from email form
@@ -155,7 +155,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
$user = new User($db);
}
$object->context['disableticketsupemail']=1; // Disable emails sent by ticketsup trigger when creation is done from this page, emails are already sent later
$object->context['disableticketemail']=1; // Disable emails sent by ticket trigger when creation is done from this page, emails are already sent later
$id = $object->create($user);
if ($id <= 0) {
@@ -206,7 +206,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
$message .= ($conf->global->TICKETS_MESSAGE_MAIL_NEW ? $conf->global->TICKETS_MESSAGE_MAIL_NEW : $langs->transnoentities('TicketNewEmailBody')) . "\n\n";
$message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket') . "\n";
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/public/ticketsup/view.php', 2)) . '?track_id=' . $object->track_id;
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/public/ticket/view.php', 2)) . '?track_id=' . $object->track_id;
$infos_new_ticket = $langs->transnoentities('TicketNewEmailBodyInfosTrackId', '<a href="' . $url_public_ticket . '">' . $object->track_id . '</a>') . "\n";
$infos_new_ticket .= $langs->transnoentities('TicketNewEmailBodyInfosTrackUrl') . "\n\n";
@@ -274,7 +274,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
$message_admin .= '</ul>';
$message_admin .= '<p>' . $langs->trans('Message') . ' : <br>' . $object->message . '</p>';
$message_admin .= '<p><a href="' . dol_buildpath('/ticketsup/card.php', 2) . '?track_id=' . $object->track_id . '">' . $langs->trans('SeeThisTicketIntomanagementInterface') . '</a></p>';
$message_admin .= '<p><a href="' . dol_buildpath('/ticket/card.php', 2) . '?track_id=' . $object->track_id . '">' . $langs->trans('SeeThisTicketIntomanagementInterface') . '</a></p>';
$from = $conf->global->MAIN_INFO_SOCIETE_NOM . '<' . $conf->global->TICKETS_NOTIFICATION_EMAIL_FROM . '>';
$replyto = $from;
@@ -299,7 +299,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
}
// Copy files into ticket directory
$destdir = $conf->ticketsup->dir_output . '/' . $object->track_id;
$destdir = $conf->ticket->dir_output . '/' . $object->track_id;
if (! dol_is_dir($destdir)) {
dol_mkdir($destdir);
}
@@ -322,12 +322,12 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
*/
$arrayofjs = array();
$arrayofcss = array('/opensurvey/css/style.css', '/ticketsup/css/styles.css.php');
$arrayofcss = array('/opensurvey/css/style.css', '/ticket/css/styles.css.php');
llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss);
$form = new Form($db);
$formticket = new FormTicketsup($db);
$formticket = new FormTicket($db);
if (!$conf->global->TICKETS_ENABLE_PUBLIC_INTERFACE) {
print '<div class="error">' . $langs->trans('TicketPublicInterfaceForbidden') . '</div>';

View File

@@ -16,8 +16,8 @@
*/
/**
* \file htdocs/public/ticketsup/index.php
* \ingroup ticketsup
* \file htdocs/public/ticket/index.php
* \ingroup ticket
* \brief Public file to add and manage ticket
*/
@@ -26,13 +26,13 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/ticketsup/class/actions_ticketsup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticketsup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ticketsup.lib.php';
require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticket.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
// Load translation files required by the page
$langs->loadLangs(array('companies', 'other', 'ticketsup', 'errors'));
$langs->loadLangs(array('companies', 'other', 'ticket', 'errors'));
// Get parameters
$track_id = GETPOST('track_id', 'alpha');
@@ -43,10 +43,10 @@ $action = GETPOST('action', 'alpha');
*
****************************************************/
$form = new Form($db);
$formticket = new FormTicketsup($db);
$formticket = new FormTicket($db);
$arrayofjs = array();
$arrayofcss = array('/ticketsup/css/styles.css.php');
$arrayofcss = array('/ticket/css/styles.css.php');
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
if (!$conf->global->TICKETS_ENABLE_PUBLIC_INTERFACE) {

View File

@@ -16,8 +16,8 @@
*/
/**
* \file htdocs/public/ticketsup/list.php
* \ingroup ticketsup
* \file htdocs/public/ticket/list.php
* \ingroup ticket
* \brief Public file to add and manage ticket
*/
@@ -35,12 +35,12 @@ if (!defined("NOLOGIN")) {
// If this page is public (can be called outside logged session)
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/ticketsup/class/actions_ticketsup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticketsup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ticketsup.lib.php';
require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticket.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("companies","other","ticketsup"));
$langs->loadLangs(array("companies","other","ticket"));
// Get parameters
$track_id = GETPOST('track_id', 'alpha');
@@ -58,7 +58,7 @@ if (isset($_SESSION['email_customer'])) {
$email = $_SESSION['email_customer'];
}
$object = new ActionsTicketsup($db);
$object = new ActionsTicket($db);
@@ -138,10 +138,10 @@ $object->doActions($action);
$form = new Form($db);
$user_assign = new User($db);
$user_create = new User($db);
$formticket = new FormTicketsup($db);
$formticket = new FormTicket($db);
$arrayofjs = array();
$arrayofcss = array('/ticketsup/css/styles.css.php');
$arrayofcss = array('/ticket/css/styles.css.php');
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
if (!$conf->global->TICKETS_ENABLE_PUBLIC_INTERFACE) {
@@ -166,7 +166,7 @@ if ($action == "view_ticketlist")
$search_fk_user_assign = GETPOST("search_fk_user_assign", 'int');
// Store current page url
$url_page_current = dol_buildpath('/public/ticketsup/list.php', 1);
$url_page_current = dol_buildpath('/public/ticket/list.php', 1);
// Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x")) {
@@ -181,7 +181,7 @@ if ($action == "view_ticketlist")
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extralabels = $extrafields->fetch_name_optionals_label('ticketsup');
$extralabels = $extrafields->fetch_name_optionals_label('ticket');
$search_array_options = $extrafields->getOptionalsFromPost($extralabels, '', 'search_');
$filter = array();
@@ -308,10 +308,10 @@ if ($action == "view_ticketlist")
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val)
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef." . $key . ' as options_' . $key : '');
}
$sql .= " FROM " . MAIN_DB_PREFIX . "ticketsup as t";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_type as type ON type.code=t.type_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_category as category ON category.code=t.category_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_severity as severity ON severity.code=t.severity_code";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_type as type ON type.code=t.type_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_category as category ON category.code=t.category_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_severity as severity ON severity.code=t.severity_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid=t.fk_soc";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as uc ON uc.rowid=t.fk_user_create";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as ua ON ua.rowid=t.fk_user_assign";
@@ -319,9 +319,9 @@ if ($action == "view_ticketlist")
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_contact as tc ON ec.fk_c_type_contact=tc.rowid";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople sp ON ec.fk_socpeople=sp.rowid";
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "ticketsup_extrafields as ef on (t.rowid = ef.fk_object)";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "ticket_extrafields as ef on (t.rowid = ef.fk_object)";
}
$sql .= " WHERE t.entity IN (" . getEntity('ticketsup') . ")";
$sql .= " WHERE t.entity IN (" . getEntity('ticket') . ")";
$sql .= " AND ((tc.source = 'external'";
$sql .= " AND tc.element='" . $db->escape($object->dao->element) . "'";
$sql .= " AND tc.active=1)";
@@ -359,7 +359,7 @@ if ($action == "view_ticketlist")
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
print_barre_liste($langs->trans('TicketList'), $page, 'public/list.php', $param, $sortfield, $sortorder, '', $num, $num_total, 'ticketsup');
print_barre_liste($langs->trans('TicketList'), $page, 'public/list.php', $param, $sortfield, $sortorder, '', $num, $num_total, 'ticket');
/*
* Search bar
@@ -430,7 +430,7 @@ if ($action == "view_ticketlist")
/*
* Filter bar
*/
$formTicket = new FormTicketsup($db);
$formTicket = new FormTicket($db);
print '<tr class="liste_titre">';
@@ -643,7 +643,7 @@ if ($action == "view_ticketlist")
print '</table>';
print '</form>';
print '<form method="post" id="form_view_ticket" name="form_view_ticket" enctype="multipart/form-data" action="' . dol_buildpath('/public/ticketsup/view.php', 1) . '" style="display:none;">';
print '<form method="post" id="form_view_ticket" name="form_view_ticket" enctype="multipart/form-data" action="' . dol_buildpath('/public/ticket/view.php', 1) . '" style="display:none;">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="view_ticket">';
print '<input type="hidden" name="btn_view_ticket_list" value="1">';

View File

@@ -16,8 +16,8 @@
*/
/**
* \file htdocs/public/ticketsup/index.php
* \ingroup ticketsup
* \file htdocs/public/ticket/index.php
* \ingroup ticket
* \brief Public file to add and manage ticket
*/
@@ -35,12 +35,12 @@ if (!defined("NOLOGIN")) {
// If this page is public (can be called outside logged session)
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/ticketsup/class/actions_ticketsup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticketsup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ticketsup.lib.php';
require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticket.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("companies","other","ticketsup"));
$langs->loadLangs(array("companies","other","ticket"));
// Get parameters
$track_id = GETPOST('track_id', 'alpha');
@@ -54,7 +54,7 @@ if (isset($_SESSION['email_customer'])) {
$email = $_SESSION['email_customer'];
}
$object = new ActionsTicketsup($db);
$object = new ActionsTicket($db);
/*
@@ -126,10 +126,10 @@ $object->doActions($action);
*/
$form = new Form($db);
$formticket = new FormTicketsup($db);
$formticket = new FormTicket($db);
$arrayofjs = array();
$arrayofcss = array('/ticketsup/css/styles.css.php');
$arrayofcss = array('/ticket/css/styles.css.php');
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
@@ -245,9 +245,9 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
print '<div style="clear: both; margin-top: 1.5em;"></div>';
if ($action == 'add_message') {
print load_fiche_titre($langs->trans('TicketAddMessage'), '', 'messages@ticketsup');
print load_fiche_titre($langs->trans('TicketAddMessage'), '', 'messages@ticket');
$formticket = new FormTicketsup($db);
$formticket = new FormTicket($db);
$formticket->action = "new_public_message";
$formticket->track_id = $object->dao->track_id;
@@ -258,7 +258,7 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
$formticket->withfile = 2;
$formticket->showMessageForm('100%');
} else {
print '<form method="post" id="form_view_ticket_list" name="form_view_ticket_list" enctype="multipart/form-data" action="' . dol_buildpath('/public/ticketsup/list.php', 1) . '">';
print '<form method="post" id="form_view_ticket_list" name="form_view_ticket_list" enctype="multipart/form-data" action="' . dol_buildpath('/public/ticket/list.php', 1) . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="view_ticketlist">';
print '<input type="hidden" name="track_id" value="'.$object->dao->track_id.'">';
@@ -284,13 +284,13 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
}
// Message list
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'messages@ticketsup');
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'messages@ticket');
$object->viewTicketMessages(false);
print '<br>';
// Logs list
print load_fiche_titre($langs->trans('TicketHistory'), '', 'history@ticketsup');
print load_fiche_titre($langs->trans('TicketHistory'), '', 'history@ticket');
$object->viewTicketLogs(false);
} else {
print '<div class="error">Not Allowed<br><a href="' . $_SERVER['PHP_SELF'] . '?track_id=' . $object->dao->track_id . '">' . $langs->trans('Back') . '</a></div>';

View File

@@ -153,7 +153,7 @@ class FormResource
*
* @param string $selected Id du type pre-selectionne
* @param string $htmlname Nom de la zone select
* @param string $filtertype To filter on field type in llx_c_ticketsup_type (array('code'=>xx,'label'=>zz))
* @param string $filtertype To filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz))
* @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
* @param int $empty 1=peut etre vide, 0 sinon
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info

View File

Before

Width:  |  Height:  |  Size: 209 B

After

Width:  |  Height:  |  Size: 209 B

View File

Before

Width:  |  Height:  |  Size: 209 B

After

Width:  |  Height:  |  Size: 209 B

View File

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 203 B

View File

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 203 B

View File

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 344 B

View File

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 234 B

View File

@@ -1699,8 +1699,8 @@ div.mainmenu.project {
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/project_over.png',1) ?>);
}
div.mainmenu.ticketsup {
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/ticketsup_over.png',1) ?>);
div.mainmenu.ticket {
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/ticket_over.png',1) ?>);
}
div.mainmenu.tools {
@@ -1718,7 +1718,7 @@ $moduletomainmenu=array(
'user'=>'','syslog'=>'','societe'=>'companies','projet'=>'project','propale'=>'commercial','commande'=>'commercial',
'produit'=>'products','service'=>'products','stock'=>'products',
'don'=>'accountancy','tax'=>'accountancy','banque'=>'accountancy','facture'=>'accountancy','compta'=>'accountancy','accounting'=>'accountancy','adherent'=>'members','import'=>'tools','export'=>'tools','mailing'=>'tools',
'contrat'=>'commercial','ficheinter'=>'commercial','ticketsup'=>'ticketsup','deplacement'=>'commercial',
'contrat'=>'commercial','ficheinter'=>'commercial','ticket'=>'ticket','deplacement'=>'commercial',
'fournisseur'=>'companies',
'barcode'=>'','fckeditor'=>'','categorie'=>'',
);
@@ -1734,7 +1734,7 @@ $generic=1;
// Put here list of menu entries when the div.mainmenu.menuentry was previously defined
$divalreadydefined=array('home','companies','products','commercial','externalsite','accountancy','project','tools','members','agenda','ftp','holiday','hrm','bookmark','cashdesk','ecm','geoipmaxmind','gravatar','clicktodial','paypal','stripe','webservices','website');
// Put here list of menu entries we are sure we don't want
$divnotrequired=array('multicurrency','salaries','ticketsup','margin','opensurvey','paybox','expensereport','incoterm','prelevement','propal','workflow','notification','supplier_proposal','cron','product','productbatch','expedition');
$divnotrequired=array('multicurrency','salaries','ticket','margin','opensurvey','paybox','expensereport','incoterm','prelevement','propal','workflow','notification','supplier_proposal','cron','product','productbatch','expedition');
foreach($mainmenuusedarray as $val)
{
if (empty($val) || in_array($val,$divalreadydefined)) continue;

View File

Before

Width:  |  Height:  |  Size: 916 B

After

Width:  |  Height:  |  Size: 916 B

View File

Before

Width:  |  Height:  |  Size: 520 B

After

Width:  |  Height:  |  Size: 520 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -1710,8 +1710,8 @@ div.mainmenu.project {
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/project.png',1) ?>);
}
div.mainmenu.ticketsup {
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/ticketsup.png',1) ?>);
div.mainmenu.ticket {
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/ticket.png',1) ?>);
}
div.mainmenu.tools {
@@ -1728,7 +1728,7 @@ div.mainmenu.website {
$moduletomainmenu=array('user'=>'','syslog'=>'','societe'=>'companies','projet'=>'project','propale'=>'commercial','commande'=>'commercial',
'produit'=>'products','service'=>'products','stock'=>'products',
'don'=>'accountancy','tax'=>'accountancy','banque'=>'accountancy','facture'=>'accountancy','compta'=>'accountancy','accounting'=>'accountancy','adherent'=>'members','import'=>'tools','export'=>'tools','mailing'=>'tools',
'contrat'=>'commercial','ficheinter'=>'commercial','ticketsup'=>'ticketsup','deplacement'=>'commercial',
'contrat'=>'commercial','ficheinter'=>'commercial','ticket'=>'ticket','deplacement'=>'commercial',
'fournisseur'=>'companies',
'barcode'=>'','fckeditor'=>'','categorie'=>'',
);
@@ -1744,7 +1744,7 @@ $generic=1;
// Put here list of menu entries when the div.mainmenu.menuentry was previously defined
$divalreadydefined=array('home','companies','products','commercial','externalsite','accountancy','project','tools','members','agenda','ftp','holiday','hrm','bookmark','cashdesk','ecm','geoipmaxmind','gravatar','clicktodial','paypal','stripe','webservices','website');
// Put here list of menu entries we are sure we don't want
$divnotrequired=array('multicurrency','salaries','ticketsup','margin','opensurvey','paybox','expensereport','incoterm','prelevement','propal','workflow','notification','supplier_proposal','cron','product','productbatch','expedition');
$divnotrequired=array('multicurrency','salaries','ticket','margin','opensurvey','paybox','expensereport','incoterm','prelevement','propal','workflow','notification','supplier_proposal','cron','product','productbatch','expedition');
foreach($mainmenuusedarray as $val)
{
if (empty($val) || in_array($val,$divalreadydefined)) continue;

View File

@@ -18,14 +18,14 @@
*/
/**
* \file htdocs/ticketsup/card.php
* \ingroup ticketsup
* \file htdocs/ticket/card.php
* \ingroup ticket
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/ticketsup/class/actions_ticketsup.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formticketsup.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/ticketsup.lib.php';
require_once DOL_DOCUMENT_ROOT . '/ticket/class/actions_ticket.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formticket.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
@@ -42,7 +42,7 @@ if (!empty($conf->contrat->enabled)) {
}
// Load translation files required by the page
$langs->loadLangs(array("companies","other","ticketsup"));
$langs->loadLangs(array("companies","other","ticket"));
// Get parameters
$id = GETPOST('id', 'int');
@@ -51,10 +51,10 @@ $ref = GETPOST('ref', 'alpha');
$projectid = GETPOST('projectid', 'int');
$action = GETPOST('action', 'alpha', 3);
// Initialize technical object to manage hooks of ticketsup. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('ticketsupcard','globalcard'));
// Initialize technical object to manage hooks of ticket. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('ticketcard','globalcard'));
$object = new Ticketsup($db);
$object = new Ticket($db);
$extrafields = new ExtraFields($db);
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
@@ -68,17 +68,17 @@ if (GETPOST('modelselected','alpha')) {
}
// Store current page url
$url_page_current = DOL_URL_ROOT.'/ticketsup/card.php';
$url_page_current = DOL_URL_ROOT.'/ticket/card.php';
if ($id || $track_id || $ref) {
$res = $object->fetch($id, $ref, $track_id);
}
// Security check
$result = restrictedArea($user, 'ticketsup', $object->id);
$result = restrictedArea($user, 'ticket', $object->id);
$triggermodname = 'TICKETSUP_MODIFY';
$permissiontoadd = $user->rights->ticketsup->write;
$permissiontoadd = $user->rights->ticket->write;
@@ -97,7 +97,7 @@ if ($cancel)
}
$actionobject = new ActionsTicketsup($db);
$actionobject = new ActionsTicket($db);
$actionobject->doActions($action, $object);
// Action to update one extrafield
@@ -121,7 +121,7 @@ if ($action == "update_extras" && ! empty($permissiontoadd))
}
}
if ($action == "change_property" && GETPOST('btn_update_ticket_prop','alpha') && $user->rights->ticketsup->write)
if ($action == "change_property" && GETPOST('btn_update_ticket_prop','alpha') && $user->rights->ticket->write)
{
$object->fetch(GETPOST('id','int'), '', GETPOST('track_id','alpha'));
@@ -140,7 +140,7 @@ if ($action == "change_property" && GETPOST('btn_update_ticket_prop','alpha') &&
$action = 'view';
}
$permissiondellink = $user->rights->ticketsup->write;
$permissiondellink = $user->rights->ticket->write;
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
@@ -152,7 +152,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be inc
$userstat = new User($db);
$form = new Form($db);
$formticket = new FormTicketsup($db);
$formticket = new FormTicket($db);
if (! empty($conf->projet->enabled)) {
$formproject = new FormProjets($db);
@@ -164,7 +164,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
if ($res > 0) {
// or for unauthorized internals users
if (!$user->societe_id && ($conf->global->TICKETS_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticketsup->manage) {
if (!$user->societe_id && ($conf->global->TICKETS_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
accessforbidden('', 0);
}
@@ -208,7 +208,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
//print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
$head = project_prepare_head($projectstat);
dol_fiche_head($head, 'ticketsup', $langs->trans("Project"), 0, ($projectstat->public ? 'projectpub' : 'project'));
dol_fiche_head($head, 'ticket', $langs->trans("Project"), 0, ($projectstat->public ? 'projectpub' : 'project'));
/*
* Projet synthese pour rappel
@@ -264,7 +264,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
$object->fetch_thirdparty();
$head = societe_prepare_head($object->thirdparty);
dol_fiche_head($head, 'ticketsup', $langs->trans("ThirdParty"), 0, 'company');
dol_fiche_head($head, 'ticket', $langs->trans("ThirdParty"), 0, 'company');
dol_banner_tab($object->thirdparty, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom');
dol_fiche_end();
}
@@ -275,9 +275,9 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
$object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'";
}
$head = ticketsup_prepare_head($object);
$head = ticket_prepare_head($object);
dol_fiche_head($head, 'tabTicketsup', $langs->trans("Ticket"), -1, 'ticketsup');
dol_fiche_head($head, 'tabTicket', $langs->trans("Ticket"), -1, 'ticket');
$morehtmlref ='<div class="refidno">';
$morehtmlref.= $object->subject;
@@ -300,7 +300,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->ticketsup->write)
if ($user->rights->ticket->write)
{
if ($action != 'classify')
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
@@ -330,7 +330,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
$morehtmlref.='</div>';
$linkback = '<a href="' . dol_buildpath('/ticketsup/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
$linkback = '<a href="' . dol_buildpath('/ticket/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id ? 0 : 1), 'ref', 'ref', $morehtmlref);
@@ -354,9 +354,9 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
// Subject
print '<tr><td>';
print $form->editfieldkey("Subject", 'subject', $object->subject, $object, $user->rights->ticketsup->write && !$user->societe_id, 'string');
print $form->editfieldkey("Subject", 'subject', $object->subject, $object, $user->rights->ticket->write && !$user->societe_id, 'string');
print '</td><td>';
print $form->editfieldval("Subject", 'subject', $object->subject, $object, $user->rights->ticketsup->write && !$user->societe_id, 'string');
print $form->editfieldval("Subject", 'subject', $object->subject, $object, $user->rights->ticket->write && !$user->societe_id, 'string');
print '</td></tr>';
// Creation date
@@ -389,7 +389,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('ThirdParty');
print '</td>';
if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->societe_id && $user->rights->ticketsup->write) {
if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->societe_id && $user->rights->ticket->write) {
print '<td align="right"><a href="' . $url_page_current . '?action=editcustomer&amp;track_id=' . $object->track_id . '">' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '</a></td>';
}
print '</tr></table>';
@@ -412,8 +412,8 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
}
// Show user list to assignate one if status is "read"
if (GETPOST('set','alpha') == "assign_ticket" && $object->fk_statut < 8 && !$user->societe_id && $user->rights->ticketsup->write) {
print '<form method="post" name="ticketsup" enctype="multipart/form-data" action="' . $url_page_current . '">';
if (GETPOST('set','alpha') == "assign_ticket" && $object->fk_statut < 8 && !$user->societe_id && $user->rights->ticket->write) {
print '<form method="post" name="ticket" enctype="multipart/form-data" action="' . $url_page_current . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="assign_user">';
print '<input type="hidden" name="track_id" value="' . $object->track_id . '">';
@@ -422,7 +422,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
print ' <input class="button" type="submit" name="btn_assign_user" value="' . $langs->trans("Validate") . '" />';
print '</form>';
}
if ($object->fk_statut < 8 && GETPOST('set','alpha') != "assign_ticket" && $user->rights->ticketsup->manage) {
if ($object->fk_statut < 8 && GETPOST('set','alpha') != "assign_ticket" && $user->rights->ticket->manage) {
print '<a href="' . $url_page_current . '?track_id=' . $object->track_id . '&action=view&set=assign_ticket">' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . '</a>';
}
print '</td></tr>';
@@ -437,7 +437,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
}
print '</tr></table>';
print '</td><td colspan="5">';
if ($user->rights->ticketsup->write && $action == 'progression') {
if ($user->rights->ticket->write && $action == 'progression') {
print '<form action="' . $url_page_current . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="track_id" value="' . $track_id . '">';
@@ -491,7 +491,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
*
***************************************************/
print '<form method="post" name="formticketsupproperties" action="' . $url_page_current . '">';
print '<form method="post" name="formticketproperties" action="' . $url_page_current . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="change_property">';
print '<input type="hidden" name="property" value="' . $property['dict'] . '">';
@@ -504,18 +504,18 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
print $langs->trans('Properties');
print '</td>';
print '<td>';
if (GETPOST('set','alpha') == 'properties' && $user->rights->ticketsup->write) {
if (GETPOST('set','alpha') == 'properties' && $user->rights->ticket->write) {
print '<input class="button" type="submit" name="btn_update_ticket_prop" value="' . $langs->trans("Modify") . '" />';
}
else {
// Button to edit Properties
if ($object->fk_statut < 5 && $user->rights->ticketsup->write) {
if ($object->fk_statut < 5 && $user->rights->ticket->write) {
print '<a href="card.php?track_id=' . $object->track_id . '&action=view&set=properties">' . img_edit($langs->trans('Modify')) . '</a>';
}
}
print '</td>';
print '</tr>';
if (GETPOST('set','alpha') == 'properties' && $user->rights->ticketsup->write) {
if (GETPOST('set','alpha') == 'properties' && $user->rights->ticket->write) {
print '<tr>';
print '<td class="titlefield">';
print $langs->trans('TicketChangeType');
@@ -540,7 +540,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
} else {
// Type
print '<tr><td class="titlefield">' . $langs->trans("Type") . '</td><td>';
print $langs->getLabelFromKey($db, $object->type_code, 'c_ticketsup_type', 'code', 'label');
print $langs->getLabelFromKey($db, $object->type_code, 'c_ticket_type', 'code', 'label');
/*if ($user->admin && !$noadmininfo) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}*/
@@ -548,7 +548,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
// Category
print '<tr><td>' . $langs->trans("Category") . '</td><td>';
print $langs->getLabelFromKey($db, $object->category_code, 'c_ticketsup_category', 'code', 'label');
print $langs->getLabelFromKey($db, $object->category_code, 'c_ticket_category', 'code', 'label');
/*if ($user->admin && !$noadmininfo) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}*/
@@ -556,7 +556,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
// Severity
print '<tr><td>' . $langs->trans("TicketSeverity") . '</td><td>';
print $langs->getLabelFromKey($db, $object->severity_code, 'c_ticketsup_severity', 'code', 'label');
print $langs->getLabelFromKey($db, $object->severity_code, 'c_ticket_severity', 'code', 'label');
/*if ($user->admin && !$noadmininfo) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}*/
@@ -569,7 +569,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
// Display navbar with links to change ticket status
print '<!-- navbar with status -->';
if (!$user->societe_id && $user->rights->ticketsup->write && $object->fk_status < 8 && GETPOST('set') !== 'properties') {
if (!$user->societe_id && $user->rights->ticket->write && $object->fk_status < 8 && GETPOST('set') !== 'properties') {
$actionobject->viewStatusActions($object);
}
@@ -724,16 +724,16 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . $langs->trans('UnableToCreateInterIfNoSocid') . '">' . $langs->trans('TicketAddIntervention') . '</a></div>';
}
if ($object->fk_soc > 0 && $object->fk_statut < 8 && $user->rights->ficheinter->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . dol_buildpath('/fichinter/card.php', 1) . '?action=create&socid=' . $object->fk_soc . '&origin=ticketsup_ticketsup&originid=' . $object->id . '">' . $langs->trans('TicketAddIntervention') . '</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="' . dol_buildpath('/fichinter/card.php', 1) . '?action=create&socid=' . $object->fk_soc . '&origin=ticket_ticket&originid=' . $object->id . '">' . $langs->trans('TicketAddIntervention') . '</a></div>';
}
// Button to link to a contract
if ($user->rights->ticketsup->write && $object->fk_statut < 5 && $user->rights->contrat->creer) {
if ($user->rights->ticket->write && $object->fk_statut < 5 && $user->rights->contrat->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?track_id=' . $object->track_id . '&action=sel_contract">' . $langs->trans('LinkToAContract') . '</a></div>';
}
// Close ticket if statut is read
if ($object->fk_statut > 0 && $object->fk_statut < 8 && $user->rights->ticketsup->write) {
if ($object->fk_statut > 0 && $object->fk_statut < 8 && $user->rights->ticket->write) {
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?track_id=' . $object->track_id . '&action=close">' . $langs->trans('CloseTicket') . '</a></div>';
}
@@ -743,7 +743,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
}
// Delete ticket
if ($user->rights->ticketsup->delete && !$user->societe_id) {
if ($user->rights->ticket->delete && !$user->societe_id) {
print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?track_id=' . $object->track_id . '&action=delete">' . $langs->trans('Delete') . '</a></div>';
}
print '</div>';
@@ -753,7 +753,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
//print '<div style="float: left; width:49%; margin-right: 1%;">';
// Message list
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'messages@ticketsup');
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'messages@ticket');
$show_private_message = ($user->societe_id ? 0 : 1);
$actionobject->viewTicketTimelineMessages($show_private_message, true, $object);
@@ -762,10 +762,10 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
print '<br style="clear: both">';
} elseif ($action == 'add_message') {
$action='new_message';
$modelmail='ticketsup_send';
$modelmail='ticket_send';
print '<div>';
print load_fiche_titre($langs->trans('TicketAddMessage'), '', 'messages@ticketsup');
print load_fiche_titre($langs->trans('TicketAddMessage'), '', 'messages@ticket');
// Define output language
$outputlangs = $langs;
@@ -777,7 +777,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
$newlang = $object->default_lang;
}
$formticket = new FormTicketsup($db);
$formticket = new FormTicket($db);
$formticket->action = $action;
$formticket->track_id = $object->track_id;

View File

@@ -18,12 +18,12 @@
*/
/**
* \file ticketsup/class/actions_ticketsup.class.php
* \ingroup ticketsup
* \brief File Class ticketsup
* \file ticket/class/actions_ticket.class.php
* \ingroup ticket
* \brief File Class ticket
*/
require_once "ticketsup.class.php";
require_once "ticket.class.php";
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
@@ -31,9 +31,9 @@ require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
/**
* Class Actions of the module ticketsup
* Class Actions of the module ticket
*/
class ActionsTicketsup
class ActionsTicket
{
public $db;
public $dao;
@@ -71,7 +71,7 @@ class ActionsTicketsup
public function getInstanceDao()
{
if (!is_object($this->dao)) {
$this->dao = new Ticketsup($this->db);
$this->dao = new Ticket($this->db);
}
}
@@ -79,10 +79,10 @@ class ActionsTicketsup
* doActions
*
* @param string $action Action type
* @param Ticketsup $object Object Ticketsup
* @param Ticket $object Object Ticket
* @return int 0
*/
public function doActions(&$action = '', Ticketsup $object=null)
public function doActions(&$action = '', Ticket $object=null)
{
global $conf, $user, $langs, $mysoc;
@@ -100,7 +100,7 @@ class ActionsTicketsup
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
// Set tmp directory TODO Use a dedicated directory for temp mails files
$vardir = $conf->ticketsup->dir_output . (!empty($object->track_id) ? '/' . dol_sanitizeFileName($object->track_id) : '');
$vardir = $conf->ticket->dir_output . (!empty($object->track_id) ? '/' . dol_sanitizeFileName($object->track_id) : '');
$upload_dir_tmp = $vardir . '/temp';
if (!dol_is_dir($upload_dir_tmp)) {
dol_mkdir($upload_dir_tmp);
@@ -124,7 +124,7 @@ class ActionsTicketsup
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
// Set tmp directory
$vardir = $conf->ticketsup->dir_output . (!empty($object->track_id) ? '/' . dol_sanitizeFileName($object->track_id) : '');
$vardir = $conf->ticket->dir_output . (!empty($object->track_id) ? '/' . dol_sanitizeFileName($object->track_id) : '');
$upload_dir_tmp = $vardir . '/temp';
// TODO Delete only files that was uploaded from email form
@@ -133,7 +133,7 @@ class ActionsTicketsup
////}
}
if (GETPOST('add_ticket') && $user->rights->ticketsup->write) {
if (GETPOST('add_ticket') && $user->rights->ticket->write) {
$error = 0;
if (!GETPOST("subject")) {
@@ -257,7 +257,7 @@ class ActionsTicketsup
}
}
if ($action == 'edit' && $user->rights->ticketsup->write) {
if ($action == 'edit' && $user->rights->ticket->write) {
$error = 0;
if ($object->fetch(GETPOST('id')) < 0) {
@@ -267,7 +267,7 @@ class ActionsTicketsup
}
}
if (GETPOST('update') && GETPOST('id') && $user->rights->ticketsup->write) {
if (GETPOST('update') && GETPOST('id') && $user->rights->ticket->write) {
$error = 0;
$ret = $object->fetch(GETPOST('id'));
@@ -308,7 +308,7 @@ class ActionsTicketsup
}
}
if ($action == "mark_ticket_read" && $user->rights->ticketsup->write) {
if ($action == "mark_ticket_read" && $user->rights->ticket->write) {
$object->fetch('', '', GETPOST("track_id",'alpha'));
if ($object->markAsRead($user) > 0) {
@@ -328,7 +328,7 @@ class ActionsTicketsup
$action = 'view';
}
if ($action == "assign_user" && GETPOST('btn_assign_user','aplha') && $user->rights->ticketsup->write) {
if ($action == "assign_user" && GETPOST('btn_assign_user','aplha') && $user->rights->ticket->write) {
$object->fetch('', '', GETPOST("track_id",'alpha'));
$useroriginassign = $object->fk_user_assign;
$usertoassign = GETPOST('fk_user_assign','int');
@@ -383,7 +383,7 @@ class ActionsTicketsup
$action = 'view';
}
if ($action == "new_message" && GETPOST('btn_add_message') && $user->rights->ticketsup->read) {
if ($action == "new_message" && GETPOST('btn_add_message') && $user->rights->ticket->read) {
$ret = $this->newMessage($user, $action);
if ($ret) {
if (!empty($backtopage)) {
@@ -404,7 +404,7 @@ class ActionsTicketsup
$this->newMessagePublic($user, $action);
}
if ($action == "confirm_close" && GETPOST('confirm', 'alpha') == 'yes' && $user->rights->ticketsup->write) {
if ($action == "confirm_close" && GETPOST('confirm', 'alpha') == 'yes' && $user->rights->ticket->write) {
$this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha'));
if ($object->close()) {
// Log action in ticket logs table
@@ -442,11 +442,11 @@ class ActionsTicketsup
}
}
if ($action == 'confirm_delete_ticket' && GETPOST('confirm', 'alpha') == "yes" && $user->rights->ticketsup->delete) {
if ($action == 'confirm_delete_ticket' && GETPOST('confirm', 'alpha') == "yes" && $user->rights->ticket->delete) {
if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
if ($object->delete($user) > 0) {
setEventMessages('<div class="confirm">' . $langs->trans('TicketDeletedSuccess') . '</div>', null, 'mesgs');
Header("Location: ".DOL_URL_ROOT."/ticketsup/list.php");
Header("Location: ".DOL_URL_ROOT."/ticket/list.php");
exit;
} else {
$langs->load("errors");
@@ -466,7 +466,7 @@ class ActionsTicketsup
}
}
if ($action == 'set_progression' && $user->rights->ticketsup->write) {
if ($action == 'set_progression' && $user->rights->ticket->write) {
if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
$result = $object->setProgression(GETPOST('progress'));
// Log action in ticket logs table
@@ -499,7 +499,7 @@ class ActionsTicketsup
}
if ($action == 'confirm_reopen' && $user->rights->ticketsup->manage && !GETPOST('cancel')) {
if ($action == 'confirm_reopen' && $user->rights->ticket->manage && !GETPOST('cancel')) {
if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
// prevent browser refresh from reopening ticket several times
if ($object->fk_statut == 8) {
@@ -515,7 +515,7 @@ class ActionsTicketsup
}
}
} // Categorisation dans projet
elseif ($action == 'classin' && $user->rights->ticketsup->write) {
elseif ($action == 'classin' && $user->rights->ticket->write) {
if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
$object->setProject(GETPOST('projectid'));
$url = 'card.php?action=view&track_id=' . $object->track_id;
@@ -523,14 +523,14 @@ class ActionsTicketsup
exit();
}
} // Categorisation dans contrat
elseif ($action == 'setcontract' && $user->rights->ticketsup->write) {
elseif ($action == 'setcontract' && $user->rights->ticket->write) {
if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
$object->setContract(GETPOST('contractid'));
$url = 'card.php?action=view&track_id=' . $object->track_id;
header("Location: " . $url);
exit();
}
} elseif ($action == "set_message" && $user->rights->ticketsup->manage) {
} elseif ($action == "set_message" && $user->rights->ticket->manage) {
// altairis: manage cancel button
if (!GETPOST('cancel')) {
$this->fetch('', '', GETPOST('track_id','alpha'));
@@ -542,7 +542,7 @@ class ActionsTicketsup
if ($ret > 0) {
$log_action = $langs->trans('TicketInitialMessageModified') . " \n";
// include the Diff class
dol_include_once('/ticketsup/class/utils_diff.class.php');
dol_include_once('/ticket/class/utils_diff.class.php');
// output the result of comparing two files as plain text
$log_action .= Diff::toString(Diff::compare(strip_tags($oldvalue_message), strip_tags($object->message)));
@@ -555,7 +555,7 @@ class ActionsTicketsup
$action = 'view';
} // Reopen ticket
elseif ($action == 'confirm_set_status' && $user->rights->ticketsup->write && !GETPOST('cancel')) {
elseif ($action == 'confirm_set_status' && $user->rights->ticket->write && !GETPOST('cancel')) {
if ($this->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) {
$new_status = GETPOST('new_status', 'int');
$old_status = $object->fk_statut;
@@ -592,7 +592,7 @@ class ActionsTicketsup
$error = 0;
$object = new Ticketsup($this->db);
$object = new Ticket($this->db);
$ret = $object->fetch('', '', GETPOST('track_id','alpha'));
$object->socid = $object->fk_soc;
$object->fetch_thirdparty();
@@ -667,7 +667,7 @@ class ActionsTicketsup
}
$message .= "\n";
// URL ticket
$url_internal_ticket = dol_buildpath('/ticketsup/card.php', 2) . '?track_id=' . $object->track_id;
$url_internal_ticket = dol_buildpath('/ticket/card.php', 2) . '?track_id=' . $object->track_id;
// altairis: make html link on url
$message .= "\n" . $langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : ' . '<a href="' . $url_internal_ticket . '">' . $object->track_id . '</a>' . "\n";
@@ -734,9 +734,9 @@ class ActionsTicketsup
$url_public_ticket = (!empty($conf->global->TICKETS_ENABLE_PUBLIC_INTERFACE) ?
(!empty($conf->global->TICKETS_URL_PUBLIC_INTERFACE) ?
$conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/view.php' :
dol_buildpath('/public/ticketsup/view.php', 2)
dol_buildpath('/public/ticket/view.php', 2)
) :
dol_buildpath('/ticketsup/card.php', 2)
dol_buildpath('/ticket/card.php', 2)
) . '?track_id=' . $object->track_id;
$message .= "\n" . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : ' . '<a href="' . $url_public_ticket . '">' . $object->track_id . '</a>' . "\n";
@@ -862,7 +862,7 @@ class ActionsTicketsup
}
// URL ticket
$url_internal_ticket = dol_buildpath('/ticketsup/card.php', 2) . '?track_id=' . $object->track_id;
$url_internal_ticket = dol_buildpath('/ticket/card.php', 2) . '?track_id=' . $object->track_id;
$message .= "\n" . $langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : ' . $url_internal_ticket . "\n";
$message .= "\n\n";
@@ -903,7 +903,7 @@ class ActionsTicketsup
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient') . ' : ' . $recipient . "\n" : '');
}
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/view.php' : dol_buildpath('/public/ticketsup/view.php', 2)) . '?track_id=' . $object->track_id;
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/view.php' : dol_buildpath('/public/ticket/view.php', 2)) . '?track_id=' . $object->track_id;
$message .= "\n\n" . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : ' . $url_public_ticket . "\n";
// Add signature
@@ -1060,7 +1060,7 @@ class ActionsTicketsup
* View list of logs with timeline view
*
* @param boolean $show_user Show user who make action
* @param Ticketsup $object Object
* @param Ticket $object Object
*/
public function viewTimelineTicketLogs($show_user = true, $object = true)
{
@@ -1108,13 +1108,13 @@ class ActionsTicketsup
*
* @param User $user User wich display
* @param string $action Action mode
* @param TicketSup $object Object ticket
* @param Ticket $object Object ticket
* @return void
*/
public function viewTicketOriginalMessage($user, $action, $object)
{
global $langs;
if (!empty($user->rights->ticketsup->manage) && $action == 'edit_message_init') {
if (!empty($user->rights->ticket->manage) && $action == 'edit_message_init') {
// MESSAGE
print '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">';
@@ -1130,14 +1130,14 @@ class ActionsTicketsup
print '<tr class="liste_titre"><td class="nowrap titlefield">';
print $langs->trans("InitialMessage");
print '</td><td>';
if ($user->rights->ticketsup->manage) {
if ($user->rights->ticket->manage) {
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=edit_message_init&amp;track_id=' . $object->track_id . '">' . img_edit($langs->trans('Modify')) . '</a>';
}
print '</td></tr>';
print '<tr>';
print '<td colspan="2">';
if (!empty($user->rights->ticketsup->manage) && $action == 'edit_message_init') {
if (!empty($user->rights->ticket->manage) && $action == 'edit_message_init') {
// MESSAGE
$msg = GETPOST('message_initial', 'alpha') ? GETPOST('message_initial', 'alpha') : $object->message;
include_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
@@ -1157,7 +1157,7 @@ class ActionsTicketsup
print '</td>';
print '</tr>';
print '</table>';
if ($user->rights->ticketsup->manage && $action == 'edit_message_init') {
if ($user->rights->ticket->manage && $action == 'edit_message_init') {
print ' <input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
print ' <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '">';
print '</form>';
@@ -1240,9 +1240,9 @@ class ActionsTicketsup
*
* @param boolean $show_private Show private messages
* @param boolean $show_user Show user who make action
* @param Ticketsup $object Object ticketsup
* @param Ticket $object Object ticket
*/
public function viewTicketTimelineMessages($show_private, $show_user, Ticketsup $object)
public function viewTicketTimelineMessages($show_private, $show_user, Ticket $object)
{
global $conf, $langs, $user, $bc;
@@ -1318,7 +1318,7 @@ class ActionsTicketsup
global $conf, $langs;
if ($conf->global->TICKETS_DISABLE_ALL_MAILS) {
dol_syslog(get_class($this) . '::sendTicketMessageByEmail: Emails are disable into ticketsup setup by option TICKETSUP_DISABLE_ALL_MAILS', LOG_WARNING);
dol_syslog(get_class($this) . '::sendTicketMessageByEmail: Emails are disable into ticket setup by option TICKETSUP_DISABLE_ALL_MAILS', LOG_WARNING);
return '';
}
@@ -1415,7 +1415,7 @@ class ActionsTicketsup
$mimetype = $attachedfiles['mimes'];
// Copy files into ticket directory
$destdir = $conf->ticketsup->dir_output . '/' . $object->track_id;
$destdir = $conf->ticket->dir_output . '/' . $object->track_id;
if (!dol_is_dir($destdir)) {
dol_mkdir($destdir);
@@ -1437,10 +1437,10 @@ class ActionsTicketsup
/**
* Print html navbar with link to set ticket status
*
* @param Ticketsup $object Ticket sup
* @param Ticket $object Ticket sup
* @return void
*/
public function viewStatusActions(Ticketsup $object)
public function viewStatusActions(Ticket $object)
{
global $langs;
@@ -1451,7 +1451,7 @@ class ActionsTicketsup
print '<strong>' . $langs->trans('TicketChangeStatus') . '</strong>';
print '</div>';
// Exclude status which requires specific method
$exclude_status = array(Ticketsup::STATUS_CLOSED, Ticketsup::STATUS_CANCELED);
$exclude_status = array(Ticket::STATUS_CLOSED, Ticket::STATUS_CANCELED);
// Exclude actual status
$exclude_status = array_merge($exclude_status, array(intval($object->fk_statut)));
@@ -1469,7 +1469,7 @@ class ActionsTicketsup
$urlforbutton = $_SERVER['PHP_SELF'] . '?track_id=' . $object->track_id . '&action=set_status&new_status=' . $status;
print '<a class="button" href="' . $urlforbutton . '">';
print img_picto($langs->trans($object->statuts_short[$status]), 'statut' . $status . '.png@ticketsup') . ' ' . $langs->trans($object->statuts_short[$status]);
print img_picto($langs->trans($object->statuts_short[$status]), 'statut' . $status . '.png@ticket') . ' ' . $langs->trans($object->statuts_short[$status]);
print '</a>';
print '</div>';
}
@@ -1492,7 +1492,7 @@ class ActionsTicketsup
* Hook to add email element template
*
* @param array $parameters Parameters
* @param Ticketsup $object Object for action
* @param Ticket $object Object for action
* @param string $action Action string
* @param HookManager $hookmanager Hookmanager object
* @return int
@@ -1504,7 +1504,7 @@ class ActionsTicketsup
$error = 0;
if (in_array('admin', explode(':', $parameters['context']))) {
$this->results = array('ticketsup_send' => $langs->trans('MailToSendTicketsupMessage'));
$this->results = array('ticket_send' => $langs->trans('MailToSendTicketMessage'));
}
if (! $error) {

View File

@@ -17,12 +17,12 @@
use Luracast\Restler\RestException;
require 'ticketsup.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/ticketsup.lib.php';
require 'ticket.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
/**
* API class for ticketsup object
* API class for ticket object
*
* @access protected
* @class DolibarrApiAccess {@requires user,external}
@@ -46,9 +46,9 @@ class Tickets extends DolibarrApi
);
/**
* @var Ticketsup $ticketsup {@type Ticketsup}
* @var Ticket $ticket {@type Ticket}
*/
public $ticketsup;
public $ticket;
/**
* Constructor
@@ -57,7 +57,7 @@ class Tickets extends DolibarrApi
{
global $db;
$this->db = $db;
$this->ticketsup = new Ticketsup($this->db);
$this->ticket = new Ticket($this->db);
}
/**
@@ -65,7 +65,7 @@ class Tickets extends DolibarrApi
*
* Return an array with ticket informations
*
* @param int $id ID of ticketsup
* @param int $id ID of ticket
* @return array|mixed Data without useless information
*
* @throws 401
@@ -126,7 +126,7 @@ class Tickets extends DolibarrApi
*
* Return an array with ticket informations
*
* @param int $id ID of ticketsup
* @param int $id ID of ticket
* @param string $track_id Tracking ID of ticket
* @param string $ref Reference for ticket
* @return array|mixed Data without useless information
@@ -137,7 +137,7 @@ class Tickets extends DolibarrApi
*/
public function getCommon($id = 0, $track_id = '', $ref = '')
{
if (! DolibarrApiAccess::$user->rights->ticketsup->read) {
if (! DolibarrApiAccess::$user->rights->ticket->read) {
throw new RestException(403);
}
@@ -146,81 +146,81 @@ class Tickets extends DolibarrApi
throw new RestException(401, 'Wrong parameters');
}
$result = $this->ticketsup->fetch($id, $ref, $track_id);
$result = $this->ticket->fetch($id, $ref, $track_id);
if (! $result) {
throw new RestException(404, 'Ticketsup not found');
throw new RestException(404, 'Ticket not found');
}
// String for user assigned
if ($this->ticketsup->fk_user_assign > 0) {
if ($this->ticket->fk_user_assign > 0) {
$userStatic = new User($this->db);
$userStatic->fetch($this->ticketsup->fk_user_assign);
$this->ticketsup->fk_user_assign_string = $userStatic->firstname.' '.$userStatic->lastname;
$userStatic->fetch($this->ticket->fk_user_assign);
$this->ticket->fk_user_assign_string = $userStatic->firstname.' '.$userStatic->lastname;
}
// Messages of ticket
$messages = array();
$this->ticketsup->loadCacheMsgsTicket();
if (is_array($this->ticketsup->cache_msgs_ticket) && count($this->ticketsup->cache_msgs_ticket) > 0) {
$num = count($this->ticketsup->cache_msgs_ticket);
$this->ticket->loadCacheMsgsTicket();
if (is_array($this->ticket->cache_msgs_ticket) && count($this->ticket->cache_msgs_ticket) > 0) {
$num = count($this->ticket->cache_msgs_ticket);
$i = 0;
while ($i < $num) {
if ($this->ticketsup->cache_msgs_ticket[$i]['fk_user_action'] > 0) {
if ($this->ticket->cache_msgs_ticket[$i]['fk_user_action'] > 0) {
$user_action = new User($this->db);
$user_action->fetch($this->ticketsup->cache_msgs_ticket[$i]['fk_user_action']);
$user_action->fetch($this->ticket->cache_msgs_ticket[$i]['fk_user_action']);
}
// Now define messages
$messages[] = array(
'id' => $this->ticketsup->cache_msgs_ticket[$i]['id'],
'fk_user_action' => $this->ticketsup->cache_msgs_ticket[$i]['fk_user_action'],
'id' => $this->ticket->cache_msgs_ticket[$i]['id'],
'fk_user_action' => $this->ticket->cache_msgs_ticket[$i]['fk_user_action'],
'fk_user_action_socid' => $user_action->socid,
'fk_user_action_string' => dolGetFirstLastname($user_action->firstname, $user_action->lastname),
'message' => $this->ticketsup->cache_msgs_ticket[$i]['message'],
'datec' => $this->ticketsup->cache_msgs_ticket[$i]['datec'],
'private' => $this->ticketsup->cache_msgs_ticket[$i]['private']
'message' => $this->ticket->cache_msgs_ticket[$i]['message'],
'datec' => $this->ticket->cache_msgs_ticket[$i]['datec'],
'private' => $this->ticket->cache_msgs_ticket[$i]['private']
);
$i++;
}
$this->ticketsup->messages = $messages;
$this->ticket->messages = $messages;
}
// History
$history = array();
$this->ticketsup->loadCacheLogsTicket();
if (is_array($this->ticketsup->cache_logs_ticket) && count($this->ticketsup->cache_logs_ticket) > 0) {
$num = count($this->ticketsup->cache_logs_ticket);
$this->ticket->loadCacheLogsTicket();
if (is_array($this->ticket->cache_logs_ticket) && count($this->ticket->cache_logs_ticket) > 0) {
$num = count($this->ticket->cache_logs_ticket);
$i = 0;
while ($i < $num) {
if ($this->ticketsup->cache_logs_ticket[$i]['fk_user_create'] > 0) {
if ($this->ticket->cache_logs_ticket[$i]['fk_user_create'] > 0) {
$user_action = new User($this->db);
$user_action->fetch($this->ticketsup->cache_logs_ticket[$i]['fk_user_create']);
$user_action->fetch($this->ticket->cache_logs_ticket[$i]['fk_user_create']);
}
// Now define messages
$history[] = array(
'id' => $this->ticketsup->cache_logs_ticket[$i]['id'],
'fk_user_action' => $this->ticketsup->cache_logs_ticket[$i]['fk_user_create'],
'id' => $this->ticket->cache_logs_ticket[$i]['id'],
'fk_user_action' => $this->ticket->cache_logs_ticket[$i]['fk_user_create'],
'fk_user_action_string' => dolGetFirstLastname($user_action->firstname, $user_action->lastname),
'message' => $this->ticketsup->cache_logs_ticket[$i]['message'],
'datec' => $this->ticketsup->cache_logs_ticket[$i]['datec'],
'message' => $this->ticket->cache_logs_ticket[$i]['message'],
'datec' => $this->ticket->cache_logs_ticket[$i]['datec'],
);
$i++;
}
$this->ticketsup->history = $history;
$this->ticket->history = $history;
}
if (! DolibarrApi::_checkAccessToResource('ticketsup', $this->ticketsup->id)) {
if (! DolibarrApi::_checkAccessToResource('ticket', $this->ticket->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
return $this->_cleanObjectDatas($this->ticketsup);
return $this->_cleanObjectDatas($this->ticket);
}
/**
* List ticketsups
* List tickets
*
* Get a list of ticketsups
* Get a list of tickets
*
* @param int $socid Filter list with thirdparty ID
* @param string $mode Use this param to filter list
@@ -230,7 +230,7 @@ class Tickets extends DolibarrApi
* @param int $page Page number
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
*
* @return array Array of ticketsup objects
* @return array Array of ticket objects
*
*/
public function index($socid = 0, $mode = "", $sortfield = "s.rowid", $sortorder = "ASC", $limit = 0, $page = 0, $sqlfilters = '')
@@ -252,13 +252,13 @@ class Tickets extends DolibarrApi
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) {
$sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
}
$sql.= " FROM ".MAIN_DB_PREFIX."ticketsup as s";
$sql.= " FROM ".MAIN_DB_PREFIX."ticket as s";
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) {
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
}
$sql.= ' WHERE s.entity IN ('.getEntity('ticketsup', 1).')';
$sql.= ' WHERE s.entity IN ('.getEntity('ticket', 1).')';
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) {
$sql.= " AND s.fk_soc = sc.fk_soc";
}
@@ -324,116 +324,116 @@ class Tickets extends DolibarrApi
$num = $db->num_rows($result);
while ($i < $num) {
$obj = $db->fetch_object($result);
$ticketsup_static = new Ticketsup($db);
if ($ticketsup_static->fetch($obj->rowid)) {
if ($ticketsup_static->fk_user_assign > 0) {
$ticket_static = new Ticket($db);
if ($ticket_static->fetch($obj->rowid)) {
if ($ticket_static->fk_user_assign > 0) {
$userStatic = new User($this->db);
$userStatic->fetch($ticketsup_static->fk_user_assign);
$ticketsup_static->fk_user_assign_string = $userStatic->firstname.' '.$userStatic->lastname;
$userStatic->fetch($ticket_static->fk_user_assign);
$ticket_static->fk_user_assign_string = $userStatic->firstname.' '.$userStatic->lastname;
}
$obj_ret[] = $this->_cleanObjectDatas($ticketsup_static);
$obj_ret[] = $this->_cleanObjectDatas($ticket_static);
}
$i++;
}
} else {
throw new RestException(503, 'Error when retrieve ticketsup list');
throw new RestException(503, 'Error when retrieve ticket list');
}
if (! count($obj_ret)) {
throw new RestException(404, 'No ticketsup found');
throw new RestException(404, 'No ticket found');
}
return $obj_ret;
}
/**
* Create ticketsup object
* Create ticket object
*
* @param array $request_data Request datas
* @return int ID of ticketsup
* @return int ID of ticket
*
*/
public function post($request_data = null)
{
$ticketstatic = new Ticketsup($this->db);
if (! DolibarrApiAccess::$user->rights->ticketsup->write) {
$ticketstatic = new Ticket($this->db);
if (! DolibarrApiAccess::$user->rights->ticket->write) {
throw new RestException(401);
}
// Check mandatory fields
$result = $this->_validate($request_data);
foreach ($request_data as $field => $value) {
$this->ticketsup->$field = $value;
$this->ticket->$field = $value;
}
if (empty($this->ticketsup->ref)) {
$this->ticketsup->ref = $ticketstatic->getDefaultRef();
if (empty($this->ticket->ref)) {
$this->ticket->ref = $ticketstatic->getDefaultRef();
}
if (empty($this->ticketsup->track_id)) {
$this->ticketsup->track_id = generate_random_id(16);
if (empty($this->ticket->track_id)) {
$this->ticket->track_id = generate_random_id(16);
}
if (! $this->ticketsup->create(DolibarrApiAccess::$user)) {
if (! $this->ticket->create(DolibarrApiAccess::$user)) {
throw new RestException(500);
}
return $this->ticketsup->id;
return $this->ticket->id;
}
/**
* Create ticketsup object
* Create ticket object
*
* @param array $request_data Request datas
* @return int ID of ticketsup
* @return int ID of ticket
*
*/
public function postNewMessage($request_data = null)
{
$ticketstatic = new Ticketsup($this->db);
if (! DolibarrApiAccess::$user->rights->ticketsup->write) {
$ticketstatic = new Ticket($this->db);
if (! DolibarrApiAccess::$user->rights->ticket->write) {
throw new RestException(401);
}
// Check mandatory fields
$result = $this->_validateMessage($request_data);
foreach ($request_data as $field => $value) {
$this->ticketsup->$field = $value;
$this->ticket->$field = $value;
}
$ticketMessageText = $this->ticketsup->message;
$result = $this->ticketsup->fetch('', '', $this->ticketsup->track_id);
$ticketMessageText = $this->ticket->message;
$result = $this->ticket->fetch('', '', $this->ticket->track_id);
if (! $result) {
throw new RestException(404, 'Ticketsup not found');
throw new RestException(404, 'Ticket not found');
}
$this->ticketsup->message = $ticketMessageText;
if (! $this->ticketsup->createTicketMessage(DolibarrApiAccess::$user)) {
$this->ticket->message = $ticketMessageText;
if (! $this->ticket->createTicketMessage(DolibarrApiAccess::$user)) {
throw new RestException(500);
}
return $this->ticketsup->id;
return $this->ticket->id;
}
/**
* Update ticketsup
* Update ticket
*
* @param int $id Id of ticketsup to update
* @param int $id Id of ticket to update
* @param array $request_data Datas
* @return int
*
*/
public function put($id, $request_data = null)
{
if (! DolibarrApiAccess::$user->rights->ticketsup->write) {
if (! DolibarrApiAccess::$user->rights->ticket->write) {
throw new RestException(401);
}
$result = $this->ticketsup->fetch($id);
$result = $this->ticket->fetch($id);
if (! $result) {
throw new RestException(404, 'Ticketsup not found');
throw new RestException(404, 'Ticket not found');
}
if (! DolibarrApi::_checkAccessToResource('ticketsup', $this->ticketsup->id)) {
if (! DolibarrApi::_checkAccessToResource('ticket', $this->ticket->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
foreach ($request_data as $field => $value) {
$this->ticketsup->$field = $value;
$this->ticket->$field = $value;
}
if ($this->ticketsup->update($id, DolibarrApiAccess::$user)) {
if ($this->ticket->update($id, DolibarrApiAccess::$user)) {
return $this->get($id);
}
@@ -441,34 +441,34 @@ class Tickets extends DolibarrApi
}
/**
* Delete ticketsup
* Delete ticket
*
* @param int $id Ticketsup ID
* @param int $id Ticket ID
* @return array
*
*/
public function delete($id)
{
if (! DolibarrApiAccess::$user->rights->ticketsup->delete) {
if (! DolibarrApiAccess::$user->rights->ticket->delete) {
throw new RestException(401);
}
$result = $this->ticketsup->fetch($id);
$result = $this->ticket->fetch($id);
if (! $result) {
throw new RestException(404, 'Ticketsup not found');
throw new RestException(404, 'Ticket not found');
}
if (! DolibarrApi::_checkAccessToResource('ticketsup', $this->ticketsup->id)) {
if (! DolibarrApi::_checkAccessToResource('ticket', $this->ticket->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if (!$this->ticketsup->delete($id)) {
if (!$this->ticket->delete($id)) {
throw new RestException(500);
}
return array(
'success' => array(
'code' => 200,
'message' => 'Ticketsup deleted'
'message' => 'Ticket deleted'
)
);
}
@@ -493,7 +493,7 @@ class Tickets extends DolibarrApi
$list = array();
$sql = "SELECT rowid, code, pos, label, use_default, description";
$sql.= " FROM ".MAIN_DB_PREFIX."c_ticketsup_category as t";
$sql.= " FROM ".MAIN_DB_PREFIX."c_ticket_category as t";
$sql.= " WHERE t.active = 1";
// Add sql filters
if ($sqlfilters)
@@ -527,7 +527,7 @@ class Tickets extends DolibarrApi
$list[] = $this->db->fetch_object($result);
}
} else {
throw new RestException(503, 'Error when retrieving list of ticketsup categories : '.$this->db->lasterror());
throw new RestException(503, 'Error when retrieving list of ticket categories : '.$this->db->lasterror());
}
return $list;
@@ -552,7 +552,7 @@ class Tickets extends DolibarrApi
$list = array();
$sql = "SELECT rowid, code, pos, label, use_default, color, description";
$sql.= " FROM ".MAIN_DB_PREFIX."c_ticketsup_severity as t";
$sql.= " FROM ".MAIN_DB_PREFIX."c_ticket_severity as t";
$sql.= " WHERE t.active = 1";
// Add sql filters
if ($sqlfilters)
@@ -586,7 +586,7 @@ class Tickets extends DolibarrApi
$list[] = $this->db->fetch_object($result);
}
} else {
throw new RestException(503, 'Error when retrieving list of ticketsup severities : '.$this->db->lasterror());
throw new RestException(503, 'Error when retrieving list of ticket severities : '.$this->db->lasterror());
}
return $list;
@@ -611,7 +611,7 @@ class Tickets extends DolibarrApi
$list = array();
$sql = "SELECT rowid, code, pos, label, use_default, description";
$sql.= " FROM ".MAIN_DB_PREFIX."c_ticketsup_type as t";
$sql.= " FROM ".MAIN_DB_PREFIX."c_ticket_type as t";
$sql.= " WHERE t.active = 1";
if ($type) $sql.=" AND t.type LIKE '%" . $this->db->escape($type) . "%'";
if ($module) $sql.=" AND t.module LIKE '%" . $this->db->escape($module) . "%'";
@@ -647,7 +647,7 @@ class Tickets extends DolibarrApi
$list[] = $this->db->fetch_object($result);
}
} else {
throw new RestException(503, 'Error when retrieving list of ticketsup types : '.$this->db->lasterror());
throw new RestException(503, 'Error when retrieving list of ticket types : '.$this->db->lasterror());
}
return $list;
@@ -667,14 +667,14 @@ class Tickets extends DolibarrApi
*/
private function _validate($data)
{
$ticketsup = array();
foreach (Ticketsups::$FIELDS as $field) {
$ticket = array();
foreach (Tickets::$FIELDS as $field) {
if (!isset($data[$field])) {
throw new RestException(400, "$field field missing");
}
$ticketsup[$field] = $data[$field];
$ticket[$field] = $data[$field];
}
return $ticketsup;
return $ticket;
}
/**
@@ -687,14 +687,14 @@ class Tickets extends DolibarrApi
*/
private function _validateMessage($data)
{
$ticketsup = array();
foreach (Ticketsups::$FIELDS_MESSAGES as $field) {
$ticket = array();
foreach (Tickets::$FIELDS_MESSAGES as $field) {
if (!isset($data[$field])) {
throw new RestException(400, "$field field missing");
}
$ticketsup[$field] = $data[$field];
$ticket[$field] = $data[$field];
}
return $ticketsup;
return $ticket;
}

View File

@@ -17,9 +17,9 @@
*/
/**
* \file ticketsup/class/ticketsup.class.php
* \ingroup ticketsup
* \brief Class file for object ticketsup
* \file ticket/class/ticket.class.php
* \ingroup ticket
* \brief Class file for object ticket
*/
// Put here all includes required by your class file
@@ -32,32 +32,32 @@ require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
/**
* Class to manage ticket
*/
class Ticketsup extends CommonObject
class Ticket extends CommonObject
{
/**
* @var string ID to identify managed object
*/
public $element = 'ticketsup';
public $element = 'ticket';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'ticketsup';
public $table_element = 'ticket';
/**
* @var string Name of field for link to tickets
*/
public $fk_element='fk_ticket';
/**
* @var int Does ticketsupcore support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int Does ticketcore support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
public $ismultientitymanaged = 0;
/**
* @var int Does ticketsupcore support extrafields ? 0=No, 1=Yes
* @var int Does ticketcore support extrafields ? 0=No, 1=Yes
*/
public $isextrafieldmanaged = 1;
/**
* @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 ticketcore. Must be the part after the 'object_' into object_ticketcore.png
*/
public $picto = 'ticketsup';
public $picto = 'ticket';
/**
@@ -331,7 +331,7 @@ class Ticketsup extends CommonObject
$result = $this->verify();
if ($result >= 0) {
// Insert request
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "ticketsup(";
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "ticket(";
$sql .= "ref,";
$sql .= "track_id,";
$sql .= "fk_soc,";
@@ -387,7 +387,7 @@ class Ticketsup extends CommonObject
}
if (!$error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "ticketsup");
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "ticket");
if (!$notrigger) {
// Call trigger
@@ -470,10 +470,10 @@ class Ticketsup extends CommonObject
$sql .= " t.date_close,";
$sql .= " t.tms";
$sql .= ", type.code as type_code, type.label as type_label, category.code as category_code, category.label as category_label, severity.code as severity_code, severity.label as severity_label";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticketsup as t";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_type as type ON type.code=t.type_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_category as category ON category.code=t.category_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_severity as severity ON severity.code=t.severity_code";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_type as type ON type.code=t.type_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_category as category ON category.code=t.category_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_severity as severity ON severity.code=t.severity_code";
if ($id) {
$sql .= " WHERE t.rowid = " . $this->db->escape($id);
@@ -594,21 +594,21 @@ class Ticketsup extends CommonObject
foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
$sql .= ($extrafields->attributes[$this->table_element]['type'][$key] != 'separate' ? ",ef." . $key . ' as options_' . $key : '');
}
$sql .= " FROM " . MAIN_DB_PREFIX . "ticketsup as t";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_type as type ON type.code=t.type_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_category as category ON category.code=t.category_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_severity as severity ON severity.code=t.severity_code";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_type as type ON type.code=t.type_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_category as category ON category.code=t.category_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_severity as severity ON severity.code=t.severity_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid=t.fk_soc";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as uc ON uc.rowid=t.fk_user_create";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as ua ON ua.rowid=t.fk_user_assign";
if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label'])) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "ticketsup_extrafields as ef on (t.rowid = ef.fk_object)";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "ticket_extrafields as ef on (t.rowid = ef.fk_object)";
}
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
}
$sql .= " WHERE t.entity IN (" . getEntity('ticketsup') . ")";
$sql .= " WHERE t.entity IN (" . getEntity('ticket') . ")";
// Manage filter
if (!empty($filter)) {
@@ -795,7 +795,7 @@ class Ticketsup extends CommonObject
// Check parameters
// Put here code to add a control on parameters values
// Update request
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticketsup SET";
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticket SET";
$sql .= " ref=" . (isset($this->ref) ? "'" . $this->db->escape($this->ref) . "'" : "") . ",";
$sql .= " track_id=" . (isset($this->track_id) ? "'" . $this->db->escape($this->track_id) . "'" : "null") . ",";
$sql .= " fk_soc=" . (isset($this->fk_soc) ? "'" . $this->db->escape($this->fk_soc) . "'" : "null") . ",";
@@ -899,12 +899,12 @@ class Ticketsup extends CommonObject
}
if (!$error) {
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "ticketsup_logs";
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "ticket_logs";
$sql .= " WHERE fk_track_id = '" . $this->db->escape($this->track_id) . "'";
$resql = $this->db->query($sql);
}
if (!$error) {
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "ticketsup_msg";
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "ticket_msg";
$sql .= " WHERE fk_track_id = '" . $this->db->escape($this->track_id) . "'";
$resql = $this->db->query($sql);
}
@@ -919,7 +919,7 @@ class Ticketsup extends CommonObject
}
if (!$error) {
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "ticketsup";
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "ticket";
$sql .= " WHERE rowid=" . $this->id;
dol_syslog(get_class($this) . "::delete sql=" . $sql);
@@ -956,7 +956,7 @@ class Ticketsup extends CommonObject
$error = 0;
$object = new Ticketsup($this->db);
$object = new Ticket($this->db);
$this->db->begin();
@@ -1040,7 +1040,7 @@ class Ticketsup extends CommonObject
// Cache deja charge
$sql = "SELECT rowid, code, label, use_default, pos, description";
$sql .= " FROM " . MAIN_DB_PREFIX . "c_ticketsup_type";
$sql .= " FROM " . MAIN_DB_PREFIX . "c_ticket_type";
$sql .= " WHERE active > 0";
$sql .= " ORDER BY pos";
dol_syslog(get_class($this) . "::load_cache_type_tickets sql=" . $sql, LOG_DEBUG);
@@ -1080,7 +1080,7 @@ class Ticketsup extends CommonObject
// Cache deja charge
$sql = "SELECT rowid, code, label, use_default, pos, description";
$sql .= " FROM " . MAIN_DB_PREFIX . "c_ticketsup_category";
$sql .= " FROM " . MAIN_DB_PREFIX . "c_ticket_category";
$sql .= " WHERE active > 0";
$sql .= " ORDER BY pos";
dol_syslog(get_class($this) . "::load_cache_categories_tickets sql=" . $sql, LOG_DEBUG);
@@ -1120,7 +1120,7 @@ class Ticketsup extends CommonObject
// Cache deja charge
$sql = "SELECT rowid, code, label, use_default, pos, description";
$sql .= " FROM " . MAIN_DB_PREFIX . "c_ticketsup_severity";
$sql .= " FROM " . MAIN_DB_PREFIX . "c_ticket_severity";
$sql .= " WHERE active > 0";
$sql .= " ORDER BY pos";
dol_syslog(get_class($this) . "::loadCacheSeveritiesTickets sql=" . $sql, LOG_DEBUG);
@@ -1178,134 +1178,134 @@ class Ticketsup extends CommonObject
}
if ($mode == 2) {
if ($statut == 0) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($statut == 1) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($statut == 3) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($statut == 4) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($statut == 5) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($statut == 6) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($statut == 8) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($statut == 9) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
}
if ($mode == 3) {
if ($statut == 0) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticketsup');
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket');
}
if ($statut == 1) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticketsup');
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket');
}
if ($statut == 3) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticketsup');
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket');
}
if ($statut == 4) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticketsup');
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket');
}
if ($statut == 5) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticketsup');
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket');
}
if ($statut == 6) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticketsup');
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket');
}
if ($statut == 8) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticketsup');
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket');
}
if ($statut == 9) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticketsup');
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket');
}
}
if ($mode == 4) {
if ($statut == 0) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($statut == 1) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($statut == 3) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($statut == 4) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($statut == 5) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($statut == 6) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($statut == 8) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($statut == 9) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticketsup') . ' ' . $langs->trans($this->statuts_short[$statut]);
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
}
if ($mode == 5) {
if ($statut == 0) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticketsup');
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket');
}
if ($statut == 1) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticketsup');
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket');
}
if ($statut == 3) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticketsup');
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket');
}
if ($statut == 4) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticketsup');
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket');
}
if ($statut == 5) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticketsup');
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket');
}
if ($statut == 6) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticketsup');
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket');
}
if ($statut == 8) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticketsup');
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket');
}
if ($statut == 9) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticketsup');
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket');
}
}
}
@@ -1338,7 +1338,7 @@ class Ticketsup extends CommonObject
$label.= '<b>' . $langs->trans('TicketTrackId') . ':</b> ' . $this->track_id.'<br>';
$label.= '<b>' . $langs->trans('Subject') . ':</b> ' . $this->subject;
$url = dol_buildpath('/ticketsup/card.php',1).'?id='.$this->id;
$url = dol_buildpath('/ticket/card.php',1).'?id='.$this->id;
if ($option != 'nolink')
{
@@ -1389,7 +1389,7 @@ class Ticketsup extends CommonObject
if ($this->statut != 9) { // no closed
$this->db->begin();
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticketsup";
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticket";
$sql .= " SET fk_statut = 1, date_read='" . $this->db->idate(dol_now()) . "'";
$sql .= " WHERE rowid = " . $this->id;
@@ -1438,7 +1438,7 @@ class Ticketsup extends CommonObject
$this->db->begin();
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticketsup";
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticket";
if ($id_assign_user > 0)
{
$sql .= " SET fk_user_assign=".$id_assign_user.", fk_statut=4";
@@ -1508,7 +1508,7 @@ class Ticketsup extends CommonObject
}
// Insert request
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "ticketsup_logs(";
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "ticket_logs(";
$sql .= "entity,";
$sql .= "datec,";
$sql .= "fk_track_id,";
@@ -1554,7 +1554,7 @@ class Ticketsup extends CommonObject
$nb_sent = 0;
$langs->load('ticketsup');
$langs->load('ticket');
// Retrieve email of all contacts (internal and external)
$contacts = $this->listeContact(-1, 'internal');
@@ -1588,10 +1588,10 @@ class Ticketsup extends CommonObject
$message .= dol_html_entity_decode($log_message, ENT_QUOTES) . "\n";
if ($info_sendto['source'] == 'internal') {
$url_internal_ticket = dol_buildpath('/ticketsup/card.php', 2) . '?track_id=' . $this->track_id;
$url_internal_ticket = dol_buildpath('/ticket/card.php', 2) . '?track_id=' . $this->track_id;
$message .= "\n" . $langs->transnoentities('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : ' . '<a href="' . $url_internal_ticket . '">' . $this->track_id . '</a>' . "\n";
} else {
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/public/ticketsup/view.php', 2)) . '?track_id=' . $this->track_id;
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/public/ticket/view.php', 2)) . '?track_id=' . $this->track_id;
$message .= "\n" . $langs->transnoentities('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : ' . '<a href="' . $url_public_ticket . '">' . $this->track_id . '</a>' . "\n";
}
@@ -1648,7 +1648,7 @@ class Ticketsup extends CommonObject
// Cache deja charge
$sql = "SELECT rowid, fk_user_create, datec, message";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticketsup_logs";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket_logs";
$sql .= " WHERE fk_track_id ='" . $this->db->escape($this->track_id) . "'";
$sql .= " ORDER BY datec DESC";
@@ -1694,7 +1694,7 @@ class Ticketsup extends CommonObject
}
// Insert request
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "ticketsup_msg(";
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "ticket_msg(";
$sql .= "fk_track_id,";
$sql .= "fk_user_action,";
@@ -1760,7 +1760,7 @@ class Ticketsup extends CommonObject
// Cache deja charge
$sql = "SELECT rowid, fk_user_action, datec, message, private";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticketsup_msg";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket_msg";
$sql .= " WHERE fk_track_id ='" . $this->db->escape($this->track_id) . "'";
$sql .= " ORDER BY datec DESC";
dol_syslog(get_class($this) . "::load_cache_actions_ticket sql=" . $sql, LOG_DEBUG);
@@ -1798,7 +1798,7 @@ class Ticketsup extends CommonObject
if ($this->fk_statut != 9) { // not closed
$this->db->begin();
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticketsup";
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticket";
$sql .= " SET fk_statut=8, progress=100, date_close='" . $this->db->idate(dol_now()) . "'";
$sql .= " WHERE rowid = " . $this->id;
@@ -1871,7 +1871,7 @@ class Ticketsup extends CommonObject
// Generation requete recherche
$sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "societe";
$sql .= " WHERE entity IN (" . getEntity('ticketsup', 1) . ")";
$sql .= " WHERE entity IN (" . getEntity('ticket', 1) . ")";
if (!empty($type)) {
if ($type == 1 || $type == 2) {
$sql .= " AND client = " . $type;
@@ -1978,7 +1978,7 @@ class Ticketsup extends CommonObject
public function setCustomer($id)
{
if ($this->id) {
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticketsup";
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticket";
$sql .= " SET fk_soc = " . ($id > 0 ? $id : "null");
$sql .= " WHERE rowid = " . $this->id;
dol_syslog(get_class($this) . '::setCustomer sql=' . $sql);
@@ -2002,7 +2002,7 @@ class Ticketsup extends CommonObject
public function setProgression($percent)
{
if ($this->id) {
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticketsup";
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticket";
$sql .= " SET progress = " . ($percent > 0 ? $percent : "null");
$sql .= " WHERE rowid = " . $this->id;
dol_syslog(get_class($this) . '::set_progression sql=' . $sql);
@@ -2405,7 +2405,7 @@ class Ticketsup extends CommonObject
global $conf;
$defaultref = '';
$modele = empty($conf->global->TICKETSUP_ADDON) ? 'mod_ticketsup_simple' : $conf->global->TICKETSUP_ADDON;
$modele = empty($conf->global->TICKETSUP_ADDON) ? 'mod_ticket_simple' : $conf->global->TICKETSUP_ADDON;
// Search template files
$file = '';
@@ -2413,7 +2413,7 @@ class Ticketsup extends CommonObject
$filefound = 0;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir . "core/modules/ticketsup/" . $modele . '.php', 0);
$file = dol_buildpath($reldir . "core/modules/ticket/" . $modele . '.php', 0);
if (file_exists($file)) {
$filefound = 1;
$classname = $modele;
@@ -2422,10 +2422,10 @@ class Ticketsup extends CommonObject
}
if ($filefound) {
$result = dol_include_once($reldir . "core/modules/ticketsup/" . $modele . '.php');
$modTicketsup = new $classname;
$result = dol_include_once($reldir . "core/modules/ticket/" . $modele . '.php');
$modTicket = new $classname;
$defaultref = $modTicketsup->getNextValue($thirdparty, $this);
$defaultref = $modTicket->getNextValue($thirdparty, $this);
}
if (is_numeric($defaultref) && $defaultref <= 0) {

View File

@@ -16,8 +16,8 @@
*/
/**
* \file ticketsup/class/ticketsuplogs.class.php
* \ingroup ticketsup
* \file ticket/class/ticketlogs.class.php
* \ingroup ticket
* \brief This file CRUD class file (Create/Read/Update/Delete) for ticket logs
*/
@@ -28,15 +28,15 @@ require_once DOL_DOCUMENT_ROOT . "/core/class/commonobject.class.php";
/**
* Class of log for ticketsup
* Class of log for ticket
*/
class Ticketsuplogs// extends CommonObject
class Ticketlogs// extends CommonObject
{
public $db; //!< To store db handler
public $error; //!< To return error code (or message)
public $errors = array(); //!< To return several error codes (or messages)
public $element = 'ticketsuplogs'; //!< Id that identify managed objects
public $table_element = 'ticketsuplogs'; //!< Name of table without prefix where object is stored
public $element = 'ticketlogs'; //!< Id that identify managed objects
public $table_element = 'ticketlogs'; //!< Name of table without prefix where object is stored
public $id;
@@ -86,7 +86,7 @@ class Ticketsuplogs// extends CommonObject
// Put here code to add control on parameters values
// Insert request
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "ticketsup_logs(";
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "ticket_logs(";
$sql .= "fk_track_id,";
$sql .= "fk_user_create,";
@@ -112,7 +112,7 @@ class Ticketsuplogs// extends CommonObject
}
if (!$error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "ticketsup_logs");
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "ticket_logs");
if (!$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
@@ -158,7 +158,7 @@ class Ticketsuplogs// extends CommonObject
$sql .= " t.datec,";
$sql .= " t.message";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticketsup_logs as t";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket_logs as t";
$sql .= " WHERE t.rowid = " . $id;
dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG);
@@ -214,7 +214,7 @@ class Ticketsuplogs// extends CommonObject
// Put here code to add a control on parameters values
// Update request
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticketsup_logs SET";
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticket_logs SET";
$sql .= " fk_track_id=" . (isset($this->fk_track_id) ? "'" . $this->db->escape($this->fk_track_id) . "'" : "null") . ",";
$sql .= " fk_user_create=" . ($this->fk_user_create > 0 ? $this->fk_user_create : "null") . ",";
@@ -289,7 +289,7 @@ class Ticketsuplogs// extends CommonObject
}
if (!$error) {
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "ticketsup_logs";
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "ticket_logs";
$sql .= " WHERE rowid=" . $this->id;
dol_syslog(get_class($this) . "::delete sql=" . $sql);

View File

@@ -16,18 +16,18 @@
*/
/**
* \file /ticketsup/class/ticketsupstats.class.php
* \ingroup ticketsup
* \file /ticket/class/ticketstats.class.php
* \ingroup ticket
* \brief Fichier de la classe de gestion des stats des tickets
*/
require_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php';
require_once 'ticketsup.class.php';
require_once 'ticket.class.php';
/**
* Classe permettant la gestion des stats des deplacements et notes de frais
*/
class TicketsupStats extends Stats
class TicketStats extends Stats
{
public $table_element;
@@ -54,7 +54,7 @@ class TicketsupStats extends Stats
$this->socid = $socid;
$this->userid = $userid;
$object = new Ticketsup($this->db);
$object = new Ticket($this->db);
$this->from = MAIN_DB_PREFIX . $object->table_element;
$this->field = 'km';

View File

@@ -19,15 +19,15 @@
*/
/**
* \file htdocs/ticketsup/contact.php
* \ingroup ticketsup
* \file htdocs/ticket/contact.php
* \ingroup ticket
* \brief Contacts of tickets
*/
require '../main.inc.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 . '/ticket/class/ticket.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT . "/core/lib/company.lib.php";
@@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
// Load translation files required by the page
$langs->loadLangs(array('companies', 'ticketsup'));
$langs->loadLangs(array('companies', 'ticket'));
// Get parameters
$socid = GETPOST("socid", 'int');
@@ -60,15 +60,15 @@ if ($user->societe_id > 0) {
}
// Store current page url
$url_page_current = dol_buildpath('/ticketsup/contact.php', 1);
$url_page_current = dol_buildpath('/ticket/contact.php', 1);
$object = new Ticketsup($db);
$object = new Ticket($db);
/*
* Ajout d'un nouveau contact
*/
if ($action == 'addcontact' && $user->rights->ticketsup->write) {
if ($action == 'addcontact' && $user->rights->ticket->write) {
$result = $object->fetch($id, '', $track_id);
if ($result > 0 && ($id > 0 || (!empty($track_id)))) {
@@ -90,7 +90,7 @@ if ($action == 'addcontact' && $user->rights->ticketsup->write) {
}
// bascule du statut d'un contact
if ($action == 'swapstatut' && $user->rights->ticketsup->write) {
if ($action == 'swapstatut' && $user->rights->ticket->write) {
if ($object->fetch($id, '', $track_id)) {
$result = $object->swapContactStatus($ligne);
} else {
@@ -99,7 +99,7 @@ if ($action == 'swapstatut' && $user->rights->ticketsup->write) {
}
// Efface un contact
if ($action == 'deletecontact' && $user->rights->ticketsup->write) {
if ($action == 'deletecontact' && $user->rights->ticket->write) {
if ($object->fetch($id, '', $track_id)) {
$result = $object->delete_contact($lineid);
@@ -133,7 +133,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
if ($socid > 0) {
$object->fetch_thirdparty();
$head = societe_prepare_head($object->thirdparty);
dol_fiche_head($head, 'ticketsup', $langs->trans("ThirdParty"), 0, 'company');
dol_fiche_head($head, 'ticket', $langs->trans("ThirdParty"), 0, 'company');
dol_banner_tab($object->thirdparty, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom');
dol_fiche_end();
}
@@ -144,9 +144,9 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
$object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'";
}
$head = ticketsup_prepare_head($object);
$head = ticket_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans("Ticket"), -1, 'ticketsup');
dol_fiche_head($head, 'contact', $langs->trans("Ticket"), -1, 'ticket');
$morehtmlref ='<div class="refidno">';
$morehtmlref.= $object->subject;
@@ -165,7 +165,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
}
$morehtmlref.='</div>';
$linkback = '<a href="' . dol_buildpath('/ticketsup/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
$linkback = '<a href="' . dol_buildpath('/ticket/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id ? 0 : 1), 'ref', 'ref', $morehtmlref);
@@ -173,7 +173,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
//print '<br>';
$permission = $user->rights->ticketsup->write;
$permission = $user->rights->ticket->write;
// Contacts lines (modules that overwrite templates must declare this into descriptor)
$dirtpls=array_merge($conf->modules_parts['tpl'], array('/core/tpl'));

View File

@@ -16,7 +16,7 @@
*/
/**
* \file htdocs/ticketsup/css/styles.css.php
* \file htdocs/ticket/css/styles.css.php
* \brief File for CSS style sheet for ticket module
*/

View File

@@ -20,21 +20,21 @@
*/
/**
* \file htdocs/ticketsup/document.php
* \ingroup ticketsup
* \file htdocs/ticket/document.php
* \ingroup ticket
* \brief files linked to a ticket
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/ticketsup.lib.php';
require_once DOL_DOCUMENT_ROOT . '/ticketsup/class/ticketsup.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT . "/core/lib/company.lib.php";
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
// Load translation files required by the page
$langs->loadLangs(array("companies","other","ticketsup","mails"));
$langs->loadLangs(array("companies","other","ticket","mails"));
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
@@ -43,7 +43,7 @@ $action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
// Security check
if (!$user->rights->ticketsup->read) {
if (!$user->rights->ticket->read) {
accessforbidden();
}
@@ -58,7 +58,7 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="position_name";
$object = new Ticketsup($db);
$object = new Ticket($db);
$result = $object->fetch($id, $ref, $track_id);
// to match document rules and compatibility
@@ -69,7 +69,7 @@ $object->ref = $object->track_id;
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
} else {
$upload_dir = $conf->ticketsup->dir_output . "/" . dol_sanitizeFileName($object->track_id);
$upload_dir = $conf->ticket->dir_output . "/" . dol_sanitizeFileName($object->track_id);
}
@@ -100,7 +100,7 @@ if ($object->id)
if ($socid > 0) {
$object->fetch_thirdparty();
$head = societe_prepare_head($object->thirdparty);
dol_fiche_head($head, 'ticketsup', $langs->trans("ThirdParty"), 0, 'company');
dol_fiche_head($head, 'ticket', $langs->trans("ThirdParty"), 0, 'company');
dol_banner_tab($object->thirdparty, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom');
dol_fiche_end();
}
@@ -111,9 +111,9 @@ if ($object->id)
$object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'";
}
$head = ticketsup_prepare_head($object);
$head = ticket_prepare_head($object);
dol_fiche_head($head, 'tabTicketDocument', $langs->trans("Ticket"), 0, 'ticketsup');
dol_fiche_head($head, 'tabTicketDocument', $langs->trans("Ticket"), 0, 'ticket');
$morehtmlref ='<div class="refidno">';
$morehtmlref.= $object->subject;
@@ -132,7 +132,7 @@ if ($object->id)
}
$morehtmlref.='</div>';
$linkback = '<a href="' . dol_buildpath('/ticketsup/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
$linkback = '<a href="' . dol_buildpath('/ticket/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id ? 0 : 1), 'ref', 'ref', $morehtmlref);
@@ -146,9 +146,9 @@ if ($object->id)
}
$object->ref = $object->track_id; // For compatibility we use track ID for directory
$modulepart = 'ticketsup';
$permission = $user->rights->ticketsup->write;
$permtoedit = $user->rights->ticketsup->write;
$modulepart = 'ticket';
$permission = $user->rights->ticket->write;
$permtoedit = $user->rights->ticket->write;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';

View File

@@ -16,15 +16,15 @@
*/
/**
* \file htdocs/ticketsup/history.php
* \ingroup ticketsup
* \file htdocs/ticket/history.php
* \ingroup ticket
* \brief History of ticket
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/ticketsup/class/actions_ticketsup.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formticketsup.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/ticketsup.lib.php';
require_once DOL_DOCUMENT_ROOT . '/ticket/class/actions_ticket.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formticket.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
require_once DOL_DOCUMENT_ROOT . "/core/lib/company.lib.php";
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
@@ -34,7 +34,7 @@ if (!class_exists('Contact')) {
}
// Load translation files required by the page
$langs->loadLangs(array('companies', 'other', 'ticketsup'));
$langs->loadLangs(array('companies', 'other', 'ticket'));
// Get parameters
$id = GETPOST('id', 'int');
@@ -43,7 +43,7 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha', 3);
// Security check
if (!$user->rights->ticketsup->read) {
if (!$user->rights->ticket->read) {
accessforbidden();
}
@@ -54,7 +54,7 @@ if (!$action) {
$action = 'view';
}
$object = new Ticketsup($db);
$object = new Ticket($db);
$object->fetch($id, $ref, $track_id);
@@ -62,7 +62,7 @@ $object->fetch($id, $ref, $track_id);
* Actions
*/
$actionobject = new ActionsTicketsup($db);
$actionobject = new ActionsTicket($db);
$actionobject->doActions($action, $object);
@@ -78,7 +78,7 @@ llxHeader('', $page_title, $help_url);
$userstat = new User($db);
$form = new Form($db);
$formticket = new FormTicketsup($db);
$formticket = new FormTicket($db);
if ($action == 'view') {
$res = $object->fetch($id, $ref, $track_id);
@@ -90,14 +90,14 @@ if ($action == 'view') {
accessforbidden('', 0);
}
// or for unauthorized internals users
if (!$user->societe_id && ($conf->global->TICKETS_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticketsup->manage) {
if (!$user->societe_id && ($conf->global->TICKETS_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
accessforbidden('', 0);
}
if ($socid > 0) {
$object->fetch_thirdparty();
$head = societe_prepare_head($object->thirdparty);
dol_fiche_head($head, 'ticketsup', $langs->trans("ThirdParty"), 0, 'company');
dol_fiche_head($head, 'ticket', $langs->trans("ThirdParty"), 0, 'company');
dol_banner_tab($object->thirdparty, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom');
dol_fiche_end();
}
@@ -107,9 +107,9 @@ if ($action == 'view') {
} elseif ($user->societe_id > 0) {
$object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'";
}
$head = ticketsup_prepare_head($object);
$head = ticket_prepare_head($object);
dol_fiche_head($head, 'tabTicketLogs', $langs->trans("Ticket"), 0, 'ticketsup');
dol_fiche_head($head, 'tabTicketLogs', $langs->trans("Ticket"), 0, 'ticket');
$morehtmlref ='<div class="refidno">';
$morehtmlref.= $object->subject;
@@ -128,7 +128,7 @@ if ($action == 'view') {
}
$morehtmlref.='</div>';
$linkback = '<a href="' . dol_buildpath('/ticketsup/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
$linkback = '<a href="' . dol_buildpath('/ticket/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id ? 0 : 1), 'ref', 'ref', $morehtmlref);
@@ -136,7 +136,7 @@ if ($action == 'view') {
print '<div class="fichecenter">';
// Logs list
print load_fiche_titre($langs->trans('TicketHistory'), '', 'history@ticketsup');
print load_fiche_titre($langs->trans('TicketHistory'), '', 'history@ticket');
$actionobject->viewTimelineTicketLogs(true, $object);
print '</div><!-- fichecenter -->';
print '<br style="clear: both">';

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1014 B

After

Width:  |  Height:  |  Size: 1014 B

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 329 B

After

Width:  |  Height:  |  Size: 329 B

View File

Before

Width:  |  Height:  |  Size: 470 B

After

Width:  |  Height:  |  Size: 470 B

View File

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 380 B

View File

Before

Width:  |  Height:  |  Size: 419 B

After

Width:  |  Height:  |  Size: 419 B

View File

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 363 B

View File

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 341 B

View File

Before

Width:  |  Height:  |  Size: 272 B

After

Width:  |  Height:  |  Size: 272 B

View File

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 234 B

View File

@@ -16,17 +16,17 @@
*/
/**
* \file htdocs/ticketsup/history.php
* \ingroup ticketsup
* \file htdocs/ticket/history.php
* \ingroup ticket
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/ticketsup/class/actions_ticketsup.class.php';
require_once DOL_DOCUMENT_ROOT . '/ticketsup/class/ticketsupstats.class.php';
require_once DOL_DOCUMENT_ROOT . '/ticket/class/actions_ticket.class.php';
require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticketstats.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/dolgraph.class.php';
// Load translation files required by the page
$langs->loadLangs(array('companies', 'other', 'ticketsup'));
$langs->loadLangs(array('companies', 'other', 'ticket'));
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
@@ -42,7 +42,7 @@ if ($user->societe_id) {
}
// Security check
$result = restrictedArea($user, 'ticketsup', 0, '', '', '', '');
$result = restrictedArea($user, 'ticket', 0, '', '', '', '');
$nowyear = strftime("%Y", dol_now());
$year = GETPOST('year') > 0 ? GETPOST('year') : $nowyear;
@@ -50,7 +50,7 @@ $year = GETPOST('year') > 0 ? GETPOST('year') : $nowyear;
$startyear = $year - 1;
$endyear = $year;
$object = new Ticketsup($db);
$object = new Ticket($db);
/*
@@ -65,29 +65,29 @@ $object = new Ticketsup($db);
*/
$form = new Form($db);
$tickesupstatic = new Ticketsup($db);
$tickesupstatic = new Ticket($db);
llxHeader('', $langs->trans('TicketsIndex'), '');
$linkback='';
print load_fiche_titre($langs->trans('TicketsIndex'),$linkback,'title_ticketsup.png');
print load_fiche_titre($langs->trans('TicketsIndex'),$linkback,'title_ticket.png');
$dir = '';
$filenamenb = $dir . "/" . $prefix . "ticketsupinyear-" . $endyear . ".png";
$fileurlnb = DOL_URL_ROOT . '/viewimage.php?modulepart=ticketsup&amp;file=ticketsupinyear-' . $endyear . '.png';
$filenamenb = $dir . "/" . $prefix . "ticketinyear-" . $endyear . ".png";
$fileurlnb = DOL_URL_ROOT . '/viewimage.php?modulepart=ticket&amp;file=ticketinyear-' . $endyear . '.png';
$stats = new TicketsupStats($db, $socid, $userid);
$param_year = 'DOLUSERCOOKIE_ticketsup_by_status_year';
$param_shownb = 'DOLUSERCOOKIE_ticketsup_by_status_shownb';
$param_showtot = 'DOLUSERCOOKIE_ticketsup_by_status_showtot';
$stats = new TicketStats($db, $socid, $userid);
$param_year = 'DOLUSERCOOKIE_ticket_by_status_year';
$param_shownb = 'DOLUSERCOOKIE_ticket_by_status_shownb';
$param_showtot = 'DOLUSERCOOKIE_ticket_by_status_showtot';
$autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE'));
if (in_array('DOLUSERCOOKIE_ticketsup_by_status', $autosetarray)) {
if (in_array('DOLUSERCOOKIE_ticket_by_status', $autosetarray)) {
$endyear = GETPOST($param_year, 'int');
$shownb = GETPOST($param_shownb, 'alpha');
$showtot = GETPOST($param_showtot, 'alpha');
} else {
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_ticketsup_by_status'], true);
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_ticket_by_status'], true);
$endyear = $tmparray['year'];
$shownb = $tmparray['shownb'];
$showtot = $tmparray['showtot'];
@@ -122,12 +122,12 @@ $tick = array(
);
$total = 0;
$sql = "SELECT t.fk_statut, COUNT(t.fk_statut) as nb";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticketsup as t";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
}
$sql .= ' WHERE t.entity IN (' . getEntity('ticketsup', 1) . ')';
$sql .= ' WHERE t.entity IN (' . getEntity('ticket', 1) . ')';
$sql .= " AND t.fk_statut IS NOT NULL";
$sql .= " AND date_format(datec,'%Y') = '" . $endyear . "'";
if (!$user->rights->societe->client->voir && !$socid) {
@@ -139,7 +139,7 @@ if ($user->societe_id > 0) {
$sql .= " AND t.fk_soc='" . $user->societe_id . "'";
} else {
// For internals users,
if (!empty($conf->global->TICKETS_LIMIT_VIEW_ASSIGNED_ONLY) && !$user->rights->ticketsup->manage) {
if (!empty($conf->global->TICKETS_LIMIT_VIEW_ASSIGNED_ONLY) && !$user->rights->ticket->manage) {
$sql .= " AND t.fk_user_assign=" . $user->id;
}
}
@@ -194,22 +194,22 @@ if ($result) {
$stringtoshow = '';
$stringtoshow .= '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#idsubimgDOLUSERCOOKIE_ticketsup_by_status").click(function() {
jQuery("#idfilterDOLUSERCOOKIE_ticketsup_by_status").toggle();
jQuery("#idsubimgDOLUSERCOOKIE_ticket_by_status").click(function() {
jQuery("#idfilterDOLUSERCOOKIE_ticket_by_status").toggle();
});
});
</script>';
$stringtoshow .= '<div class="center hideobject" id="idfilterDOLUSERCOOKIE_ticketsup_by_status">'; // hideobject is to start hidden
$stringtoshow .= '<div class="center hideobject" id="idfilterDOLUSERCOOKIE_ticket_by_status">'; // hideobject is to start hidden
$stringtoshow .= '<form class="flat formboxfilter" method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
$stringtoshow .= '<input type="hidden" name="action" value="' . $refreshaction . '">';
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_ticketsup_by_status:year,shownb,showtot">';
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_ticket_by_status:year,shownb,showtot">';
$stringtoshow .= $langs->trans("Year") . ' <input class="flat" size="4" type="text" name="' . $param_year . '" value="' . $endyear . '">';
$stringtoshow .= '<input type="image" alt="' . $langs->trans("Refresh") . '" src="' . img_picto($langs->trans("Refresh"), 'refresh.png', '', '', 1) . '">';
$stringtoshow .= '</form>';
$stringtoshow .= '</div>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th >' . $langs->trans("Statistics") . ' ' . img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticketsup_by_status" class="linkobject"') . '</th></tr>';
print '<tr class="liste_titre"><th >' . $langs->trans("Statistics") . ' ' . img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_by_status" class="linkobject"') . '</th></tr>';
print '<tr><td>';
@@ -265,15 +265,15 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
$max = 15;
$sql = "SELECT t.rowid, t.ref, t.track_id, t.datec, t.subject, t.type_code, t.category_code, t.severity_code, t.fk_statut, t.progress,";
$sql .= " type.label as type_label, category.label as category_label, severity.label as severity_label";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticketsup as t";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_type as type ON type.code=t.type_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_category as category ON category.code=t.category_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_severity as severity ON severity.code=t.severity_code";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_type as type ON type.code=t.type_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_category as category ON category.code=t.category_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticket_severity as severity ON severity.code=t.severity_code";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
}
$sql .= ' WHERE t.entity IN (' . getEntity('ticketsup', 1) . ')';
$sql .= ' WHERE t.entity IN (' . getEntity('ticket', 1) . ')';
$sql .= " AND t.fk_statut=0";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND t.fk_soc = sc.fk_soc AND sc.fk_user = " . $user->id;
@@ -283,7 +283,7 @@ if ($user->societe_id > 0) {
$sql .= " AND t.fk_soc='" . $user->societe_id . "'";
} else {
// Restricted to assigned user only
if ($conf->global->TICKETS_LIMIT_VIEW_ASSIGNED_ONLY && !$user->rights->ticketsup->manage) {
if ($conf->global->TICKETS_LIMIT_VIEW_ASSIGNED_ONLY && !$user->rights->ticket->manage) {
$sql .= " AND t.fk_user_assign=" . $user->id;
}
}

View File

@@ -18,13 +18,13 @@
*/
/**
* \file htdocs/ticketsup/list.php
* \ingroup ticketsup
* \file htdocs/ticket/list.php
* \ingroup ticket
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/ticketsup/class/actions_ticketsup.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formticketsup.class.php';
require_once DOL_DOCUMENT_ROOT . '/ticket/class/actions_ticket.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formticket.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
@@ -33,7 +33,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
include_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("ticketsup","companies","other","projects"));
$langs->loadLangs(array("ticket","companies","other","projects"));
// Get parameters
@@ -43,7 +43,7 @@ $show_files = GETPOST('show_files','int'); // Show files area generat
$confirm = GETPOST('confirm','alpha'); // Result of a confirmation
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'ticketsuplist'; // To manage different context of search
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'ticketlist'; // To manage different context of search
$backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print')
@@ -67,15 +67,15 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
// Initialize technical objects
$object=new Ticketsup($db);
$object=new Ticket($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction=$conf->ticketsup->dir_output . '/temp/massgeneration/'.$user->id;
$diroutputmassaction=$conf->ticket->dir_output . '/temp/massgeneration/'.$user->id;
if ($socid > 0) $hookmanager->initHooks(array('thirdpartyticket'));
elseif ($project > 0) $hookmanager->initHooks(array('projectticket'));
else $hookmanager->initHooks(array('ticketsuplist'));
else $hookmanager->initHooks(array('ticketlist'));
// Fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label('ticketsup');
$extralabels = $extrafields->fetch_name_optionals_label('ticket');
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
// Default sort order (if not yet defined by previous GETPOST)
@@ -121,12 +121,12 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
// Security check
if (!$user->rights->ticketsup->read) {
if (!$user->rights->ticket->read) {
accessforbidden();
}
// Store current page url
$url_page_current = dol_buildpath('/ticketsup/list.php', 1);
$url_page_current = dol_buildpath('/ticket/list.php', 1);
@@ -163,11 +163,11 @@ if (empty($reshook))
}
// Mass actions
$objectclass='Ticketsup';
$objectlabel='Ticketsup';
$permtoread = $user->rights->ticketsup->read;
$permtodelete = $user->rights->ticketsup->delete;
$uploaddir = $conf->ticketsup->dir_output;
$objectclass='Ticket';
$objectlabel='Ticket';
$permtoread = $user->rights->ticket->read;
$permtodelete = $user->rights->ticket->delete;
$uploaddir = $conf->ticket->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@@ -181,7 +181,7 @@ $help_url = 'FR:DocumentationModuleTicket';
llxHeader('', $langs->trans('TicketList'), $help_url);
$form = new Form($db);
$formTicket = new FormTicketsup($db);
$formTicket = new FormTicket($db);
$user_assign = new User($db);
$user_create = new User($db);
@@ -204,8 +204,8 @@ $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object
$sql.=$hookmanager->resPrint;
$sql=preg_replace('/, $/','', $sql);
$sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."ticketsup_extrafields as ef on (t.rowid = ef.fk_object)";
if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('ticketsup').")";
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."ticket_extrafields as ef on (t.rowid = ef.fk_object)";
if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('ticket').")";
else $sql.=" WHERE 1 = 1";
foreach($search as $key => $val)
{
@@ -286,7 +286,7 @@ if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) &&
{
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".DOL_URL_ROOT.'/ticketsup/card.php?id='.$id);
header("Location: ".DOL_URL_ROOT.'/ticket/card.php?id='.$id);
exit;
}
@@ -304,7 +304,7 @@ if ($socid && !$projectid && $user->rights->societe->lire) {
$head = societe_prepare_head($socstat);
$object = $tmpobject;
dol_fiche_head($head, 'ticketsup', $langs->trans("ThirdParty"), -1, 'company');
dol_fiche_head($head, 'ticket', $langs->trans("ThirdParty"), -1, 'company');
dol_banner_tab($socstat, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom');
@@ -359,7 +359,7 @@ if ($projectid > 0) {
//print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
$head = project_prepare_head($projectstat);
dol_fiche_head($head, 'ticketsup', $langs->trans("Project"), -1, ($projectstat->public ? 'projectpub' : 'project'));
dol_fiche_head($head, 'ticket', $langs->trans("Project"), -1, ($projectstat->public ? 'projectpub' : 'project'));
// Project card
@@ -430,7 +430,7 @@ $arrayofmassactions = array(
//'presend'=>$langs->trans("SendByMail"),
//'builddoc'=>$langs->trans("PDFMerge"),
);
if ($user->rights->ticketsup->delete) $arrayofmassactions['predelete']=$langs->trans("Delete");
if ($user->rights->ticket->delete) $arrayofmassactions['predelete']=$langs->trans("Delete");
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
@@ -449,22 +449,22 @@ if ($socid) print '<input type="hidden" name="socid" value="' . $socid . '"
if ($projectid) print '<input type="hidden" name="projectid" value="' . $projectid . '" >';
$newcardbutton='';
if ($user->rights->ticketsup->write)
if ($user->rights->ticket->write)
{
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/ticketsup/new.php?action=create_ticket' . ($socid ? '&socid=' . $socid : '') . ($projectid ? '&origin=projet_project&originid=' . $projectid : '') . '">' . $langs->trans('NewTicket');
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/ticket/new.php?action=create_ticket' . ($socid ? '&socid=' . $socid : '') . ($projectid ? '&origin=projet_project&originid=' . $projectid : '') . '">' . $langs->trans('NewTicket');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}
print_barre_liste($langs->trans('TicketList'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_ticketsup', 0, $newcardbutton, '', $limit);
print_barre_liste($langs->trans('TicketList'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_ticket', 0, $newcardbutton, '', $limit);
if ($mode == 'my_assign') {
print '<div class="opacitymedium">' . $langs->trans('TicketAssignedToMeInfos') . '</div><br>';
}
// Add code for pre mass action (confirmation or email presend form)
$topicmail="SendTicketsupRef";
$modelmail="ticketsup";
$objecttmp=new Ticketsup($db);
$topicmail="SendTicketRef";
$modelmail="ticket";
$objecttmp=new Ticket($db);
$trackid='tick'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
@@ -703,10 +703,10 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb
$urlsource.=str_replace('&amp;','&',$param);
$filedir=$diroutputmassaction;
$genallowed=$user->rights->ticketsup->read;
$delallowed=$user->rights->ticketsup->write;
$genallowed=$user->rights->ticket->read;
$delallowed=$user->rights->ticket->write;
print $formfile->showdocuments('massfilesarea_ticketsup','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty);
print $formfile->showdocuments('massfilesarea_ticket','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty);
}
// End of page

View File

@@ -17,18 +17,18 @@
*/
/**
* \file htdocs/ticketsup/new.php
* \ingroup ticketsup
* \file htdocs/ticket/new.php
* \ingroup ticket
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/ticketsup/class/actions_ticketsup.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formticketsup.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/ticketsup.lib.php';
require_once DOL_DOCUMENT_ROOT . '/ticket/class/actions_ticket.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formticket.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
// Load translation files required by the page
$langs->loadLangs(array('companies', 'other', 'ticketsup'));
$langs->loadLangs(array('companies', 'other', 'ticket'));
// Get parameters
$id = GETPOST('id', 'int');
@@ -40,12 +40,12 @@ $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha');
$action = GETPOST('action', 'alpha', 3);
// Protection if external user
if (!$user->rights->ticketsup->read || !$user->rights->ticketsup->write) {
if (!$user->rights->ticket->read || !$user->rights->ticket->write) {
accessforbidden();
}
$object = new Ticketsup($db);
$actionobject = new ActionsTicketsup($db);
$object = new Ticket($db);
$actionobject = new ActionsTicket($db);
/*
@@ -68,9 +68,9 @@ llxHeader('', $page_title, $help_url);
if ($action == 'create_ticket') {
$formticket = new FormTicketsup($db);
$formticket = new FormTicket($db);
print load_fiche_titre($langs->trans('NewTicket'), '', 'title_ticketsup');
print load_fiche_titre($langs->trans('NewTicket'), '', 'title_ticket');
$formticket->withfromsocid = $socid ? $socid : $user->societe_id;
$formticket->withfromcontactid = $contactid ? $contactid : '';

View File

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

View File

@@ -156,8 +156,8 @@ class AllTests
require_once dirname(__FILE__).'/FichinterTest.php';
$suite->addTestSuite('FichinterTest');
require_once dirname(__FILE__).'/TicketsupTest.php';
$suite->addTestSuite('TicketsupTest');
require_once dirname(__FILE__).'/TicketTest.php';
$suite->addTestSuite('TicketTest');
require_once dirname(__FILE__).'/PropalTest.php';
$suite->addTestSuite('PropalTest');

View File

@@ -133,7 +133,7 @@ class ModulesTest extends PHPUnit_Framework_TestCase
'Facture','Fckeditor','Ficheinter','Fournisseur','FTP','GeoIPMaxmind','Gravatar','Holiday','HRM','Import','Incoterm','Label','Ldap','Loan',
'Mailing','MailmanSpip','Margin','ModuleBuilder','MultiCurrency',
'Notification','Oauth','OpenSurvey','Paybox','Paypal','Prelevement','Printing','Product','ProductBatch','Projet','Propale','ReceiptPrinter','Resource',
'Salaries','Service','Skype','Societe','Stock','Stripe','SupplierProposal','Syslog','Tax','Ticketsup','User','Variants','WebServices','WebServicesClient','Website','Workflow');
'Salaries','Service','Skype','Societe','Stock','Stripe','SupplierProposal','Syslog','Tax','Ticket','User','Variants','WebServices','WebServicesClient','Website','Workflow');
foreach($modulelist as $modlabel)
{
require_once(DOL_DOCUMENT_ROOT.'/core/modules/mod'.$modlabel.'.class.php');

View File

@@ -17,7 +17,7 @@
*/
/**
* \file test/unit/TicketsupTest.php
* \file test/unit/TicketTest.php
* \ingroup test
* \brief PHPUnit test
* \remarks To run this script as CLI: phpunit filename.php
@@ -28,7 +28,7 @@ global $conf,$user,$langs,$db;
//require_once 'PHPUnit/Autoload.php';
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
require_once dirname(__FILE__).'/../../htdocs/user/class/usergroup.class.php';
require_once dirname(__FILE__).'/../../htdocs/ticketsup/class/ticketsup.class.php';
require_once dirname(__FILE__).'/../../htdocs/ticket/class/ticket.class.php';
if (empty($user->id)) {
print "Load permissions for admin user nb 1\n";
@@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
* @backupStaticAttributes enabled
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
*/
class TicketsupTest extends PHPUnit_Framework_TestCase
class TicketTest extends PHPUnit_Framework_TestCase
{
protected $savconf;
protected $savuser;
@@ -116,11 +116,11 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
}
/**
* testTicketsupCreate
* testTicketCreate
*
* @return int
*/
public function testTicketsupCreate()
public function testTicketCreate()
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
@@ -129,7 +129,7 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
$db=$this->savdb;
// Try to create one with bad values
$localobject=new Ticketsup($this->savdb);
$localobject=new Ticket($this->savdb);
$localobject->initAsSpecimen();
$localobject->ref = '';
$result=$localobject->create($user);
@@ -138,7 +138,7 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
$this->assertEquals(-3, $result, $localobject->error.join(',', $localobject->errors));
// Try to create one with correct values
$localobject=new Ticketsup($this->savdb);
$localobject=new Ticket($this->savdb);
$localobject->initAsSpecimen();
$result=$localobject->create($user);
@@ -149,15 +149,15 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
}
/**
* testTicketsupFetch
* testTicketFetch
*
* @param int $id Id of ticket
* @return int
*
* @depends testTicketsupCreate
* @depends testTicketCreate
* The depends says test is run only if previous is ok
*/
public function testTicketsupFetch($id)
public function testTicketFetch($id)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
@@ -165,7 +165,7 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
$langs=$this->savlangs;
$db=$this->savdb;
$localobject=new Ticketsup($this->savdb);
$localobject=new Ticket($this->savdb);
$result=$localobject->fetch($id);
print __METHOD__." id=".$id." result=".$result."\n";
@@ -175,15 +175,15 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
}
/**
* testTicketsupmarkAsRead
* testTicketmarkAsRead
*
* @param Ticketsup $localobject Ticket
* @param Ticket $localobject Ticket
* @return int
*
* @depends testTicketsupFetch
* @depends testTicketFetch
* The depends says test is run only if previous is ok
*/
public function testTicketsupmarkAsRead($localobject)
public function testTicketmarkAsRead($localobject)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
@@ -199,15 +199,15 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
}
/**
* testTicketsupsetProject
* testTicketsetProject
*
* @param Ticketsup $localobject Ticket
* @param Ticket $localobject Ticket
* @return int
*
* @depends testTicketsupFetch
* @depends testTicketFetch
* The depends says test is run only if previous is ok
*/
public function testTicketsupsetProject($localobject)
public function testTicketsetProject($localobject)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
@@ -225,15 +225,15 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
}
/**
* testTicketsupsetContract
* testTicketsetContract
*
* @param Ticketsup $localobject Ticket
* @param Ticket $localobject Ticket
* @return int
*
* @depends testTicketsupFetch
* @depends testTicketFetch
* The depends says test is run only if previous is ok
*/
public function testTicketsupsetContract($localobject)
public function testTicketsetContract($localobject)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
@@ -251,15 +251,15 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
}
/**
* testTicketsupsetProgression
* testTicketsetProgression
*
* @param Ticketsup $localobject Ticket
* @param Ticket $localobject Ticket
* @return int
*
* @depends testTicketsupFetch
* @depends testTicketFetch
* The depends says test is run only if previous is ok
*/
public function testTicketsupsetProgression($localobject)
public function testTicketsetProgression($localobject)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
@@ -277,15 +277,15 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
}
/**
* testTicketsupassignUser
* testTicketassignUser
*
* @param Ticketsup $localobject Ticket
* @param Ticket $localobject Ticket
* @return int
*
* @depends testTicketsupFetch
* @depends testTicketFetch
* The depends says test is run only if previous is ok
*/
public function testTicketsupassignUser($localobject)
public function testTicketassignUser($localobject)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
@@ -304,15 +304,15 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
}
/**
* testTicketsupassignUserOther
* testTicketassignUserOther
*
* @param Ticketsup $localobject Ticket
* @param Ticket $localobject Ticket
* @return int
*
* @depends testTicketsupFetch
* @depends testTicketFetch
* The depends says test is run only if previous is ok
*/
public function testTicketsupassignUserOther($localobject)
public function testTicketassignUserOther($localobject)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
@@ -331,15 +331,15 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
}
/**
* testTicketsupcreateTicketLog
* testTicketcreateTicketLog
*
* @param Ticketsup $localobject Ticket
* @param Ticket $localobject Ticket
* @return int
*
* @depends testTicketsupFetch
* @depends testTicketFetch
* The depends says test is run only if previous is ok
*/
public function testTicketsupcreateTicketLog($localobject)
public function testTicketcreateTicketLog($localobject)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
@@ -358,15 +358,15 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
}
/**
* testTicketsupclose
* testTicketclose
*
* @param Ticketsup $localobject Ticket
* @param Ticket $localobject Ticket
* @return int
*
* @depends testTicketsupFetch
* @depends testTicketFetch
* The depends says test is run only if previous is ok
*/
public function testTicketsupclose($localobject)
public function testTicketclose($localobject)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
@@ -383,15 +383,15 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
/**
* testTicketsupDelete
* testTicketDelete
*
* @param int $id Id of ticket
* @return int
*
* @depends testTicketsupclose
* @depends testTicketclose
* The depends says test is run only if previous is ok
*/
public function testTicketsupDelete($id)
public function testTicketDelete($id)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
@@ -399,7 +399,7 @@ class TicketsupTest extends PHPUnit_Framework_TestCase
$langs=$this->savlangs;
$db=$this->savdb;
$localobject=new Ticketsup($this->savdb);
$localobject=new Ticket($this->savdb);
$result=$localobject->fetch($id);
$result=$localobject->delete($user);