28 require
'../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/actions_ticket.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formticket.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/ticket.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
38 include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
39 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
40 include_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
43 include_once DOL_DOCUMENT_ROOT.
'/core/lib/contract.lib.php';
44 include_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
45 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcontract.class.php';
49 $langs->loadLangs(array(
"companies",
"other",
"ticket"));
53 $socid =
GETPOST(
'socid',
'int');
54 $track_id =
GETPOST(
'track_id',
'alpha', 3);
56 $projectid =
GETPOST(
'projectid',
'int');
57 $cancel =
GETPOST(
'cancel',
'alpha');
58 $action =
GETPOST(
'action',
'aZ09');
59 $backtopage =
GETPOST(
'backtopage',
'alpha');
60 $contactid =
GETPOST(
'contactid',
'int');
62 $notifyTiers =
GETPOST(
"notify_tiers_at_create",
'alpha');
64 $sortfield =
GETPOST(
'sortfield',
'aZ09comma') ?
GETPOST(
'sortfield',
'aZ09comma') :
"a.datep";
65 $sortorder =
GETPOST(
'sortorder',
'aZ09comma') ?
GETPOST(
'sortorder',
'aZ09comma') :
"desc";
67 if (
GETPOST(
'actioncode',
'array')) {
68 $actioncode =
GETPOST(
'actioncode',
'array', 3);
69 if (!count($actioncode)) {
73 $actioncode =
GETPOST(
"actioncode",
"alpha", 3) ?
GETPOST(
"actioncode",
"alpha", 3) : (
GETPOST(
"actioncode") ==
'0' ?
'0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ?
'' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
75 $search_agenda_label =
GETPOST(
'search_agenda_label');
78 $hookmanager->initHooks(array(
'ticketcard',
'globalcard'));
84 $extrafields->fetch_name_optionals_label($object->table_element);
86 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
89 $search_all =
GETPOST(
"search_all",
'alpha');
91 foreach ($object->fields as $key => $val) {
92 if (
GETPOST(
'search_'.$key,
'alpha')) {
93 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
97 if (empty($action) && empty($id) && empty($ref)) {
102 if (
GETPOST(
'modelselected',
'alpha')) {
108 if ($id || $track_id || $ref) {
109 $res = $object->fetch($id, $ref, $track_id);
112 $track_id = $object->track_id;
117 $url_page_current = DOL_URL_ROOT.
'/ticket/card.php';
120 if ($user->socid > 0) $socid = $user->socid;
123 $triggermodname =
'TICKET_MODIFY';
124 $permissiontoadd = $user->rights->ticket->write;
136 $reshook = $hookmanager->executeHooks(
'doActions',
$parameters, $object, $action);
142 if (empty($reshook)) {
144 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
146 $search_agenda_label =
'';
149 $backurlforlist = DOL_URL_ROOT.
'/ticket/list.php';
151 if (empty($backtopage) || ($cancel && empty($id))) {
152 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
153 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
154 $backtopage = $backurlforlist;
156 $backtopage = DOL_URL_ROOT.
'/ticket/card.php?id='.((!empty($id) && $id > 0) ? $id :
'__ID__');
162 if (!empty($backtopageforcancel)) {
163 header(
"Location: ".$backtopageforcancel);
165 } elseif (!empty($backtopage)) {
166 header(
"Location: ".$backtopage);
173 if (
GETPOST(
'save',
'alpha') && !empty($user->rights->ticket->write)) {
176 if (!
GETPOST(
"subject",
'alphanohtml')) {
178 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Subject")),
null,
'errors');
180 } elseif (!
GETPOST(
"message",
'restricthtml')) {
182 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Message")),
null,
'errors');
185 $ret = $extrafields->setOptionalsFromPost(
null, $object);
193 $object->ref =
GETPOST(
"ref",
'alphanohtml');
194 $object->fk_soc =
GETPOST(
"socid",
'int') > 0 ?
GETPOST(
"socid",
'int') : 0;
195 $object->subject =
GETPOST(
"subject",
'alphanohtml');
196 $object->message =
GETPOST(
"message",
'restricthtml');
198 $object->type_code =
GETPOST(
"type_code",
'alpha');
199 $object->type_label = $langs->trans($langs->getLabelFromKey($db, $object->type_code,
'c_ticket_type',
'code',
'label'));
200 $object->category_code =
GETPOST(
"category_code",
'alpha');
201 $object->category_label = $langs->trans($langs->getLabelFromKey($db, $object->category_code,
'c_ticket_category',
'code',
'label'));
202 $object->severity_code =
GETPOST(
"severity_code",
'alpha');
203 $object->severity_label = $langs->trans($langs->getLabelFromKey($db, $object->severity_code,
'c_ticket_severity',
'code',
'label'));
204 $object->email_from = $user->email;
205 $notifyTiers =
GETPOST(
"notify_tiers_at_create",
'alpha');
206 $object->notify_tiers_at_create = empty($notifyTiers) ? 0 : 1;
207 $fk_user_assign =
GETPOST(
"fk_user_assign",
'int');
208 if ($fk_user_assign > 0) {
209 $object->fk_user_assign = $fk_user_assign;
210 $object->status = $object::STATUS_ASSIGNED;
213 $object->fk_project = $projectid;
215 $id = $object->create($user);
224 $contactid =
GETPOST(
'contactid',
'int');
225 $type_contact =
GETPOST(
"type",
'alpha');
228 $categories =
GETPOST(
'categories',
'array');
229 $object->setCategories($categories);
231 if ($contactid > 0 && $type_contact) {
233 $result = $object->add_contact($contactid, $typeid,
'external');
237 if (
GETPOST(
'origin',
'alpha') ==
'projet') {
238 $projectid =
GETPOST(
'originid',
'int');
240 $projectid =
GETPOST(
'projectid',
'int');
243 if ($projectid > 0) {
244 $object->setProject($projectid);
248 if (!empty($conf->global->TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND) && $user->rights->ticket->write) {
249 if ( ! $object->markAsRead($user) > 0) {
255 if (!empty($conf->global->TICKET_AUTO_ASSIGN_USER_CREATE)) {
256 $result = $object->assignUser($user, $user->id, 1);
257 $object->add_contact($user->id,
"SUPPORTTEC",
'internal');
263 $object->copyFilesForTicket(
'');
269 if (!empty($backtopage)) {
273 $url =
'card.php?track_id='.urlencode($object->track_id);
276 $url =
'card.php?track_id='.urlencode($object->track_id);
279 header(
"Location: ".$url);
290 if ($action ==
'update' && $user->rights->ticket->write && $object->status < Ticket::STATUS_CLOSED) {
296 array_push($object->errors, $langs->trans(
'ErrorTicketIsNotValid'));
301 if (!
GETPOST(
'subject',
'alpha')) {
303 array_push($object->errors, $langs->trans(
'ErrorFieldRequired', $langs->transnoentities(
'Subject')));
305 $ret = $extrafields->setOptionalsFromPost(
null, $object);
314 $object->subject =
GETPOST(
'subject',
'alpha');
315 $object->type_code =
GETPOST(
'type_code',
'alpha');
316 $object->category_code =
GETPOST(
'category_code',
'alpha');
317 $object->severity_code =
GETPOST(
'severity_code',
'alpha');
319 $ret = $object->update($user);
322 $categories =
GETPOST(
'categories',
'array');
323 $object->setCategories($categories);
339 if (!empty($backtopage)) {
343 $url =
'card.php?track_id='.urlencode($object->track_id);
346 $url =
'card.php?track_id='.urlencode($object->track_id);
349 header(
'Location: '.$url);
355 if ($action ==
"mark_ticket_read" && $user->rights->ticket->write) {
356 $object->fetch(
'',
'',
GETPOST(
"track_id",
'alpha'));
358 if ($object->markAsRead($user) > 0) {
361 header(
"Location: card.php?track_id=".$object->track_id.
"&action=view");
370 if ($action ==
"assign_user" &&
GETPOST(
'btn_assign_user',
'alpha') && $user->rights->ticket->write) {
371 $object->fetch(
'',
'',
GETPOST(
"track_id",
'alpha'));
372 $useroriginassign = $object->fk_user_assign;
373 $usertoassign =
GETPOST(
'fk_user_assign',
'int');
382 $ret = $object->assignUser($user, $usertoassign);
390 if ($useroriginassign > 0) {
391 $internal_contacts = $object->listeContact(-1,
'internal', 0,
'SUPPORTTEC');
392 foreach ($internal_contacts as $key => $contact) {
393 if ($contact[
'id'] !== $usertoassign) {
394 $result = $object->delete_contact($contact[
'rowid']);
403 if ($usertoassign > 0 && $usertoassign!==$useroriginassign) {
404 $result = $object->add_contact($usertoassign,
"SUPPORTTEC",
'internal', $notrigger = 0);
414 $object->fetch_user($usertoassign);
419 header(
"Location: card.php?track_id=".$object->track_id.
"&action=view");
422 array_push($object->errors, $object->error);
428 if ($action ==
'add_message' &&
GETPOSTISSET(
'btn_add_message') && $user->rights->ticket->read) {
429 $ret = $object->newMessage($user, $action, (
GETPOST(
'private_message',
'alpha') ==
"on" ? 1 : 0));
432 if (!empty($backtopage)) {
436 $url =
'card.php?track_id='.urlencode($object->track_id);
439 $url =
'card.php?action=view&track_id='.urlencode($object->track_id);
442 header(
"Location: ".$url);
450 if (($action ==
"confirm_close" || $action ==
"confirm_abandon") &&
GETPOST(
'confirm',
'alpha') ==
'yes' && $user->rights->ticket->write) {
451 $object->fetch(
GETPOST(
'id',
'int'),
'',
GETPOST(
'track_id',
'alpha'));
453 if ($object->close($user, ($action ==
"confirm_abandon" ? 1 : 0))) {
456 $url =
'card.php?action=view&track_id='.GETPOST(
'track_id',
'alpha');
457 header(
"Location: ".$url);
464 if ($action ==
"confirm_public_close" &&
GETPOST(
'confirm',
'alpha') ==
'yes') {
465 $object->fetch(
GETPOST(
'id',
'int'),
'',
GETPOST(
'track_id',
'alpha'));
466 if ($_SESSION[
'email_customer'] == $object->origin_email || $_SESSION[
'email_customer'] == $object->thirdparty->email) {
467 $object->close($user);
472 setEventMessages(
'<div class="confirm">'.$langs->trans(
'TicketMarkedAsClosed').
'</div>',
null,
'mesgs');
474 $url =
'card.php?action=view_ticket&track_id='.GETPOST(
'track_id',
'alpha');
475 header(
"Location: ".$url);
482 if ($action ==
'confirm_delete_ticket' &&
GETPOST(
'confirm',
'alpha') ==
"yes" && $user->rights->ticket->delete) {
483 if ($object->fetch(
GETPOST(
'id',
'int'),
'',
GETPOST(
'track_id',
'alpha')) >= 0) {
484 if ($object->delete($user) > 0) {
485 setEventMessages(
'<div class="confirm">'.$langs->trans(
'TicketDeletedSuccess').
'</div>',
null,
'mesgs');
486 Header(
"Location: ".DOL_URL_ROOT.
"/ticket/list.php");
489 $langs->load(
"errors");
490 $mesg =
'<div class="error">'.$langs->trans($object->error).
'</div>';
497 if ($action ==
'set_thirdparty' && $user->rights->ticket->write) {
498 if ($object->fetch(
GETPOST(
'id',
'int'),
'',
GETPOST(
'track_id',
'alpha')) >= 0) {
499 $result = $object->setCustomer(
GETPOST(
'editcustomer',
'int'));
500 $url =
'card.php?action=view&track_id='.GETPOST(
'track_id',
'alpha');
501 header(
"Location: ".$url);
506 if ($action ==
'set_progression' && $user->rights->ticket->write) {
507 if ($object->fetch(
GETPOST(
'id',
'int'),
'',
GETPOST(
'track_id',
'alpha')) >= 0) {
508 $result = $object->setProgression(
GETPOST(
'progress',
'alpha'));
510 $url =
'card.php?action=view&track_id='.$object->track_id;
511 header(
"Location: ".$url);
516 if ($action ==
'set_categories' && $user->rights->ticket->write) {
517 if ($object->fetch(
GETPOST(
'id',
'int'),
'',
GETPOST(
'track_id',
'alpha')) >= 0) {
518 $result = $object->setCategories(
GETPOST(
'categories',
'array'));
520 $url =
'card.php?action=view&track_id='.$object->track_id;
521 header(
"Location: ".$url);
526 if ($action ==
'setsubject' && $user->rights->ticket->write) {
527 if ($object->fetch(
GETPOST(
'id',
'int'))) {
528 if ($action ==
'setsubject') {
529 $object->subject =
GETPOST(
'subject',
'alphanohtml');
532 if ($action ==
'setsubject' && empty($object->subject)) {
534 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Subject")),
null,
'errors');
538 if ($object->update($user) >= 0) {
539 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?track_id=".$object->track_id);
549 if ($action ==
'confirm_reopen' && $user->rights->ticket->manage && !
GETPOST(
'cancel')) {
550 if ($object->fetch(
GETPOST(
'id',
'int'),
'',
GETPOST(
'track_id',
'alpha')) >= 0) {
552 if ($object->status == Ticket::STATUS_CLOSED || $object->status == Ticket::STATUS_CANCELED) {
553 $res = $object->setStatut(Ticket::STATUS_ASSIGNED);
558 $url =
'card.php?action=view&track_id='.$object->track_id;
559 header(
"Location: ".$url);
567 } elseif ($action ==
'classin' && $user->rights->ticket->write) {
569 if ($object->fetch(
GETPOST(
'id',
'int'),
'',
GETPOST(
'track_id',
'alpha')) >= 0) {
570 $object->setProject($projectid);
571 $url =
'card.php?action=view&track_id='.$object->track_id;
572 header(
"Location: ".$url);
575 } elseif ($action ==
'setcontract' && $user->rights->ticket->write) {
577 if ($object->fetch(
GETPOST(
'id',
'int'),
'',
GETPOST(
'track_id',
'alpha')) >= 0) {
578 $object->setContract(
GETPOST(
'contractid',
'int'));
579 $url =
'card.php?action=view&track_id='.$object->track_id;
580 header(
"Location: ".$url);
583 } elseif ($action ==
"set_message" && $user->rights->ticket->manage) {
586 $object->fetch(
'',
'',
GETPOST(
'track_id',
'alpha'));
587 $oldvalue_message = $object->message;
588 $fieldtomodify =
GETPOST(
'message_initial',
'restricthtml');
590 $object->message = $fieldtomodify;
591 $ret = $object->update($user);
595 include_once DOL_DOCUMENT_ROOT.
'/core/class/utils_diff.class.php';
599 setEventMessages($langs->trans(
'TicketMessageSuccesfullyUpdated'),
null,
'mesgs');
607 } elseif ($action ==
'confirm_set_status' && $user->rights->ticket->write && !
GETPOST(
'cancel')) {
609 if ($object->fetch(
GETPOST(
'id',
'int'),
GETPOST(
'track_id',
'alpha')) >= 0) {
610 $new_status =
GETPOST(
'new_status',
'int');
611 $old_status = $object->status;
612 $res = $object->setStatut($new_status);
615 $log_action = $langs->trans(
'TicketLogStatusChanged', $langs->transnoentities($object->statuts_short[$old_status]), $langs->transnoentities($object->statuts_short[$new_status]));
617 $url =
'card.php?action=view&track_id='.$object->track_id;
618 header(
"Location: ".$url);
628 if ($action ==
"update_extras" && !empty($permissiontoadd)) {
629 $object->fetch(
GETPOST(
'id',
'int'),
'',
GETPOST(
'track_id',
'alpha'));
631 $ret = $extrafields->setOptionalsFromPost(
null, $object,
GETPOST(
'attribute',
'restricthtml'));
637 $result = $object->insertExtraFields(empty($triggermodname) ?
'' : $triggermodname, $user);
645 $action =
'edit_extras';
652 if ($action ==
"change_property" &&
GETPOST(
'btn_update_ticket_prop',
'alpha') && $user->rights->ticket->write) {
653 $object->fetch(
GETPOST(
'id',
'int'),
'',
GETPOST(
'track_id',
'alpha'));
655 $object->type_code =
GETPOST(
'update_value_type',
'aZ09');
656 $object->severity_code =
GETPOST(
'update_value_severity',
'aZ09');
657 $object->category_code =
GETPOST(
'update_value_category',
'aZ09');
659 $ret = $object->update($user);
672 $permissiondellink = $user->rights->ticket->write;
673 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
676 $upload_dir = $conf->ticket->dir_output;
677 $permissiontoadd = $user->rights->ticket->write;
678 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
681 $triggersendname =
'TICKET_SENTBYMAIL';
683 $autocopy =
'MAIN_MAIL_AUTOCOPY_TICKET_TO';
684 $trackid =
'tic'.$object->id;
685 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
688 if (
GETPOSTISSET(
'actionbis') && $action ==
'presend') {
689 $action =
'presend_addmessage';
698 $userstat =
new User($db);
705 $help_url =
'EN:Module_Ticket|FR:DocumentationModuleTicket';
707 $page_title = $actionobject->getTitle($action);
711 if ($action ==
'create' || $action ==
'presend') {
716 $formticket->trackid =
'';
717 $formticket->withfromsocid = $socid ? $socid : $user->socid;
718 $formticket->withfromcontactid = $contactid ? $contactid :
'';
719 $formticket->withtitletopic = 1;
720 $formticket->withnotifytiersatcreate = ($notifyTiers ? 1 : (empty($conf->global->TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION) ? 0 : 1));
721 $formticket->withusercreate = 0;
722 $formticket->withref = 1;
723 $formticket->fk_user_create = $user->id;
724 $formticket->withfile = 2;
725 $formticket->withextrafields = 1;
726 $formticket->param = array(
'origin' =>
GETPOST(
'origin'),
'originid' =>
GETPOST(
'originid'));
728 $formticket->withcancel = 1;
730 $formticket->showForm(1,
'create', 0,
null, $action);
782 } elseif (empty($action) || $action ==
'view' || $action ==
'addlink' || $action ==
'dellink' || $action ==
'presend' || $action ==
'presend_addmessage' || $action ==
'close' || $action ==
'abandon' || $action ==
'delete' || $action ==
'editcustomer' || $action ==
'progression' || $action ==
'categories' || $action ==
'reopen'
783 || $action ==
'editsubject' || $action ==
'edit_extras' || $action ==
'update_extras' || $action ==
'edit_extrafields' || $action ==
'set_extrafields' || $action ==
'classify' || $action ==
'sel_contract' || $action ==
'edit_message_init' || $action ==
'set_status' || $action ==
'dellink') {
786 if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
791 if ($action ==
'close') {
792 $thirdparty_contacts = $object->getInfosTicketExternalContact();
793 $contacts_select = array(
794 '-2' => $langs->trans(
'TicketNotifyAllTiersAtClose'),
795 '-3' => $langs->trans(
'TicketNotNotifyTiersAtClose')
797 foreach ($thirdparty_contacts as $thirdparty_contact) {
798 $contacts_select[$thirdparty_contact[
'id']] = $thirdparty_contact[
'civility'] .
' ' . $thirdparty_contact[
'lastname'] .
' ' . $thirdparty_contact[
'firstname'];
802 $default = (!empty($conf->global->TICKET_NOTIFY_AT_CLOSING)) ? -2 : -3;
803 $formquestion = array(
805 'name' =>
'contactid',
807 'label' => $langs->trans(
'NotifyThirdpartyOnTicketClosing'),
808 'values' => $contacts_select,
809 'default' => $default
813 print
$form->formconfirm($url_page_current.
"?track_id=".$object->track_id, $langs->trans(
"CloseATicket"), $langs->trans(
"ConfirmCloseAticket"),
"confirm_close", $formquestion,
'', 1);
816 if ($action ==
'abandon') {
817 print
$form->formconfirm($url_page_current.
"?track_id=".$object->track_id, $langs->trans(
"AbandonTicket"), $langs->trans(
"ConfirmAbandonTicket"),
"confirm_abandon",
'',
'', 1);
818 if ($ret ==
'html') {
823 if ($action ==
'delete') {
824 print
$form->formconfirm($url_page_current.
"?track_id=".$object->track_id, $langs->trans(
"Delete"), $langs->trans(
"ConfirmDeleteTicket"),
"confirm_delete_ticket",
'',
'', 1);
827 if ($action ==
'reopen') {
828 print
$form->formconfirm($url_page_current.
'?track_id='.$object->track_id, $langs->trans(
'ReOpen'), $langs->trans(
'ConfirmReOpenTicket'),
'confirm_reopen',
'',
'', 1);
831 if ($action ==
'set_status') {
832 $new_status =
GETPOST(
'new_status');
834 print
$form->formconfirm($url_page_current.
"?track_id=".$object->track_id.
"&new_status=".
GETPOST(
'new_status'), $langs->trans(
"TicketChangeStatus"), $langs->trans(
"TicketConfirmChangeStatus", $langs->transnoentities($object->statuts_short[$new_status])),
"confirm_set_status",
'',
'', 1);
838 if ($projectid > 0) {
839 $projectstat =
new Project($db);
840 if ($projectstat->fetch($projectid) > 0) {
841 $projectstat->fetch_thirdparty();
845 $userWrite = $projectstat->restrictedProjectArea($user,
'write');
851 print
dol_get_fiche_head($head,
'ticket', $langs->trans(
"Project"), 0, ($projectstat->public ?
'projectpub' :
'project'));
856 print
'<table class="border centpercent">';
858 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
861 print
'<tr><td width="30%">'.$langs->trans(
'Ref').
'</td><td colspan="3">';
863 if (empty($user->rights->projet->all->lire)) {
864 $objectsListId = $projectstat->getProjectsAuthorizedForUser($user, $mine, 0);
865 $projectstat->next_prev_filter =
" rowid IN (".$db->sanitize(count($objectsListId) ? join(
',', array_keys($objectsListId)) :
'0').
")";
867 print
$form->showrefnav($projectstat,
'ref', $linkback, 1,
'ref',
'ref',
'');
871 print
'<tr><td>'.$langs->trans(
"Label").
'</td><td>'.$projectstat->title.
'</td></tr>';
874 print
"<tr><td>".$langs->trans(
"ThirdParty").
"</td>";
875 print
'<td colspan="3">';
876 if ($projectstat->thirdparty->id > 0) {
877 print $projectstat->thirdparty->getNomUrl(1);
885 print
'<tr><td>'.$langs->trans(
"Visibility").
'</td><td>';
886 if ($projectstat->public) {
887 print $langs->trans(
'SharedProject');
889 print $langs->trans(
'PrivateProject');
895 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>'.$projectstat->getLibStatut(4).
'</td></tr>';
901 print
"ErrorRecordNotFound";
903 } elseif ($socid > 0) {
904 $object->fetch_thirdparty();
909 dol_banner_tab($object->thirdparty,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom');
914 if (!$user->socid && !empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) {
915 $object->next_prev_filter =
"te.fk_user_assign = '".$user->id.
"'";
916 } elseif ($user->socid > 0) {
917 $object->next_prev_filter =
"te.fk_soc = '".$user->socid.
"'";
924 $morehtmlref =
'<div class="refidno">';
925 $morehtmlref .= $object->subject;
927 if ($object->fk_user_create > 0) {
928 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
930 $fuser =
new User($db);
931 $fuser->fetch($object->fk_user_create);
932 $morehtmlref .= $fuser->getNomUrl(-1);
933 } elseif (!empty($object->email_msgid)) {
934 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
935 $morehtmlref .=
img_picto(
'',
'email',
'class="paddingrightonly"');
936 $morehtmlref .=
dol_escape_htmltag($object->origin_email).
' <small class="hideonsmartphone opacitymedium">('.
$form->textwithpicto($langs->trans(
"CreatedByEmailCollector"), $langs->trans(
"EmailMsgID").
': '.$object->email_msgid).
')</small>';
937 } elseif (!empty($object->origin_email)) {
938 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
939 $morehtmlref .=
img_picto(
'',
'email',
'class="paddingrightonly"');
940 $morehtmlref .=
dol_escape_htmltag($object->origin_email).
' <small class="hideonsmartphone opacitymedium">('.$langs->trans(
"CreatedByPublicPortal").
')</small>';
945 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty').
' ';
946 if ($action !=
'editcustomer' && $object->status < 8 && !$user->socid && $user->rights->ticket->write) {
947 $morehtmlref .=
'<a class="editfielda" href="'.$url_page_current.
'?action=editcustomer&token='.
newToken().
'&track_id='.$object->track_id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'Edit'), 0).
'</a> : ';
949 if ($action ==
'editcustomer') {
950 $morehtmlref .=
$form->form_thirdparty($url_page_current.
'?track_id='.$object->track_id, $object->socid,
'editcustomer',
'', 1, 0, 0, array(), 1);
952 $morehtmlref .=
$form->form_thirdparty($url_page_current.
'?track_id='.$object->track_id, $object->socid,
'none',
'', 1, 0, 0, array(), 1);
958 $langs->load(
"projects");
959 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
960 if ($user->rights->ticket->write) {
961 if ($action !=
'classify') {
962 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a>';
964 $morehtmlref .=
' : ';
965 if ($action ==
'classify') {
967 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
968 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
969 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
970 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', 0, 0, 1, 1, 1, 0, 0,
'', 1, 0,
'maxwidth500');
971 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
972 $morehtmlref .=
'</form>';
974 $morehtmlref .=
$form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
977 if (!empty($object->fk_project)) {
979 $proj->fetch($object->fk_project);
980 $morehtmlref .= $proj->getNomUrl(1);
987 $morehtmlref .=
'</div>';
989 $linkback =
'<a href="'.DOL_URL_ROOT.
'/ticket/list.php?restore_lastsearch_values=1"><strong>'.$langs->trans(
"BackToList").
'</strong></a> ';
991 dol_banner_tab($object,
'ref', $linkback, ($user->socid ? 0 : 1),
'ref',
'ref', $morehtmlref);
993 print
'<div class="fichecenter">';
994 print
'<div class="fichehalfleft">';
995 print
'<div class="underbanner clearboth"></div>';
997 print
'<table class="border tableforfield centpercent">';
1000 print
'<tr><td class="titlefield">'.$langs->trans(
"TicketTrackId").
'</td><td>';
1001 if (!empty($object->track_id)) {
1002 if (empty($object->ref)) {
1003 $object->ref = $object->id;
1004 print
$form->showrefnav($object,
'id', $linkback, 1,
'rowid',
'track_id');
1006 print $object->track_id;
1009 print $langs->trans(
'None');
1015 print
$form->editfieldkey(
"Subject",
'subject', $object->subject, $object, $user->rights->ticket->write && !$user->socid,
'string');
1017 print
$form->editfieldval(
"Subject",
'subject', $object->subject, $object, $user->rights->ticket->write && !$user->socid,
'string');
1021 print
'<tr><td>'.$langs->trans(
"DateCreation").
'</td><td>';
1044 print
'<tr><td>'.$langs->trans(
"TicketReadOn").
'</td><td>';
1045 if (!empty($object->date_read)) {
1048 print
' / <i>'.convertSecondToTime(
roundUpToNextMultiple($now - $object->date_read, 60)).
'</i></span>';
1053 print
'<tr><td>'.$langs->trans(
"TicketCloseOn").
'</td><td>';
1054 if (!empty($object->date_close)) {
1061 print
'<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
1062 print $langs->trans(
"AssignedTo");
1063 if (isset($object->status) && $object->status < $object::STATUS_CLOSED &&
GETPOST(
'set',
'alpha') !=
"assign_ticket" && $user->rights->ticket->manage) {
1064 print
'</td><td class="right"><a class="editfielda" href="'.$url_page_current.
'?track_id='.$object->track_id.
'&action=view&set=assign_ticket">'.
img_edit($langs->trans(
'Modify'),
'').
'</a>';
1066 print
'</td></tr></table>';
1068 if (
GETPOST(
'set',
'alpha') !=
"assign_ticket" && $object->fk_user_assign > 0) {
1069 $userstat->fetch($object->fk_user_assign);
1070 print $userstat->getNomUrl(-1);
1074 if (
GETPOST(
'set',
'alpha') ==
"assign_ticket" && $object->status < 8 && !$user->socid && $user->rights->ticket->write) {
1075 print
'<form method="post" name="ticket" enctype="multipart/form-data" action="'.$url_page_current.
'">';
1076 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1077 print
'<input type="hidden" name="action" value="assign_user">';
1078 print
'<input type="hidden" name="track_id" value="'.$object->track_id.
'">';
1080 print
$form->select_dolusers(empty($object->fk_user_assign)?$user->id:$object->fk_user_assign,
'fk_user_assign', 1);
1081 print
' <input type="submit" class="button small" name="btn_assign_user" value="'.$langs->trans(
"Validate").
'" />';
1088 print
'<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
1089 print $langs->trans(
'Progression').
'</td><td class="left">';
1091 if ($action !=
'progression' && isset($object->status) && $object->status < $object::STATUS_CLOSED && !$user->socid) {
1092 print
'<td class="right"><a class="editfielda" href="'.$url_page_current.
'?action=progression&track_id='.$object->track_id.
'">'.
img_edit($langs->trans(
'Modify')).
'</a></td>';
1094 print
'</tr></table>';
1096 if ($user->rights->ticket->write && $action ==
'progression') {
1097 print
'<form action="'.$url_page_current.
'" method="post">';
1098 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1099 print
'<input type="hidden" name="track_id" value="'.$track_id.
'">';
1100 print
'<input type="hidden" name="action" value="set_progression">';
1101 print
'<input type="text" class="flat width75" name="progress" value="'.$object->progress.
'">';
1102 print
' <input type="submit" class="button button-edit small" value="'.$langs->trans(
'Modify').
'">';
1105 print($object->progress > 0 ? $object->progress :
'0').
'%';
1112 $object->fetchObjectLinked();
1113 $num = count($object->linkedObjects);
1117 foreach ($object->linkedObjects as $objecttype => $objects) {
1118 if ($objecttype =
"fichinter") {
1119 foreach ($objects as $fichinter) {
1121 $timing += $fichinter->duration;
1127 print
$form->textwithpicto($langs->trans(
"TicketDurationAuto"), $langs->trans(
"TicketDurationAutoInfos"), 1);
1129 print $foundinter ?
convertSecondToTime($timing,
'all', $conf->global->MAIN_DURATION_OF_WORKDAY) :
'';
1134 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1140 print
'</div><div class="fichehalfright">';
1143 print
'<form method="post" name="formticketproperties" action="'.$url_page_current.
'">';
1144 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1145 print
'<input type="hidden" name="action" value="change_property">';
1146 print
'<input type="hidden" name="track_id" value="'.$track_id.
'">';
1148 print
'<div class="underbanner clearboth"></div>';
1152 print
'<table class="border centpercent tableforfield">';
1154 print
'<td class="valignmiddle titlefield">';
1155 print
'<table class="nobordernopadding centpercent"><tr><td class="titlefield">';
1156 print $langs->trans(
"Categories");
1157 if ($action !=
'categories' && !$user->socid) {
1158 print
'<td class="right"><a class="editfielda" href="'.$url_page_current.
'?action=categories&track_id='.$object->track_id.
'">'.
img_edit($langs->trans(
'Modify')).
'</a></td>';
1163 if ($user->rights->ticket->write && $action ==
'categories') {
1164 $cate_arbo =
$form->select_all_categories(Categorie::TYPE_TICKET,
'',
'parent', 64, 0, 1);
1165 if (is_array($cate_arbo)) {
1167 print
'<td colspan="3">';
1168 print
'<form action="'.$url_page_current.
'" method="post">';
1169 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1170 print
'<input type="hidden" name="track_id" value="'.$track_id.
'">';
1171 print
'<input type="hidden" name="action" value="set_categories">';
1174 $cats = $category->containing($object->id,
'ticket');
1175 $arrayselected = array();
1176 foreach ($cats as $cat) {
1177 $arrayselected[] = $cat->id;
1180 print
img_picto(
'',
'category').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected,
'', 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
1181 print
'<input type="submit" class="button button-edit small" value="'.$langs->trans(
'Save').
'">';
1186 print
'<td colspan="3">';
1187 print
$form->showCategories($object->id, Categorie::TYPE_TICKET, 1);
1195 $actionobject->viewTicketOriginalMessage($user, $action, $object);
1198 print
'<div class="div-table-responsive-no-min">';
1199 print
'<table class="noborder tableforfield centpercent margintable">';
1200 print
'<tr class="liste_titre">';
1202 print $langs->trans(
'TicketProperties');
1205 if (
GETPOST(
'set',
'alpha') ==
'properties' && $user->rights->ticket->write) {
1206 print
'<input type="submit" class="button small" name="btn_update_ticket_prop" value="'.$langs->trans(
"Modify").
'" />';
1209 if (isset($object->status) && $object->status < $object::STATUS_NEED_MORE_INFO && $user->rights->ticket->write) {
1210 print
' <a class="editfielda" href="card.php?track_id='.$object->track_id.
'&action=view&set=properties">'.
img_edit($langs->trans(
'Modify')).
'</a>';
1216 if (
GETPOST(
'set',
'alpha') ==
'properties' && $user->rights->ticket->write) {
1219 print
'<td class="titlefield">';
1220 print $langs->trans(
'Type');
1222 $formticket->selectTypesTickets($object->type_code,
'update_value_type',
'', 2);
1228 print $langs->trans(
'TicketCategory');
1230 $formticket->selectGroupTickets($object->category_code,
'update_value_category',
'', 2, 0, 0, 0,
'maxwidth500 widthcentpercentminusxx');
1236 print $langs->trans(
'TicketSeverity');
1238 $formticket->selectSeveritiesTickets($object->severity_code,
'update_value_severity',
'', 2);
1243 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td><td>';
1244 if (!empty($object->type_code)) {
1245 print $langs->getLabelFromKey($db,
'TicketTypeShort'.$object->type_code,
'c_ticket_type',
'code',
'label', $object->type_code);
1249 print
'<tr><td>'.$langs->trans(
"TicketCategory").
'</td><td>';
1250 if (!empty($object->category_code)) {
1251 print $langs->getLabelFromKey($db,
'TicketCategoryShort'.$object->category_code,
'c_ticket_category',
'code',
'label', $object->category_code);
1255 print
'<tr><td>'.$langs->trans(
"TicketSeverity").
'</td><td>';
1256 if (!empty($object->severity_code)) {
1257 print $langs->getLabelFromKey($db,
'TicketSeverityShort'.$object->severity_code,
'c_ticket_severity',
'code',
'label', $object->severity_code);
1267 print
'<!-- navbar with status -->';
1268 if (!$user->socid && $user->rights->ticket->write && isset($object->status) && $object->status < $object::STATUS_CLOSED &&
GETPOST(
'set') !==
'properties') {
1269 $actionobject->viewStatusActions($object);
1273 if (!empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
1274 print
load_fiche_titre($langs->trans(
'Contacts'),
'',
'title_companies.png');
1276 print
'<div class="div-table-responsive-no-min">';
1277 print
'<div class="tagtable centpercent noborder allwidth">';
1279 print
'<div class="tagtr liste_titre">';
1280 print
'<div class="tagtd">'.$langs->trans(
"Source").
'</div>
1281 <div class="tagtd">' . $langs->trans(
"Company").
'</div>
1282 <div class="tagtd">' . $langs->trans(
"Contacts").
'</div>
1283 <div class="tagtd">' . $langs->trans(
"ContactType").
'</div>
1284 <div class="tagtd">' . $langs->trans(
"Phone").
'</div>
1285 <div class="tagtd center">' . $langs->trans(
"Status").
'</div>';
1286 print
'</div><!-- tagtr -->';
1289 $companystatic =
new Societe($db);
1290 $contactstatic =
new Contact($db);
1291 $userstatic =
new User($db);
1293 foreach (array(
'internal',
'external') as $source) {
1294 $tmpobject = $object;
1295 $tab = $tmpobject->listeContact(-1, $source);
1300 print
'<div class="tagtr '.($var ?
'pair' :
'impair').
'">';
1302 print
'<div class="tagtd left">';
1303 if ($tab[$i][
'source'] ==
'internal') {
1304 echo $langs->trans(
"User");
1307 if ($tab[$i][
'source'] ==
'external') {
1308 echo $langs->trans(
"ThirdPartyContact");
1312 print
'<div class="tagtd left">';
1314 if ($tab[$i][
'socid'] > 0) {
1315 $companystatic->fetch($tab[$i][
'socid']);
1316 echo $companystatic->getNomUrl(-1);
1318 if ($tab[$i][
'socid'] < 0) {
1319 echo $conf->global->MAIN_INFO_SOCIETE_NOM;
1321 if (!$tab[$i][
'socid']) {
1326 print
'<div class="tagtd">';
1327 if ($tab[$i][
'source'] ==
'internal') {
1328 if ($userstatic->fetch($tab[$i][
'id'])) {
1329 print $userstatic->getNomUrl(-1);
1332 if ($tab[$i][
'source'] ==
'external') {
1333 if ($contactstatic->fetch($tab[$i][
'id'])) {
1334 print $contactstatic->getNomUrl(-1);
1338 <div class="tagtd">' . $tab[$i][
'libelle'].
'</div>';
1340 print
'<div class="tagtd">';
1342 print
dol_print_phone($tab[$i][
'phone'],
'',
'',
'',
'AC_TEL').
'<br>';
1344 if (!empty($tab[$i][
'phone_perso'])) {
1346 print
'<br>'.dol_print_phone($tab[$i][
'phone_perso'],
'',
'',
'',
'AC_TEL').
'<br>';
1348 if (!empty($tab[$i][
'phone_mobile'])) {
1350 print
dol_print_phone($tab[$i][
'phone_mobile'],
'',
'',
'',
'AC_TEL').
'<br>';
1354 print
'<div class="tagtd center">';
1355 if ($object->status >= 0) {
1356 echo
'<a href="contact.php?track_id='.$object->track_id.
'&action=swapstatut&ligne='.$tab[$i][
'rowid'].
'">';
1359 if ($tab[$i][
'source'] ==
'internal') {
1360 $userstatic->id = $tab[$i][
'id'];
1361 $userstatic->lastname = $tab[$i][
'lastname'];
1362 $userstatic->firstname = $tab[$i][
'firstname'];
1363 echo $userstatic->LibStatut($tab[$i][
'statuscontact'], 3);
1365 if ($tab[$i][
'source'] ==
'external') {
1366 $contactstatic->id = $tab[$i][
'id'];
1367 $contactstatic->lastname = $tab[$i][
'lastname'];
1368 $contactstatic->firstname = $tab[$i][
'firstname'];
1369 echo $contactstatic->LibStatut($tab[$i][
'statuscontact'], 3);
1371 if ($object->status >= 0) {
1377 print
'</div><!-- tagtr -->';
1383 print
'</div><!-- contact list -->';
1387 print
'</div></div>';
1388 print
'<div style="clear:both"></div>';
1394 if ($action !=
'presend' && $action !=
'presend_addmessage' && $action !=
'editline') {
1395 print
'<div class="tabsAction">'.
"\n";
1397 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons',
$parameters, $object, $action);
1402 if (empty($reshook)) {
1404 if (isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $action !=
"presend" && $action !=
"presend_addmessage") {
1405 print
dolGetButtonAction(
'', $langs->trans(
'TicketAddMessage'),
'default', $_SERVER[
"PHP_SELF"].
'?action=presend_addmessage&mode=init&token='.
newToken().
'&track_id='.$object->track_id,
'');
1411 print
dolGetButtonAction($langs->trans(
'UnableToCreateInterIfNoSocid'), $langs->trans(
'TicketAddIntervention'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1413 if ($object->fk_soc > 0 && isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) {
1414 print
dolGetButtonAction(
'', $langs->trans(
'TicketAddIntervention'),
'default', DOL_URL_ROOT.
'/fichinter/card.php?action=create&token='.
newToken().
'&socid='. $object->fk_soc.
'&origin=ticket_ticket&originid='. $object->id,
'');
1424 if (isset($object->status) && $object->status > 0 && $object->status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
1425 print
dolGetButtonAction(
'', $langs->trans(
'CloseTicket'),
'default', $_SERVER[
"PHP_SELF"].
'?action=close&token='.
newToken().
'&track_id='.$object->track_id,
'');
1429 if (isset($object->status) && $object->status > 0 && $object->status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
1430 print
dolGetButtonAction(
'', $langs->trans(
'AbandonTicket'),
'default', $_SERVER[
"PHP_SELF"].
'?action=abandon&token='.
newToken().
'&track_id='.$object->track_id,
'');
1434 if (!$user->socid && (isset($object->status) && ($object->status == Ticket::STATUS_CLOSED || $object->status == Ticket::STATUS_CANCELED)) && !$user->socid) {
1435 print
dolGetButtonAction(
'', $langs->trans(
'ReOpen'),
'default', $_SERVER[
"PHP_SELF"].
'?action=reopen&token='.
newToken().
'&track_id='.$object->track_id,
'');
1439 if ($user->rights->ticket->delete && !$user->socid) {
1440 print
dolGetButtonAction(
'', $langs->trans(
'Delete'),
'delete', $_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&track_id='.$object->track_id,
'');
1443 print
'</div>'.
"\n";
1449 if (
GETPOST(
'modelselected')) {
1450 $action =
'presend';
1453 if (
GETPOSTISSET(
'actionbis') && $action ==
'presend') {
1454 $action =
'presend_addmessage';
1458 if ($action ==
'presend' || $action ==
'presend_addmessage') {
1459 if ($object->fk_soc > 0) {
1460 $object->fetch_thirdparty();
1463 $outputlangs = $langs;
1465 if ($conf->global->MAIN_MULTILANGS && empty($newlang) &&
GETPOST(
'lang_id',
'aZ09')) {
1466 $newlang =
GETPOST(
'lang_id',
'aZ09');
1467 } elseif ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($object->thirdparty)) {
1468 $newlang = $object->thirdparty->default_lang;
1470 if (!empty($newlang)) {
1471 $outputlangs =
new Translate(
"", $conf);
1472 $outputlangs->setDefaultLang($newlang);
1475 $arrayoffamiliestoexclude = array(
'objectamount');
1477 $action =
'add_message';
1478 $modelmail =
'ticket_send';
1481 $morehtmlright =
'';
1484 $morehtmlright .=
$form->textwithpicto(
'<span class="opacitymedium">'.$langs->trans(
"TicketMessageSubstitutionReplacedByGenericValues").
'</span>', $help, 1,
'helpclickable',
'', 0, 3,
'helpsubstitution');
1488 print
load_fiche_titre($langs->trans(
'TicketAddMessage'), $morehtmlright,
'messages@ticket');
1494 $formticket->action = $action;
1495 $formticket->track_id = $object->track_id;
1496 $formticket->ref = $object->ref;
1497 $formticket->id = $object->id;
1499 $formticket->withfile = 2;
1500 $formticket->withcancel = 1;
1501 $formticket->param = array(
'fk_user_create' => $user->id);
1502 $formticket->param[
'langsmodels'] = (empty($newlang) ? $langs->defaultlang : $newlang);
1505 $formticket->param[
'models'] = $modelmail;
1506 $formticket->param[
'models_id'] =
GETPOST(
'modelmailselected',
'int');
1508 $formticket->param[
'returnurl'] = $_SERVER[
"PHP_SELF"].
'?track_id='.$object->track_id;
1510 $formticket->withsubstit = 1;
1511 $formticket->substit = $substitutionarray;
1512 $formticket->backtopage = $backtopage;
1514 $formticket->showMessageForm(
'100%');
1519 if (!empty($conf->global->TICKET_SHOW_MESSAGES_ON_CARD)) {
1520 $param =
'&id='.$object->id;
1521 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
1522 $param .=
'&contextpage='.$contextpage;
1524 if ($limit > 0 && $limit != $conf->liste_limit) {
1525 $param .=
'&limit='.$limit;
1528 $param .=
'&actioncode='.urlencode($actioncode);
1530 if ($search_agenda_label) {
1531 $param .=
'&search_agenda_label='.urlencode($search_agenda_label);
1534 $morehtmlright =
'';
1536 $messagingUrl = DOL_URL_ROOT.
'/ticket/agenda.php?track_id='.$object->track_id;
1537 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'MessageListViewType'),
'',
'fa fa-bars imgforviewmode', $messagingUrl,
'', 1);
1540 $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action !=
"presend" && $action !=
"presend_addmessage" && $action !=
"add_message";
1541 $url =
'card.php?track_id='.$object->track_id.
'&action=presend_addmessage&mode=init';
1542 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'TicketAddMessage'),
'',
'fa fa-comment-dots', $url,
'add-new-ticket-title-button', $btnstatus);
1545 $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action !=
"presend" && $action !=
"presend_addmessage" && $action !=
"add_message"; ;
1546 $url =
dol_buildpath(
'/comm/action/card.php', 1).
'?action=create&datep='.date(
'YmdHi').
'&origin=ticket&originid='.$object->id.
'&projectid='.$object->fk_project.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?track_id='.$object->track_id);
1547 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'AddAction'),
'',
'fa fa-plus-circle', $url,
'add-new-ticket-even-button', $btnstatus);
1549 print_barre_liste($langs->trans(
"ActionsOnTicket"), 0, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', 0, -1,
'', 0, $morehtmlright,
'', 0, 1, 1);
1553 $filters[
'search_agenda_label'] = $search_agenda_label;
1554 show_ticket_messaging($conf, $langs, $db, $object,
null, 0, $actioncode,
'', $filters, $sortfield, $sortorder);
1557 if ($action !=
'presend' && $action !=
'presend_addmessage' && $action !=
'add_message') {
1558 print
'<div class="fichecenter"><div class="fichehalfleft">';
1559 print
'<a name="builddoc"></a>';
1562 $linktoelem =
$form->showLinkToObjectBlock($object,
null, array(
'ticket'));
1563 $somethingshown =
$form->showLinkedObjectBlock($object, $linktoelem);
1566 print
'<br><!-- Link to public interface -->'.
"\n";
1570 if (empty($conf->global->TICKET_SHOW_MESSAGES_ON_CARD)) {
1571 print
'<div class="fichehalfright">';
1575 $morehtmlcenter =
'<div class="nowraponall">';
1576 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullConversation'),
'',
'fa fa-comments imgforviewmode', DOL_URL_ROOT.
'/ticket/messaging.php?id='.$object->id);
1577 $morehtmlcenter .=
' ';
1578 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullList'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/ticket/agenda.php?id='.$object->id);
1579 $morehtmlcenter .=
'</div>';
1582 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1584 $somethingshown =
$formactions->showactions($object,
'ticket', $socid, 1,
'listactions', $MAXEVENT,
'', $morehtmlcenter);