Debug module Ticket
@ -281,6 +281,7 @@ class ActionComm extends CommonObject
|
||||
if (! empty($this->datep) && ! empty($this->datef) && $this->datep > $this->datef) $this->datef=$this->datep;
|
||||
//if (! empty($this->date) && ! empty($this->dateend) && $this->date > $this->dateend) $this->dateend=$this->date;
|
||||
if (! isset($this->fk_project) || $this->fk_project < 0) $this->fk_project = 0;
|
||||
// For backward compatibility
|
||||
if ($this->elementtype=='facture') $this->elementtype='invoice';
|
||||
if ($this->elementtype=='commande') $this->elementtype='order';
|
||||
if ($this->elementtype=='contrat') $this->elementtype='contract';
|
||||
|
||||
@ -1299,6 +1299,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
||||
if ($object->element == 'member') $modulepart='memberphoto';
|
||||
if ($object->element == 'user') $modulepart='userphoto';
|
||||
if ($object->element == 'product') $modulepart='product';
|
||||
if ($object->element == 'ticket') $modulepart='ticket';
|
||||
|
||||
if (class_exists("Imagick"))
|
||||
{
|
||||
|
||||
@ -58,9 +58,10 @@ Notify_TICKET_SENTBYMAIL=Send ticket message by email
|
||||
# Status
|
||||
NotRead=Not read
|
||||
Read=Read
|
||||
Answered=Answered
|
||||
Assigned=Assigned
|
||||
InProgress=In progress
|
||||
NeedMoreInformation=Waiting more information
|
||||
Answered=Answered
|
||||
Waiting=Waiting
|
||||
Closed=Closed
|
||||
Deleted=Deleted
|
||||
|
||||
@ -125,103 +125,102 @@ if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/ticketnameonly/', $c
|
||||
$help_url = 'FR:DocumentationModuleTicket';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if ($socid > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
$head = societe_prepare_head($object->thirdparty);
|
||||
if ($socid > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
$head = societe_prepare_head($object->thirdparty);
|
||||
|
||||
dol_fiche_head($head, 'ticket', $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_banner_tab($object->thirdparty, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom');
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
if (!$user->societe_id && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
|
||||
$object->next_prev_filter = "te.fk_user_assign = '" . $user->id . "'";
|
||||
} elseif ($user->societe_id > 0) {
|
||||
$object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'";
|
||||
}
|
||||
$head = ticket_prepare_head($object);
|
||||
if (!$user->societe_id && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
|
||||
$object->next_prev_filter = "te.fk_user_assign = '" . $user->id . "'";
|
||||
} elseif ($user->societe_id > 0) {
|
||||
$object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'";
|
||||
}
|
||||
$head = ticket_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'tabTicketLogs', $langs->trans("Ticket"), 0, 'ticket');
|
||||
dol_fiche_head($head, 'tabTicketLogs', $langs->trans("Ticket"), 0, 'ticket');
|
||||
|
||||
$morehtmlref ='<div class="refidno">';
|
||||
$morehtmlref.= $object->subject;
|
||||
// Author
|
||||
if ($object->fk_user_create > 0) {
|
||||
$morehtmlref .= '<br>' . $langs->trans("CreatedBy") . ' ';
|
||||
$morehtmlref ='<div class="refidno">';
|
||||
$morehtmlref.= $object->subject;
|
||||
// Author
|
||||
if ($object->fk_user_create > 0) {
|
||||
$morehtmlref .= '<br>' . $langs->trans("CreatedBy") . ' : ';
|
||||
|
||||
$langs->load("users");
|
||||
$fuser = new User($db);
|
||||
$fuser->fetch($object->fk_user_create);
|
||||
$morehtmlref .= $fuser->getNomUrl(0);
|
||||
}
|
||||
if (!empty($object->origin_email)) {
|
||||
$morehtmlref .= '<br>' . $langs->trans("CreatedBy") . ' : ';
|
||||
$morehtmlref .= $object->origin_email . ' <small>(' . $langs->trans("TicketEmailOriginIssuer") . ')</small>';
|
||||
}
|
||||
$langs->load("users");
|
||||
$fuser = new User($db);
|
||||
$fuser->fetch($object->fk_user_create);
|
||||
$morehtmlref .= $fuser->getNomUrl(0);
|
||||
}
|
||||
if (!empty($object->origin_email)) {
|
||||
$morehtmlref .= '<br>' . $langs->trans("CreatedBy") . ' : ';
|
||||
$morehtmlref .= $object->origin_email . ' <small>(' . $langs->trans("TicketEmailOriginIssuer") . ')</small>';
|
||||
}
|
||||
|
||||
// Thirdparty
|
||||
if (! empty($conf->societe->enabled))
|
||||
{
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty');
|
||||
/*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->societe_id && $user->rights->ticket->write) {
|
||||
$morehtmlref.='<a href="' . $url_page_current . '?action=editcustomer&track_id=' . $object->track_id . '">' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '</a>';
|
||||
}*/
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'editcustomer') {
|
||||
$morehtmlref.=$form->form_thirdparty($url_page_current . '?track_id=' . $object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1);
|
||||
} else {
|
||||
$morehtmlref.=$form->form_thirdparty($url_page_current . '?track_id=' . $object->track_id, $object->socid, 'none', '', 1, 0, 0, array(), 1);
|
||||
}
|
||||
}
|
||||
// Thirdparty
|
||||
if (! empty($conf->societe->enabled))
|
||||
{
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty');
|
||||
/*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->societe_id && $user->rights->ticket->write) {
|
||||
$morehtmlref.='<a href="' . $url_page_current . '?action=editcustomer&track_id=' . $object->track_id . '">' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '</a>';
|
||||
}*/
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'editcustomer') {
|
||||
$morehtmlref.=$form->form_thirdparty($url_page_current . '?track_id=' . $object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1);
|
||||
} else {
|
||||
$morehtmlref.=$form->form_thirdparty($url_page_current . '?track_id=' . $object->track_id, $object->socid, 'none', '', 1, 0, 0, array(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project');
|
||||
if ($user->rights->ticket->write)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref.=$proj->getNomUrl(1);
|
||||
} else {
|
||||
$morehtmlref.='';
|
||||
}
|
||||
}
|
||||
}
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project');
|
||||
if ($user->rights->ticket->write)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref.=$proj->getNomUrl(1);
|
||||
} else {
|
||||
$morehtmlref.='';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$morehtmlref.='</div>';
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
$linkback = '<a href="' . dol_buildpath('/ticket/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, '', 0, '', '', 1);
|
||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||
|
||||
dol_fiche_end();
|
||||
dol_fiche_end();
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
if (!empty($object->id))
|
||||
{
|
||||
print '<br>';
|
||||
$param='&id='.$object->id;
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
|
||||
@ -818,7 +818,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
||||
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
$linkback = '<a href="' . dol_buildpath('/ticket/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT. '/ticket/list.php"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id ? 0 : 1), 'ref', 'ref', $morehtmlref);
|
||||
|
||||
@ -1218,10 +1218,10 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
// Message list
|
||||
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'messages@ticket');
|
||||
$show_private_message = ($user->societe_id ? 0 : 1);
|
||||
$actionobject->viewTicketTimelineMessages($show_private_message, true, $object);
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'ticket', $socid, 1);
|
||||
|
||||
print '</div></div>';
|
||||
print '</div><!-- fichecenter -->';
|
||||
|
||||
@ -443,8 +443,7 @@ class ActionsTicket
|
||||
// Sort results to be similar to status object list
|
||||
//sort($exclude_status);
|
||||
|
||||
//print '<br><div>';
|
||||
foreach ($object->statuts_short as $status => $statut_label) {
|
||||
foreach ($object->statuts_short as $status => $status_label) {
|
||||
if (!in_array($status, $exclude_status)) {
|
||||
print '<div class="tagtd">';
|
||||
|
||||
|
||||
@ -207,10 +207,10 @@ class Ticket extends CommonObject
|
||||
*/
|
||||
const STATUS_NOT_READ = 0;
|
||||
const STATUS_READ = 1;
|
||||
const STATUS_ANSWERED = 3;
|
||||
const STATUS_ASSIGNED = 4;
|
||||
const STATUS_IN_PROGRESS = 5;
|
||||
const STATUS_WAITING = 6;
|
||||
const STATUS_ASSIGNED = 2;
|
||||
const STATUS_IN_PROGRESS = 3;
|
||||
const STATUS_NEED_MORE_INFO = 5;
|
||||
const STATUS_WAITING = 7;
|
||||
const STATUS_CLOSED = 8;
|
||||
const STATUS_CANCELED = 9;
|
||||
|
||||
@ -224,8 +224,8 @@ class Ticket extends CommonObject
|
||||
{
|
||||
$this->db = $db;
|
||||
|
||||
$this->statuts_short = array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'Closed', 9 => 'Deleted');
|
||||
$this->statuts = array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'Closed', 9 => 'Deleted');
|
||||
$this->statuts_short = array(self::STATUS_NOT_READ => 'Unread', self::STATUS_READ => 'Read', self::STATUS_ASSIGNED => 'Assigned', self::STATUS_IN_PROGRESS => 'InProgress', self::STATUS_NEED_MORE_INFO => 'NeedMoreInformation', self::STATUS_WAITING => 'Waiting', self::STATUS_CLOSED => 'Closed', self::STATUS_CANCELED => 'Canceled');
|
||||
$this->statuts = array(self::STATUS_NOT_READ => 'Unread', self::STATUS_READ => 'Read', self::STATUS_ASSIGNED => 'Assigned', self::STATUS_IN_PROGRESS => 'InProgress', self::STATUS_NEED_MORE_INFO => 'NeedMoreInformation', self::STATUS_WAITING => 'Waiting', self::STATUS_CLOSED => 'Closed', self::STATUS_CANCELED => 'Canceled');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1176,7 +1176,7 @@ class Ticket extends CommonObject
|
||||
* Return status label of object
|
||||
*
|
||||
* @param string $statut id statut
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
public function LibStatut($statut, $mode = 0)
|
||||
@ -1191,134 +1191,106 @@ class Ticket extends CommonObject
|
||||
return $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
elseif ($mode == 2) {
|
||||
if ($statut == 0) {
|
||||
if ($statut == self::STATUS_NOT_READ) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
|
||||
elseif ($statut == 1) {
|
||||
elseif ($statut == self::STATUS_READ) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
|
||||
elseif ($statut == 3) {
|
||||
elseif ($statut == self::STATUS_ASSIGNED) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut2.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
elseif ($statut == self::STATUS_IN_PROGRESS) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
|
||||
elseif ($statut == 4) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
|
||||
elseif ($statut == 5) {
|
||||
elseif ($statut == self::STATUS_NEED_MORE_INFO) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
|
||||
elseif ($statut == 6) {
|
||||
elseif ($statut == self::STATUS_WAITING) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
|
||||
elseif ($statut == 8) {
|
||||
elseif ($statut == self::STATUS_CLOSED) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
|
||||
elseif ($statut == 9) {
|
||||
elseif ($statut == self::STATUS_CANCELED) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
}
|
||||
elseif ($mode == 3) {
|
||||
if ($statut == 0) {
|
||||
if ($statut == self::STATUS_NOT_READ) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket');
|
||||
}
|
||||
|
||||
elseif ($statut == 1) {
|
||||
elseif ($statut == self::STATUS_READ) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket');
|
||||
}
|
||||
|
||||
elseif ($statut == 3) {
|
||||
elseif ($statut == self::STATUS_ASSIGNED) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut2.png@ticket');
|
||||
}
|
||||
elseif ($statut == self::STATUS_IN_PROGRESS) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket');
|
||||
}
|
||||
|
||||
elseif ($statut == 4) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket');
|
||||
}
|
||||
|
||||
elseif ($statut == 5) {
|
||||
elseif ($statut == self::STATUS_NEED_MORE_INFO) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket');
|
||||
}
|
||||
|
||||
elseif ($statut == 6) {
|
||||
elseif ($statut == self::STATUS_WAITING) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket');
|
||||
}
|
||||
|
||||
elseif ($statut == 8) {
|
||||
elseif ($statut == self::STATUS_CLOSED) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket');
|
||||
}
|
||||
|
||||
elseif ($statut == 9) {
|
||||
elseif ($statut == self::STATUS_CANCELED) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket');
|
||||
}
|
||||
}
|
||||
elseif ($mode == 4) {
|
||||
if ($statut == 0) {
|
||||
if ($statut == self::STATUS_NOT_READ) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
|
||||
elseif ($statut == 1) {
|
||||
elseif ($statut == self::STATUS_READ) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
|
||||
elseif ($statut == 3) {
|
||||
elseif ($statut == self::STATUS_ASSIGNED) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut2.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
elseif ($statut == self::STATUS_IN_PROGRESS) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
|
||||
elseif ($statut == 4) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
|
||||
elseif ($statut == 5) {
|
||||
elseif ($statut == self::STATUS_NEED_MORE_INFO) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
|
||||
elseif ($statut == 6) {
|
||||
elseif ($statut == self::STATUS_WAITING) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
|
||||
elseif ($statut == 8) {
|
||||
elseif ($statut == self::STATUS_CLOSED) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
|
||||
elseif ($statut == 9) {
|
||||
elseif ($statut == self::STATUS_CANCELED) {
|
||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
}
|
||||
elseif ($mode == 5) {
|
||||
if ($statut == 0) {
|
||||
elseif ($mode == 5 || $mode == 6) {
|
||||
if ($statut == self::STATUS_NOT_READ) {
|
||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket');
|
||||
}
|
||||
|
||||
elseif ($statut == 1) {
|
||||
elseif ($statut == self::STATUS_READ) {
|
||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket');
|
||||
}
|
||||
|
||||
elseif ($statut == 3) {
|
||||
elseif ($statut == self::STATUS_ASSIGNED) {
|
||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut2.png@ticket');
|
||||
}
|
||||
elseif ($statut == self::STATUS_IN_PROGRESS) {
|
||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket');
|
||||
}
|
||||
|
||||
elseif ($statut == 4) {
|
||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket');
|
||||
}
|
||||
|
||||
elseif ($statut == 5) {
|
||||
elseif ($statut == self::STATUS_NEED_MORE_INFO) {
|
||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket');
|
||||
}
|
||||
|
||||
elseif ($statut == 6) {
|
||||
elseif ($statut == self::STATUS_WAITING) {
|
||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket');
|
||||
}
|
||||
|
||||
elseif ($statut == 8) {
|
||||
elseif ($statut == self::STATUS_CLOSED) {
|
||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket');
|
||||
}
|
||||
|
||||
elseif ($statut == 9) {
|
||||
elseif ($statut == self::STATUS_CANCELED) {
|
||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket');
|
||||
}
|
||||
}
|
||||
@ -1645,6 +1617,8 @@ class Ticket extends CommonObject
|
||||
global $conf, $langs;
|
||||
$error = 0;
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
// Clean parameters
|
||||
if (isset($this->fk_track_id)) {
|
||||
$this->fk_track_id = trim($this->fk_track_id);
|
||||
@ -1654,38 +1628,33 @@ class Ticket extends CommonObject
|
||||
$this->message = trim($this->message);
|
||||
}
|
||||
|
||||
// Insert entry into agenda with code 'TICKET_MSG'
|
||||
$sql.='...';
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
dol_syslog(get_class($this) . "::create_ticket_message sql=" . $sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++;
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
}
|
||||
// Insert entry into agenda with code 'TICKET_MSG'
|
||||
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
$actioncomm=new ActionComm($this->db);
|
||||
$actioncomm->type_code = 'AC_OTH_AUTO';
|
||||
$actioncomm->code = 'TICKET_MSG';
|
||||
$actioncomm->socid = $this->socid;
|
||||
$actioncomm->label = $this->subject;
|
||||
$actioncomm->note = $this->message;
|
||||
$actioncomm->userassigned = array($user->id);
|
||||
$actioncomm->userownerid = $user->id;
|
||||
$actioncomm->datep = $now;
|
||||
$actioncomm->percentage = 100;
|
||||
$actioncomm->elementtype = 'ticket';
|
||||
$actioncomm->fk_element = $this->id;
|
||||
|
||||
if (!$error) {
|
||||
if (!$notrigger) {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
$actionid = $actioncomm->create($user);
|
||||
if ($actionid <= 0)
|
||||
{
|
||||
$error++;
|
||||
$this->error = $actioncomm->error;
|
||||
$this->errors = $actioncomm->errors;
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error) {
|
||||
foreach ($this->errors as $errmsg) {
|
||||
dol_syslog(get_class($this) . "::create_ticket_message " . $errmsg, LOG_ERR);
|
||||
$this->error .= ($this->error ? ', ' . $errmsg : $errmsg);
|
||||
}
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
} else {
|
||||
@ -2493,6 +2462,7 @@ class Ticket extends CommonObject
|
||||
$error = 0;
|
||||
|
||||
$ret = $object->fetch('', '', GETPOST('track_id', 'alpha'));
|
||||
|
||||
$object->socid = $object->fk_soc;
|
||||
$object->fetch_thirdparty();
|
||||
if ($ret < 0) {
|
||||
@ -2508,6 +2478,7 @@ class Ticket extends CommonObject
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$object->subject = GETPOST('subject', 'alphanohtml');
|
||||
$object->message = GETPOST("message", "none");
|
||||
$object->private = GETPOST("private_message", "alpha");
|
||||
$send_email = GETPOST('send_email', 'int');
|
||||
|
||||
|
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 234 B |
|
Before Width: | Height: | Size: 470 B After Width: | Height: | Size: 380 B |
|
Before Width: | Height: | Size: 419 B After Width: | Height: | Size: 419 B |
|
Before Width: | Height: | Size: 380 B After Width: | Height: | Size: 363 B |
|
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 329 B |
|
Before Width: | Height: | Size: 341 B After Width: | Height: | Size: 470 B |
|
Before Width: | Height: | Size: 272 B After Width: | Height: | Size: 341 B |
BIN
htdocs/ticket/img/statut9.png
Normal file
|
After Width: | Height: | Size: 272 B |