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->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 (! 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;
|
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=='facture') $this->elementtype='invoice';
|
||||||
if ($this->elementtype=='commande') $this->elementtype='order';
|
if ($this->elementtype=='commande') $this->elementtype='order';
|
||||||
if ($this->elementtype=='contrat') $this->elementtype='contract';
|
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 == 'member') $modulepart='memberphoto';
|
||||||
if ($object->element == 'user') $modulepart='userphoto';
|
if ($object->element == 'user') $modulepart='userphoto';
|
||||||
if ($object->element == 'product') $modulepart='product';
|
if ($object->element == 'product') $modulepart='product';
|
||||||
|
if ($object->element == 'ticket') $modulepart='ticket';
|
||||||
|
|
||||||
if (class_exists("Imagick"))
|
if (class_exists("Imagick"))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -58,9 +58,10 @@ Notify_TICKET_SENTBYMAIL=Send ticket message by email
|
|||||||
# Status
|
# Status
|
||||||
NotRead=Not read
|
NotRead=Not read
|
||||||
Read=Read
|
Read=Read
|
||||||
Answered=Answered
|
|
||||||
Assigned=Assigned
|
Assigned=Assigned
|
||||||
InProgress=In progress
|
InProgress=In progress
|
||||||
|
NeedMoreInformation=Waiting more information
|
||||||
|
Answered=Answered
|
||||||
Waiting=Waiting
|
Waiting=Waiting
|
||||||
Closed=Closed
|
Closed=Closed
|
||||||
Deleted=Deleted
|
Deleted=Deleted
|
||||||
|
|||||||
@ -125,103 +125,102 @@ if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/ticketnameonly/', $c
|
|||||||
$help_url = 'FR:DocumentationModuleTicket';
|
$help_url = 'FR:DocumentationModuleTicket';
|
||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
if ($socid > 0) {
|
if ($socid > 0) {
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
$head = societe_prepare_head($object->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) {
|
if (!$user->societe_id && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
|
||||||
$object->next_prev_filter = "te.fk_user_assign = '" . $user->id . "'";
|
$object->next_prev_filter = "te.fk_user_assign = '" . $user->id . "'";
|
||||||
} elseif ($user->societe_id > 0) {
|
} elseif ($user->societe_id > 0) {
|
||||||
$object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'";
|
$object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'";
|
||||||
}
|
}
|
||||||
$head = ticket_prepare_head($object);
|
$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 ='<div class="refidno">';
|
||||||
$morehtmlref.= $object->subject;
|
$morehtmlref.= $object->subject;
|
||||||
// Author
|
// Author
|
||||||
if ($object->fk_user_create > 0) {
|
if ($object->fk_user_create > 0) {
|
||||||
$morehtmlref .= '<br>' . $langs->trans("CreatedBy") . ' ';
|
$morehtmlref .= '<br>' . $langs->trans("CreatedBy") . ' : ';
|
||||||
|
|
||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
$fuser = new User($db);
|
$fuser = new User($db);
|
||||||
$fuser->fetch($object->fk_user_create);
|
$fuser->fetch($object->fk_user_create);
|
||||||
$morehtmlref .= $fuser->getNomUrl(0);
|
$morehtmlref .= $fuser->getNomUrl(0);
|
||||||
}
|
}
|
||||||
if (!empty($object->origin_email)) {
|
if (!empty($object->origin_email)) {
|
||||||
$morehtmlref .= '<br>' . $langs->trans("CreatedBy") . ' : ';
|
$morehtmlref .= '<br>' . $langs->trans("CreatedBy") . ' : ';
|
||||||
$morehtmlref .= $object->origin_email . ' <small>(' . $langs->trans("TicketEmailOriginIssuer") . ')</small>';
|
$morehtmlref .= $object->origin_email . ' <small>(' . $langs->trans("TicketEmailOriginIssuer") . ')</small>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
if (! empty($conf->societe->enabled))
|
if (! empty($conf->societe->enabled))
|
||||||
{
|
{
|
||||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty');
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty');
|
||||||
/*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->societe_id && $user->rights->ticket->write) {
|
/*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.='<a href="' . $url_page_current . '?action=editcustomer&track_id=' . $object->track_id . '">' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '</a>';
|
||||||
}*/
|
}*/
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'editcustomer') {
|
if ($action == 'editcustomer') {
|
||||||
$morehtmlref.=$form->form_thirdparty($url_page_current . '?track_id=' . $object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1);
|
$morehtmlref.=$form->form_thirdparty($url_page_current . '?track_id=' . $object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1);
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref.=$form->form_thirdparty($url_page_current . '?track_id=' . $object->track_id, $object->socid, 'none', '', 1, 0, 0, array(), 1);
|
$morehtmlref.=$form->form_thirdparty($url_page_current . '?track_id=' . $object->track_id, $object->socid, 'none', '', 1, 0, 0, array(), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$morehtmlref.='<br>'.$langs->trans('Project');
|
$morehtmlref.='<br>'.$langs->trans('Project');
|
||||||
if ($user->rights->ticket->write)
|
if ($user->rights->ticket->write)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
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->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.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
$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.=$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.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
$morehtmlref.='</form>';
|
$morehtmlref.='</form>';
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref.=$proj->getNomUrl(1);
|
$morehtmlref.=$proj->getNomUrl(1);
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref.='';
|
$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))
|
if (!empty($object->id))
|
||||||
{
|
{
|
||||||
print '<br>';
|
|
||||||
$param='&id='.$object->id;
|
$param='&id='.$object->id;
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
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>';
|
$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);
|
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">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
// Message list
|
// List of actions on element
|
||||||
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'messages@ticket');
|
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||||
$show_private_message = ($user->societe_id ? 0 : 1);
|
$formactions = new FormActions($db);
|
||||||
$actionobject->viewTicketTimelineMessages($show_private_message, true, $object);
|
$somethingshown = $formactions->showactions($object, 'ticket', $socid, 1);
|
||||||
|
|
||||||
print '</div></div>';
|
print '</div></div>';
|
||||||
print '</div><!-- fichecenter -->';
|
print '</div><!-- fichecenter -->';
|
||||||
|
|||||||
@ -443,8 +443,7 @@ class ActionsTicket
|
|||||||
// Sort results to be similar to status object list
|
// Sort results to be similar to status object list
|
||||||
//sort($exclude_status);
|
//sort($exclude_status);
|
||||||
|
|
||||||
//print '<br><div>';
|
foreach ($object->statuts_short as $status => $status_label) {
|
||||||
foreach ($object->statuts_short as $status => $statut_label) {
|
|
||||||
if (!in_array($status, $exclude_status)) {
|
if (!in_array($status, $exclude_status)) {
|
||||||
print '<div class="tagtd">';
|
print '<div class="tagtd">';
|
||||||
|
|
||||||
|
|||||||
@ -207,10 +207,10 @@ class Ticket extends CommonObject
|
|||||||
*/
|
*/
|
||||||
const STATUS_NOT_READ = 0;
|
const STATUS_NOT_READ = 0;
|
||||||
const STATUS_READ = 1;
|
const STATUS_READ = 1;
|
||||||
const STATUS_ANSWERED = 3;
|
const STATUS_ASSIGNED = 2;
|
||||||
const STATUS_ASSIGNED = 4;
|
const STATUS_IN_PROGRESS = 3;
|
||||||
const STATUS_IN_PROGRESS = 5;
|
const STATUS_NEED_MORE_INFO = 5;
|
||||||
const STATUS_WAITING = 6;
|
const STATUS_WAITING = 7;
|
||||||
const STATUS_CLOSED = 8;
|
const STATUS_CLOSED = 8;
|
||||||
const STATUS_CANCELED = 9;
|
const STATUS_CANCELED = 9;
|
||||||
|
|
||||||
@ -224,8 +224,8 @@ class Ticket extends CommonObject
|
|||||||
{
|
{
|
||||||
$this->db = $db;
|
$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_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(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'Closed', 9 => 'Deleted');
|
$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
|
* Return status label of object
|
||||||
*
|
*
|
||||||
* @param string $statut id statut
|
* @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
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
public function LibStatut($statut, $mode = 0)
|
public function LibStatut($statut, $mode = 0)
|
||||||
@ -1191,134 +1191,106 @@ class Ticket extends CommonObject
|
|||||||
return $langs->trans($this->statuts_short[$statut]);
|
return $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
elseif ($mode == 2) {
|
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]);
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_READ) {
|
||||||
elseif ($statut == 1) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_ASSIGNED) {
|
||||||
elseif ($statut == 3) {
|
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]);
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_NEED_MORE_INFO) {
|
||||||
elseif ($statut == 4) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
|
||||||
}
|
|
||||||
|
|
||||||
elseif ($statut == 5) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_WAITING) {
|
||||||
elseif ($statut == 6) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_CLOSED) {
|
||||||
elseif ($statut == 8) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_CANCELED) {
|
||||||
elseif ($statut == 9) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($mode == 3) {
|
elseif ($mode == 3) {
|
||||||
if ($statut == 0) {
|
if ($statut == self::STATUS_NOT_READ) {
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket');
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket');
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_READ) {
|
||||||
elseif ($statut == 1) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket');
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket');
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_ASSIGNED) {
|
||||||
elseif ($statut == 3) {
|
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');
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket');
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_NEED_MORE_INFO) {
|
||||||
elseif ($statut == 4) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket');
|
|
||||||
}
|
|
||||||
|
|
||||||
elseif ($statut == 5) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket');
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket');
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_WAITING) {
|
||||||
elseif ($statut == 6) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket');
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket');
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_CLOSED) {
|
||||||
elseif ($statut == 8) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket');
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket');
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_CANCELED) {
|
||||||
elseif ($statut == 9) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket');
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($mode == 4) {
|
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]);
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_READ) {
|
||||||
elseif ($statut == 1) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_ASSIGNED) {
|
||||||
elseif ($statut == 3) {
|
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]);
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_NEED_MORE_INFO) {
|
||||||
elseif ($statut == 4) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
|
||||||
}
|
|
||||||
|
|
||||||
elseif ($statut == 5) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_WAITING) {
|
||||||
elseif ($statut == 6) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_CLOSED) {
|
||||||
elseif ($statut == 8) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_CANCELED) {
|
||||||
elseif ($statut == 9) {
|
|
||||||
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($mode == 5) {
|
elseif ($mode == 5 || $mode == 6) {
|
||||||
if ($statut == 0) {
|
if ($statut == self::STATUS_NOT_READ) {
|
||||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket');
|
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket');
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_READ) {
|
||||||
elseif ($statut == 1) {
|
|
||||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket');
|
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket');
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_ASSIGNED) {
|
||||||
elseif ($statut == 3) {
|
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');
|
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket');
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_NEED_MORE_INFO) {
|
||||||
elseif ($statut == 4) {
|
|
||||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket');
|
|
||||||
}
|
|
||||||
|
|
||||||
elseif ($statut == 5) {
|
|
||||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket');
|
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket');
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_WAITING) {
|
||||||
elseif ($statut == 6) {
|
|
||||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket');
|
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket');
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_CLOSED) {
|
||||||
elseif ($statut == 8) {
|
|
||||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket');
|
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket');
|
||||||
}
|
}
|
||||||
|
elseif ($statut == self::STATUS_CANCELED) {
|
||||||
elseif ($statut == 9) {
|
|
||||||
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket');
|
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;
|
global $conf, $langs;
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
|
$now = dol_now();
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (isset($this->fk_track_id)) {
|
if (isset($this->fk_track_id)) {
|
||||||
$this->fk_track_id = trim($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);
|
$this->message = trim($this->message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert entry into agenda with code 'TICKET_MSG'
|
|
||||||
$sql.='...';
|
|
||||||
|
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::create_ticket_message sql=" . $sql, LOG_DEBUG);
|
// Insert entry into agenda with code 'TICKET_MSG'
|
||||||
$resql = $this->db->query($sql);
|
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||||
if (!$resql) {
|
$actioncomm=new ActionComm($this->db);
|
||||||
$error++;
|
$actioncomm->type_code = 'AC_OTH_AUTO';
|
||||||
$this->errors[] = "Error " . $this->db->lasterror();
|
$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) {
|
$actionid = $actioncomm->create($user);
|
||||||
if (!$notrigger) {
|
if ($actionid <= 0)
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
{
|
||||||
// want this action calls a trigger.
|
$error++;
|
||||||
//// Call triggers
|
$this->error = $actioncomm->error;
|
||||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
$this->errors = $actioncomm->errors;
|
||||||
//$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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error) {
|
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();
|
$this->db->rollback();
|
||||||
return -1 * $error;
|
return -1 * $error;
|
||||||
} else {
|
} else {
|
||||||
@ -2493,6 +2462,7 @@ class Ticket extends CommonObject
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$ret = $object->fetch('', '', GETPOST('track_id', 'alpha'));
|
$ret = $object->fetch('', '', GETPOST('track_id', 'alpha'));
|
||||||
|
|
||||||
$object->socid = $object->fk_soc;
|
$object->socid = $object->fk_soc;
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
if ($ret < 0) {
|
if ($ret < 0) {
|
||||||
@ -2508,6 +2478,7 @@ class Ticket extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
|
$object->subject = GETPOST('subject', 'alphanohtml');
|
||||||
$object->message = GETPOST("message", "none");
|
$object->message = GETPOST("message", "none");
|
||||||
$object->private = GETPOST("private_message", "alpha");
|
$object->private = GETPOST("private_message", "alpha");
|
||||||
$send_email = GETPOST('send_email', 'int');
|
$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 |