33require
'../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/ticket/class/actions_ticket.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formticket.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/ticket.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
44if (isModEnabled(
'project')) {
45 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
46 include_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
47 include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
49if (isModEnabled(
'contract')) {
50 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcontract.class.php';
51 include_once DOL_DOCUMENT_ROOT.
'/core/lib/contract.lib.php';
52 include_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
56$langs->loadLangs(array(
"companies",
"other",
"ticket"));
61$track_id =
GETPOST(
'track_id',
'alpha', 3);
65$notifyTiers =
GETPOST(
"notify_tiers_at_create",
'alpha');
67$action =
GETPOST(
'action',
'aZ09');
68$cancel =
GETPOST(
'cancel',
'alpha');
69$backtopage =
GETPOST(
'backtopage',
'alpha');
70$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
73$sortfield =
GETPOST(
'sortfield',
'aZ09comma') ?
GETPOST(
'sortfield',
'aZ09comma') :
"a.datep";
74$sortorder =
GETPOST(
'sortorder',
'aZ09comma') ?
GETPOST(
'sortorder',
'aZ09comma') :
"desc";
75$search_rowid =
GETPOST(
'search_rowid');
76$search_agenda_label =
GETPOST(
'search_agenda_label');
78if (
GETPOST(
'actioncode',
'array')) {
79 $actioncode =
GETPOST(
'actioncode',
'array', 3);
80 if (!count($actioncode)) {
89$hookmanager->initHooks(array(
'ticketcard',
'globalcard'));
95$extrafields->fetch_name_optionals_label(
$object->table_element);
97$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
100$search_all =
GETPOST(
"search_all",
'alpha');
102foreach (
$object->fields as $key => $val) {
103 if (
GETPOST(
'search_'.$key,
'alpha')) {
104 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
108if (empty($action) && empty($id) && empty($ref)) {
113if (
GETPOST(
'modelselected',
'alpha')) {
119if ($id || $track_id || $ref) {
120 $res =
$object->fetch($id, $ref, $track_id);
132$url_page_current = DOL_URL_ROOT.
'/ticket/card.php';
135if ($user->socid > 0) {
136 $socid = $user->socid;
140$triggermodname =
'TICKET_MODIFY';
143$permissiontoread = $user->hasRight(
'ticket',
'read');
144$permissiontoadd = $user->hasRight(
'ticket',
'write');
145$permissiontodelete = $user->hasRight(
'ticket',
'delete');
147$upload_dir = $conf->ticket->dir_output;
155$parameters = array();
156$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
162if (empty($reshook)) {
164 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
166 $search_agenda_label =
'';
169 $backurlforlist = DOL_URL_ROOT .
'/ticket/list.php';
171 if (empty($backtopage) || ($cancel && empty($id))) {
172 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
173 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
174 $backtopage = $backurlforlist;
176 $backtopage = DOL_URL_ROOT .
'/ticket/card.php?id=' . ((!empty($id) && $id > 0) ? $id :
'__ID__');
182 if (!empty($backtopageforcancel)) {
183 header(
"Location: " . $backtopageforcancel);
185 } elseif (!empty($backtopage)) {
186 header(
"Location: " . $backtopage);
192 if (($action ==
'add' &&
GETPOST(
'save',
'alpha') || ($action ==
'update' &&
$object->status < Ticket::STATUS_CLOSED)) && $permissiontoadd) {
193 $ifErrorAction = $action ==
'add' ?
'create' :
'edit';
194 if ($action ==
'add')
$object->track_id =
null;
198 'ref' => [
'check' =>
'alpha',
'langs' =>
'Ref'],
199 'type_code' => [
'check' =>
'alpha',
'langs' =>
'TicketTypeRequest'],
200 'category_code' => [
'check' =>
'alpha',
'langs' =>
'TicketCategory'],
201 'severity_code' => [
'check' =>
'alpha',
'langs' =>
'TicketSeverity'],
202 'subject' => [
'check' =>
'alphanohtml',
'langs' =>
'Subject'],
203 'message' => [
'check' =>
'restricthtml',
'langs' =>
'Message']
208 if (!empty($error)) {
209 $action = $ifErrorAction;
212 $ret = $extrafields->setOptionalsFromPost(
null,
$object);
216 $getRef =
GETPOST(
'ref',
'alpha');
218 if (!empty($getRef)) {
219 $isExistingRef =
$object->checkExistingRef($action, $getRef);
221 $isExistingRef =
true;
226 if ($isExistingRef) {
227 if ($action ==
'update') {
231 } elseif ($action ==
'add') {
236 if (!empty($getRef)) {
249 $fk_user_assign =
GETPOSTINT(
'fk_user_assign');
253 if ($fk_user_assign > 0) {
254 $object->fk_user_assign = $fk_user_assign;
255 $object->status = $object::STATUS_ASSIGNED;
258 if ($action ==
'add') {
260 $object->type_label = $langs->trans($langs->getLabelFromKey($db,
$object->type_code,
'c_ticket_type',
'code',
'label'));
261 $object->category_label = $langs->trans($langs->getLabelFromKey($db,
$object->category_code,
'c_ticket_category',
'code',
'label'));
262 $object->severity_label = $langs->trans($langs->getLabelFromKey($db,
$object->severity_code,
'c_ticket_severity',
'code',
'label'));
263 $object->fk_user_create = $user->id;
264 $object->email_from = $user->email;
266 $notifyTiers =
GETPOST(
"notify_tiers_at_create",
'alpha');
267 $object->notify_tiers_at_create = empty($notifyTiers) ? 0 : 1;
277 $action = $ifErrorAction;
282 $categories =
GETPOST(
'categories',
'array');
283 $object->setCategories($categories);
286 if ($action ==
'add') {
290 $type_contact =
GETPOST(
"type",
'alpha');
292 if ($contactid > 0 && $type_contact) {
294 $result =
$object->add_contact($contactid, $typeid,
'external');
298 if (
GETPOST(
'origin',
'alpha') ==
'projet') {
304 if ($projectid > 0) {
305 $object->setProject($projectid);
309 if (
getDolGlobalString(
'TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND') && $user->hasRight(
'ticket',
'write')) {
310 if (!
$object->markAsRead($user) > 0) {
317 $result =
$object->assignUser($user, $user->id, 1);
318 $object->add_contact($user->id,
"SUPPORTTEC",
'internal');
324 $object->copyFilesForTicket(
'');
330 if (!empty($backtopage)) {
334 $url =
'card.php?track_id=' . urlencode(
$object->track_id);
337 $url =
'card.php?track_id=' . urlencode(
$object->track_id);
340 header(
"Location: " . $url);
346 }
else $action = $ifErrorAction;
350 if ($action ==
"set_read" && $permissiontoadd) {
353 if (
$object->markAsRead($user) > 0) {
356 header(
"Location: card.php?track_id=" .
$object->track_id);
365 if ($action ==
"assign_user" &&
GETPOST(
'btn_assign_user',
'alpha') && $permissiontoadd) {
367 $useroriginassign =
$object->fk_user_assign;
377 $ret =
$object->assignUser($user, $usertoassign);
385 if ($useroriginassign > 0) {
386 $internal_contacts =
$object->listeContact(-1,
'internal', 0,
'SUPPORTTEC');
387 foreach ($internal_contacts as $key => $contact) {
388 if ($contact[
'id'] !== $usertoassign) {
389 $result =
$object->delete_contact($contact[
'rowid']);
398 if ($usertoassign > 0 && $usertoassign !== $useroriginassign) {
399 $result =
$object->add_contact($usertoassign,
"SUPPORTTEC",
'internal', $notrigger = 0);
409 $object->fetch_user($usertoassign);
412 header(
"Location: card.php?track_id=" .
$object->track_id);
422 if ($action ==
'add_message' && GETPOSTISSET(
'btn_add_message') && $permissiontoread) {
426 if (!empty($backtopage)) {
429 $url =
'card.php?track_id=' . urlencode(
$object->track_id);
432 header(
"Location: " . $url);
440 if (($action ==
"confirm_close" || $action ==
"confirm_abandon") &&
GETPOST(
'confirm',
'alpha') ==
'yes' && $permissiontoadd) {
443 if (
$object->close($user, ($action ==
"confirm_abandon" ? 1 : 0))) {
446 $url =
'card.php?track_id=' .
GETPOST(
'track_id',
'alpha');
447 header(
"Location: " . $url);
455 if ($action ==
"confirm_public_close" &&
GETPOST(
'confirm',
'alpha') ==
'yes' && $permissiontoadd) {
457 if ($_SESSION[
'email_customer'] ==
$object->origin_email || $_SESSION[
'email_customer'] ==
$object->thirdparty->email) {
462 setEventMessages(
'<div class="confirm">' . $langs->trans(
'TicketMarkedAsClosed') .
'</div>',
null,
'mesgs');
464 $url =
'card.php?track_id=' .
GETPOST(
'track_id',
'alpha');
465 header(
"Location: " . $url);
473 if ($action ==
'confirm_delete_ticket' &&
GETPOST(
'confirm',
'alpha') ==
"yes" && $permissiontodelete) {
475 if (
$object->delete($user) > 0) {
476 setEventMessages(
'<div class="confirm">' . $langs->trans(
'TicketDeletedSuccess') .
'</div>',
null,
'mesgs');
477 header(
"Location: " . DOL_URL_ROOT .
"/ticket/list.php");
480 $langs->load(
"errors");
481 $mesg =
'<div class="error">' . $langs->trans(
$object->error) .
'</div>';
488 if ($action ==
'set_thirdparty' && $user->hasRight(
'ticket',
'write')) {
491 $url = $_SERVER[
"PHP_SELF"] .
'?track_id=' .
GETPOST(
'track_id',
'alpha');
492 header(
"Location: " . $url);
498 if ($action ==
'set_progression' && $user->hasRight(
'ticket',
'write')) {
502 $url =
'card.php?track_id=' .
$object->track_id;
503 header(
"Location: " . $url);
509 if ($action ==
'set_categories' && $user->hasRight(
'ticket',
'write')) {
513 $url =
'card.php?track_id=' .
$object->track_id;
514 header(
"Location: " . $url);
520 if ($action ==
'setsubject' && $user->hasRight(
'ticket',
'write')) {
522 if ($action ==
'setsubject') {
526 if ($action ==
'setsubject' && empty(
$object->subject)) {
528 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Subject")),
null,
'errors');
532 if (!
$object->update($user) >= 0) {
538 header(
"Location: " . $_SERVER[
'PHP_SELF'] .
"?track_id=" .
$object->track_id);
543 if ($action ==
'confirm_reopen' && $user->hasRight(
'ticket',
'manage') && !
GETPOST(
'cancel')) {
546 if (
$object->status == Ticket::STATUS_CLOSED ||
$object->status == Ticket::STATUS_CANCELED) {
547 if (
$object->fk_user_assign !=
null) {
548 $res =
$object->setStatut(Ticket::STATUS_ASSIGNED,
null,
'',
'TICKET_MODIFY');
550 $res =
$object->setStatut(Ticket::STATUS_NOT_READ,
null,
'',
'TICKET_MODIFY');
553 $url =
'card.php?track_id=' .
$object->track_id;
554 header(
"Location: " . $url);
562 } elseif ($action ==
'classin' && $permissiontoadd) {
565 $object->setProject($projectid);
566 $url =
'card.php?track_id=' .
$object->track_id;
567 header(
"Location: " . $url);
570 } elseif ($action ==
'setcontract' && $permissiontoadd) {
574 $url =
'card.php?track_id=' .
$object->track_id;
575 header(
"Location: " . $url);
578 } elseif ($action ==
"set_message" && $user->hasRight(
'ticket',
'manage')) {
582 $fieldtomodify =
GETPOST(
'message_initial',
'restricthtml');
584 $object->message = $fieldtomodify;
591 setEventMessages($langs->trans(
'TicketMessageSuccesfullyUpdated'),
null,
'mesgs');
599 } elseif ($action ==
'confirm_set_status' && $permissiontoadd && !
GETPOST(
'cancel')) {
604 $res =
$object->setStatut($new_status,
null,
'',
'TICKET_MODIFY');
607 $url =
'card.php?track_id=' .
$object->track_id;
608 header(
"Location: " . $url);
618 if ($action ==
"update_extras" && $permissiontoadd) {
621 $ret = $extrafields->setOptionalsFromPost(
null,
$object,
GETPOST(
'attribute',
'restricthtml'));
627 $result =
$object->insertExtraFields(empty($triggermodname) ?
'' : $triggermodname, $user);
635 $action =
'edit_extras';
642 if ($action ==
"change_property" &&
GETPOST(
'btn_update_ticket_prop',
'alpha') && $permissiontoadd) {
646 $object->severity_code =
GETPOST(
'update_value_severity',
'aZ09');
647 $object->category_code =
GETPOST(
'update_value_category',
'aZ09');
660 $permissiondellink = $user->hasRight(
'ticket',
'write');
661 include DOL_DOCUMENT_ROOT .
'/core/actions_dellink.inc.php';
664 include DOL_DOCUMENT_ROOT .
'/core/actions_builddoc.inc.php';
667 $triggersendname =
'TICKET_SENTBYMAIL';
669 $autocopy =
'MAIN_MAIL_AUTOCOPY_TICKET_TO';
670 $trackid =
'tic' .
$object->id;
671 include DOL_DOCUMENT_ROOT .
'/core/actions_sendmails.inc.php';
674 if (GETPOSTISSET(
'actionbis') && $action ==
'presend') {
675 $action =
'presend_addmessage';
684$userstat =
new User($db);
685$form =
new Form($db);
688if (isModEnabled(
'project')) {
692$help_url =
'EN:Module_Ticket|FR:DocumentationModuleTicket';
694$title = $actionobject->getTitle($action);
696llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-ticket page-card');
698if ($action ==
'create' || $action ==
'presend') {
699 if (empty($permissiontoadd)) {
707 $formticket->trackid =
'';
709 if (
GETPOST(
"mode",
"aZ09") ==
'init' && empty($_POST)) {
710 $formticket->clear_attached_files();
713 $formticket->withfromsocid = $socid ? $socid : $user->socid;
714 $formticket->withfromcontactid = $contactid ? $contactid :
'';
715 $formticket->withtitletopic = 1;
716 $formticket->withnotifytiersatcreate = ($notifyTiers ? 1 : (
getDolGlobalString(
'TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION') ? 1 : 0));
717 $formticket->withusercreate = 0;
718 $formticket->withref = 1;
719 $formticket->fk_user_create = $user->id;
720 $formticket->withfile = 2;
721 $formticket->withextrafields = 1;
722 $formticket->param = array(
'origin' =>
GETPOST(
'origin'),
'originid' =>
GETPOST(
'originid'));
724 $formticket->withcancel = 1;
727 if (
GETPOST(
"mode",
"aZ09") ==
'init') {
728 $formticket->clear_attached_files();
731 $formticket->showForm(1,
'create', 0,
null, $action,
$object);
734} elseif ($action ==
'edit' && $user->rights->ticket->write &&
$object->status < Ticket::STATUS_CLOSED) {
735 if (empty($permissiontoadd)) {
745 $formticket->trackid =
$object->track_id;
746 $formticket->withfromsocid =
$object->socid;
747 $formticket->withtitletopic = 1;
749 $formticket->withnotifytiersatcreate = 0;
750 $formticket->withusercreate = 0;
751 $formticket->withref = 1;
752 $formticket->fk_user_create = $user->id;
753 $formticket->withfile = 0;
754 $formticket->action =
'update';
755 $formticket->withextrafields = 1;
756 $formticket->param = array(
'origin' =>
GETPOST(
'origin'),
'originid' =>
GETPOST(
'originid'));
758 $formticket->withcancel = 1;
760 $formticket->showForm(0,
'edit', 0,
null, $action,
$object);
763} elseif (empty($action) || in_array($action, [
'builddoc',
'view',
'addlink',
'dellink',
'presend',
'presend_addmessage',
'close',
'abandon',
'delete',
'editcustomer',
'progression',
'categories',
'reopen',
'edit_contrat',
'editsubject',
'edit_extras',
'update_extras',
'edit_extrafields',
'set_extrafields',
'classify',
'sel_contract',
'edit_message_init',
'set_status',
'dellink'])) {
764 if (!empty($res) && $res > 0) {
766 if (!$user->socid && (
getDolGlobalString(
'TICKET_LIMIT_VIEW_ASSIGNED_ONLY') &&
$object->fk_user_assign != $user->id) && !$user->hasRight(
'ticket',
'manage')) {
772 if ($action ==
'close') {
773 $thirdparty_contacts =
$object->getInfosTicketExternalContact(1);
774 $contacts_select = array(
775 '-2' => $langs->trans(
'TicketNotifyAllTiersAtClose'),
776 '-3' => $langs->trans(
'TicketNotNotifyTiersAtClose')
778 foreach ($thirdparty_contacts as $thirdparty_contact) {
779 $contacts_select[$thirdparty_contact[
'id']] = $thirdparty_contact[
'civility'] .
' ' . $thirdparty_contact[
'lastname'] .
' ' . $thirdparty_contact[
'firstname'];
784 $formquestion = array(
786 'name' =>
'contactid',
788 'label' => $langs->trans(
'NotifyThirdpartyOnTicketClosing'),
789 'values' => $contacts_select,
790 'default' => $default
794 print $form->formconfirm($url_page_current.
"?track_id=".
$object->track_id, $langs->trans(
"CloseATicket"), $langs->trans(
"ConfirmCloseAticket"),
"confirm_close", $formquestion,
'', 1);
797 if ($action ==
'abandon') {
798 print $form->formconfirm($url_page_current.
"?track_id=".
$object->track_id, $langs->trans(
"AbandonTicket"), $langs->trans(
"ConfirmAbandonTicket"),
"confirm_abandon",
'',
'', 1);
801 if ($action ==
'delete') {
802 print $form->formconfirm($url_page_current.
"?track_id=".
$object->track_id, $langs->trans(
"Delete"), $langs->trans(
"ConfirmDeleteTicket"),
"confirm_delete_ticket",
'',
'', 1);
805 if ($action ==
'reopen') {
806 print $form->formconfirm($url_page_current.
'?track_id='.
$object->track_id, $langs->trans(
'ReOpen'), $langs->trans(
'ConfirmReOpenTicket'),
'confirm_reopen',
'',
'', 1);
809 if ($action ==
'set_status') {
810 $new_status =
GETPOST(
'new_status');
812 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->labelStatusShort[$new_status])),
"confirm_set_status",
'',
'', 1);
816 if ($projectid > 0) {
817 $projectstat =
new Project($db);
818 if ($projectstat->fetch($projectid) > 0) {
819 $projectstat->fetch_thirdparty();
823 $userWrite = $projectstat->restrictedProjectArea($user,
'write');
829 print
dol_get_fiche_head($head,
'ticket', $langs->trans(
"Project"), 0, ($projectstat->public ?
'projectpub' :
'project'));
831 print
'<table class="border centpercent">';
833 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
836 print
'<tr><td width="30%">'.$langs->trans(
'Ref').
'</td><td colspan="3">';
838 if (!$user->hasRight(
'projet',
'all',
'lire')) {
839 $objectsListId = $projectstat->getProjectsAuthorizedForUser($user, $mine, 0);
840 $projectstat->next_prev_filter =
"rowid IN (".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0').
")";
842 print $form->showrefnav($projectstat,
'ref', $linkback, 1,
'ref',
'ref',
'');
846 print
'<tr><td>'.$langs->trans(
"Label").
'</td><td>'.$projectstat->title.
'</td></tr>';
849 print
"<tr><td>".$langs->trans(
"ThirdParty").
"</td>";
850 print
'<td colspan="3">';
851 if ($projectstat->thirdparty->id > 0) {
852 print $projectstat->thirdparty->getNomUrl(1);
860 print
'<tr><td>'.$langs->trans(
"Visibility").
'</td><td>';
861 if ($projectstat->public) {
862 print $langs->trans(
'SharedProject');
864 print $langs->trans(
'PrivateProject');
870 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>'.$projectstat->getLibStatut(4).
'</td></tr>';
876 print
"ErrorRecordNotFound";
878 } elseif ($socid > 0) {
884 dol_banner_tab(
$object->thirdparty,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom');
890 $object->next_prev_filter =
"te.fk_user_assign = ".((int) $user->id);
891 } elseif ($user->socid > 0) {
892 $object->next_prev_filter =
"te.fk_soc = ".((int) $user->socid);
899 $morehtmlref =
'<div class="refidno">';
903 if (
$object->fk_user_create > 0) {
904 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
906 $fuser =
new User($db);
907 $fuser->fetch(
$object->fk_user_create);
908 $morehtmlref .= $fuser->getNomUrl(-1);
912 $createdfrompublicticket = 0;
913 $createdfromemailcollector = 0;
914 if (!empty(
$object->origin_email) && (empty(
$object->email_msgid) || preg_match(
'/dolibarr\-tic\d+/',
$object->email_msgid))) {
916 $createdfrompublicticket = 1;
917 } elseif (!empty(
$object->email_msgid)) {
919 $createdfromemailcollector = 1;
923 if ($createdfrompublicticket) {
924 $htmltooptip = $langs->trans(
"OriginEmail").
': '.
$object->origin_email;
925 $htmltooptip .=
'<br>'.$langs->trans(
"IP").
': '.
$object->ip;
926 $morehtmlref .= ($createdbyshown ?
' - ' :
'<br>');
927 $morehtmlref .= ($createdbyshown ?
'' : $langs->trans(
"CreatedBy").
' : ');
928 $morehtmlref .=
img_picto(
'',
'email',
'class="paddingrightonly"');
929 $morehtmlref .=
dol_escape_htmltag(
$object->origin_email).
' <small class="hideonsmartphone opacitymedium">- '.$form->textwithpicto($langs->trans(
"CreatedByPublicPortal"), $htmltooptip, 1,
'help',
'', 0, 3,
'tooltip').
'</small>';
930 } elseif ($createdfromemailcollector) {
931 $langs->load(
"mails");
932 $htmltooltip = $langs->trans(
"EmailMsgID").
': '.
$object->email_msgid;
933 $htmltooltip .=
'<br>'.$langs->trans(
"EmailDate").
': '.
dol_print_date(
$object->email_date,
'dayhour');
934 $htmltooltip .=
'<br>'.$langs->trans(
"MailFrom").
': '.
$object->email_from;
935 $htmltooltip .=
'<br>'.$langs->trans(
"MailReply").
': '.
$object->origin_replyto;
936 $htmltooltip .=
'<br>'.$langs->trans(
"MailReferences").
': '.
$object->origin_references;
937 $morehtmlref .= ($createdbyshown ?
' - ' :
'<br>');
938 $morehtmlref .= ($createdbyshown ?
'' : $langs->trans(
"CreatedBy").
' : ');
939 $morehtmlref .=
img_picto(
'',
'email',
'class="paddingrightonly"');
940 $morehtmlref .=
dol_escape_htmltag(
$object->origin_email).
' <small class="hideonsmartphone opacitymedium">- '.$form->textwithpicto($langs->trans(
"CreatedByEmailCollector"), $htmltooltip, 1,
'help',
'', 0, 3,
'tooltip').
'</small>';
943 $permissiontoedit =
$object->status < 8 && !$user->socid && $user->hasRight(
'ticket',
'write');
947 if (isModEnabled(
"societe")) {
948 $morehtmlref .=
'<br>';
949 $morehtmlref .=
img_picto($langs->trans(
"ThirdParty"),
'company',
'class="pictofixedwidth"');
950 if ($action !=
'editcustomer' && $permissiontoedit) {
951 $morehtmlref .=
'<a class="editfielda" href="'.$url_page_current.
'?action=editcustomer&token='.
newToken().
'&track_id='.
$object->track_id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetThirdParty'), 0).
'</a> ';
953 $morehtmlref .= $form->form_thirdparty($url_page_current.
'?track_id='.
$object->track_id,
$object->socid, $action ==
'editcustomer' ?
'editcustomer' :
'none',
'', 1, 0, 0, array(), 1);
955 $morehtmlref .=
' - <a href="'.DOL_URL_ROOT.
'/ticket/list.php?socid='.
$object->socid.
'&sortfield=t.datec&sortorder=desc">'.
img_picto($langs->trans(
"Tickets"),
'ticket',
'class="pictofixedwidth"').
' '.$langs->trans(
"TicketHistory").
'</a>';
960 if (isModEnabled(
'project')) {
961 $langs->load(
"projects");
962 $morehtmlref .=
'<br>';
963 if ($permissiontoedit) {
965 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project'.((is_object(
$object->project) &&
$object->project->public) ?
'pub' :
''),
'class="pictofixedwidth"');
966 if ($action !=
'classify') {
967 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
969 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->socid,
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
971 if (!empty(
$object->fk_project)) {
973 $morehtmlref .=
$object->project->getNomUrl(1);
975 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag(
$object->project->title).
'</span>';
984 if (isModEnabled(
'contract')) {
985 $langs->load(
'contracts');
986 $morehtmlref .=
'<br>';
987 if ($permissiontoedit) {
988 $morehtmlref .=
img_picto($langs->trans(
"Contract"),
'contract',
'class="pictofixedwidth"');
989 if ($action ==
'edit_contrat') {
991 $morehtmlref .= $formcontract->formSelectContract($_SERVER[
"PHP_SELF"].
'?id='.
$object->id,
$object->socid,
$object->fk_contract,
'contratid', 0, 1, 1, 1);
993 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit_contrat&token='.
newToken().
'&id='.
$object->id.
'">';
994 $morehtmlref .=
img_edit($langs->trans(
'SetContract'));
995 $morehtmlref .=
'</a>';
998 if (!empty(
$object->fk_contract)) {
999 $contratstatic =
new Contrat($db);
1000 $contratstatic->fetch(
$object->fk_contract);
1002 $morehtmlref .= $contratstatic->getNomUrl(0,
'', 1);
1008 $morehtmlref .=
'</div>';
1010 $linkback =
'<a href="'.DOL_URL_ROOT.
'/ticket/list.php?restore_lastsearch_values=1"><strong>'.$langs->trans(
"BackToList").
'</strong></a> ';
1012 dol_banner_tab(
$object,
'ref', $linkback, ($user->socid ? 0 : 1),
'ref',
'ref', $morehtmlref);
1014 print
'<div class="fichecenter">';
1015 print
'<div class="fichehalfleft">';
1016 print
'<div class="underbanner clearboth"></div>';
1018 print
'<table class="border tableforfield centpercent">';
1021 print
'<tr><td class="titlefield">'.$langs->trans(
"TicketTrackId").
'</td><td>';
1022 if (!empty(
$object->track_id)) {
1025 print $form->showrefnav(
$object,
'id', $linkback, 1,
'rowid',
'track_id');
1030 print $langs->trans(
'None');
1036 print $form->editfieldkey(
"Subject",
'subject',
$object->subject,
$object, $user->hasRight(
'ticket',
'write') && !$user->socid,
'string');
1038 print $form->editfieldval(
"Subject",
'subject',
$object->subject,
$object, $user->hasRight(
'ticket',
'write') && !$user->socid,
'string');
1042 print
'<tr><td>'.$langs->trans(
"DateCreation").
'</td><td>';
1065 print
'<tr><td>'.$langs->trans(
"TicketReadOn").
'</td><td>';
1066 if (!empty(
$object->date_read)) {
1074 print
'<tr><td>'.$langs->trans(
"TicketCloseOn").
'</td><td>';
1075 if (!empty(
$object->date_close)) {
1082 print
'<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
1083 print $langs->trans(
"AssignedTo");
1084 if (isset(
$object->status) &&
$object->status < $object::STATUS_CLOSED &&
GETPOST(
'set',
'alpha') !=
"assign_ticket" && $user->hasRight(
'ticket',
'manage')) {
1085 print
'</td><td class="right"><a class="editfielda" href="'.$url_page_current.
'?track_id='.urlencode(
$object->track_id).
'&set=assign_ticket">'.
img_edit($langs->trans(
'Modify'),
'').
'</a>';
1087 print
'</td></tr></table>';
1089 if (
GETPOST(
'set',
'alpha') !=
"assign_ticket" &&
$object->fk_user_assign > 0) {
1090 $userstat->fetch(
$object->fk_user_assign);
1091 print $userstat->getNomUrl(-1);
1095 if (
GETPOST(
'set',
'alpha') ==
"assign_ticket" &&
$object->status < 8 && !$user->socid && $user->hasRight(
'ticket',
'write')) {
1096 print
'<form method="post" name="ticket" enctype="multipart/form-data" action="'.$url_page_current.
'">';
1097 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1098 print
'<input type="hidden" name="action" value="assign_user">';
1099 print
'<input type="hidden" name="track_id" value="'.$object->track_id.
'">';
1101 print $form->select_dolusers(empty(
$object->fk_user_assign) ? $user->id :
$object->fk_user_assign,
'fk_user_assign', 1);
1102 print
' <input type="submit" class="button smallpaddingimp" name="btn_assign_user" value="'.$langs->trans(
"Validate").
'" />';
1109 print
'<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
1110 print $langs->trans(
'Progression').
'</td><td class="left">';
1112 if ($action !=
'progression' && isset(
$object->status) &&
$object->status < $object::STATUS_CLOSED && !$user->socid) {
1113 print
'<td class="right"><a class="editfielda" href="'.$url_page_current.
'?action=progression&token='.
newToken().
'&track_id='.urlencode(
$object->track_id).
'">'.
img_edit($langs->trans(
'Modify')).
'</a></td>';
1115 print
'</tr></table>';
1117 if ($user->hasRight(
'ticket',
'write') && $action ==
'progression') {
1118 print
'<form action="'.$url_page_current.
'" method="post">';
1119 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1120 print
'<input type="hidden" name="track_id" value="'.$track_id.
'">';
1121 print
'<input type="hidden" name="action" value="set_progression">';
1122 print
'<input type="text" class="flat width75" name="progress" value="'.$object->progress.
'">';
1123 print
' <input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
'Modify').
'">';
1132 if (isModEnabled(
'intervention')) {
1134 $num = count(
$object->linkedObjects);
1138 foreach (
$object->linkedObjects as $objecttype => $objects) {
1139 if ($objecttype ==
"fichinter") {
1140 foreach ($objects as $fichinter) {
1142 $timing += $fichinter->duration;
1148 print $form->textwithpicto($langs->trans(
"TicketDurationAuto"), $langs->trans(
"TicketDurationAutoInfos"), 1);
1155 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1161 print
'</div><div class="fichehalfright">';
1164 print
'<form method="post" name="formticketproperties" action="'.$url_page_current.
'">';
1165 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1166 print
'<input type="hidden" name="action" value="change_property">';
1167 print
'<input type="hidden" name="track_id" value="'.$track_id.
'">';
1168 print
'<input type="hidden" name="trackid" value="'.$trackid.
'">';
1171 print
'<div class="div-table-responsive-no-min">';
1172 print
'<table class="border tableforfield centpercent margintable bordertopimp">';
1173 print
'<tr class="liste_titre">';
1175 print $langs->trans(
'TicketProperties');
1178 if (
GETPOST(
'set',
'alpha') ==
'properties' && $user->hasRight(
'ticket',
'write')) {
1179 print
'<input type="submit" class="button smallpaddingimp" name="btn_update_ticket_prop" value="'.$langs->trans(
"Modify").
'" />';
1182 if (isset(
$object->status) && (
$object->status < $object::STATUS_NEED_MORE_INFO ||
getDolGlobalString(
'TICKET_ALLOW_CLASSIFICATION_MODIFICATION_EVEN_IF_CLOSED')) && $user->hasRight(
'ticket',
'write')) {
1183 print
' <a class="editfielda" href="card.php?track_id='.$object->track_id.
'&set=properties">'.
img_edit($langs->trans(
'Modify')).
'</a>';
1189 if (
GETPOST(
'set',
'alpha') ==
'properties' && $user->hasRight(
'ticket',
'write')) {
1192 print
'<td class="titlefield">';
1193 print $langs->trans(
'Type');
1195 $formticket->selectTypesTickets(
$object->type_code,
'update_value_type',
'', 2);
1201 print $langs->trans(
'TicketCategory');
1203 $formticket->selectGroupTickets(
$object->category_code,
'update_value_category',
'', 2, 0, 0, 0,
'maxwidth500 widthcentpercentminusxx');
1209 print $langs->trans(
'TicketSeverity');
1211 $formticket->selectSeveritiesTickets(
$object->severity_code,
'update_value_severity',
'', 2);
1216 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td><td>';
1217 if (!empty(
$object->type_code)) {
1218 print $langs->getLabelFromKey($db,
'TicketTypeShort'.
$object->type_code,
'c_ticket_type',
'code',
'label',
$object->type_code);
1223 if (!empty(
$object->category_code)) {
1224 $s = $langs->getLabelFromKey($db,
'TicketCategoryShort'.
$object->category_code,
'c_ticket_category',
'code',
'label',
$object->category_code);
1226 print
'<tr><td>'.$langs->trans(
"TicketCategory").
'</td><td class="tdoverflowmax200" title="'.
dol_escape_htmltag($s).
'">';
1230 print
'<tr><td>'.$langs->trans(
"TicketSeverity").
'</td><td>';
1231 if (!empty(
$object->severity_code)) {
1232 print $langs->getLabelFromKey($db,
'TicketSeverityShort'.
$object->severity_code,
'c_ticket_severity',
'code',
'label',
$object->severity_code);
1242 if (isModEnabled(
'category')) {
1243 print
'<table class="border centpercent tableforfield">';
1245 print
'<td class="valignmiddle titlefield">';
1246 print
'<table class="nobordernopadding centpercent"><tr><td class="titlefield">';
1247 print $langs->trans(
"Categories");
1248 if ($action !=
'categories' && !$user->socid) {
1249 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>';
1254 if ($user->hasRight(
'ticket',
'write') && $action ==
'categories') {
1255 $cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET,
'',
'parent', 64, 0, 3);
1256 if (is_array($cate_arbo)) {
1258 print
'<td colspan="3">';
1259 print
'<form action="'.$url_page_current.
'" method="POST">';
1260 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1261 print
'<input type="hidden" name="track_id" value="'.$track_id.
'">';
1262 print
'<input type="hidden" name="action" value="set_categories">';
1265 $cats = $category->containing(
$object->id,
'ticket');
1266 $arrayselected = array();
1267 foreach ($cats as $cat) {
1268 $arrayselected[] = $cat->id;
1271 print
img_picto(
'',
'category',
'class="pictofixedwidth"').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected,
'', 0,
'maxwidth500 widthcentpercentminusx', 0, 0);
1272 print
'<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
'Save').
'">';
1277 print
'<td colspan="3">';
1278 print $form->showCategories(
$object->id, Categorie::TYPE_TICKET, 1);
1286 $actionobject->viewTicketOriginalMessage($user, $action,
$object);
1290 print
'<!-- navbar with status -->';
1291 if (!$user->socid && $user->hasRight(
'ticket',
'write') && isset(
$object->status) &&
$object->status < $object::STATUS_CLOSED) {
1292 $actionobject->viewStatusActions(
$object);
1297 print
load_fiche_titre($langs->trans(
'Contacts'),
'',
'title_companies.png');
1299 print
'<div class="div-table-responsive-no-min">';
1300 print
'<div class="tagtable centpercent noborder allwidth">';
1302 print
'<div class="tagtr liste_titre">';
1303 print
'<div class="tagtd">'.$langs->trans(
"Source").
'</div>
1304 <div class="tagtd">' . $langs->trans(
"Company").
'</div>
1305 <div class="tagtd">' . $langs->trans(
"Contacts").
'</div>
1306 <div class="tagtd">' . $langs->trans(
"ContactType").
'</div>
1307 <div class="tagtd">' . $langs->trans(
"Phone").
'</div>
1308 <div class="tagtd center">' . $langs->trans(
"Status").
'</div>';
1309 print
'</div><!-- tagtr -->';
1312 $companystatic =
new Societe($db);
1313 $contactstatic =
new Contact($db);
1314 $userstatic =
new User($db);
1316 foreach (array(
'internal',
'external') as $source) {
1318 $tab = $tmpobject->listeContact(-1, $source);
1319 '@phan-var-force array<array{source:string,id:int,rowid:int,email:string,civility:string,firstname:string,lastname:string,labeltype:string,libelle:string,socid:int,code:string,status:int,statuscontact:string,fk_c_typecontact:string,phone:string,phone_mobile:string,nom:string}> $tab';
1320 $num = is_array($tab) ? 0 : count($tab);
1322 foreach (array_keys($tab) as $i) {
1324 print
'<div class="tagtr '.($var ?
'pair' :
'impair').
'">';
1326 print
'<div class="tagtd left">';
1327 if ($tab[$i][
'source'] ==
'internal') {
1328 echo $langs->trans(
"User");
1331 if ($tab[$i][
'source'] ==
'external') {
1332 echo $langs->trans(
"ThirdPartyContact");
1336 print
'<div class="tagtd left">';
1338 if ($tab[$i][
'socid'] > 0) {
1339 $companystatic->fetch($tab[$i][
'socid']);
1340 echo $companystatic->getNomUrl(-1);
1342 if ($tab[$i][
'socid'] < 0) {
1345 if (!$tab[$i][
'socid']) {
1350 print
'<div class="tagtd">';
1351 if ($tab[$i][
'source'] ==
'internal') {
1352 if ($userstatic->fetch($tab[$i][
'id'])) {
1353 print $userstatic->getNomUrl(-1);
1356 if ($tab[$i][
'source'] ==
'external') {
1357 if ($contactstatic->fetch($tab[$i][
'id'])) {
1358 print $contactstatic->getNomUrl(-1);
1362 <div class="tagtd">' . $tab[$i][
'libelle'].
'</div>';
1364 print
'<div class="tagtd">';
1366 print
dol_print_phone($tab[$i][
'phone'],
'',
'',
'',
'AC_TEL').
'<br>';
1368 if (!empty($tab[$i][
'phone_perso'])) {
1370 print
'<br>'.dol_print_phone($tab[$i][
'phone_perso'],
'',
'',
'',
'AC_TEL').
'<br>';
1372 if (!empty($tab[$i][
'phone_mobile'])) {
1374 print
dol_print_phone($tab[$i][
'phone_mobile'],
'',
'',
'',
'AC_TEL').
'<br>';
1378 print
'<div class="tagtd center">';
1380 echo
'<a href="contact.php?track_id='.$object->track_id.
'&action=swapstatut&ligne='.$tab[$i][
'rowid'].
'">';
1383 if ($tab[$i][
'source'] ==
'internal') {
1384 $userstatic->id = $tab[$i][
'id'];
1385 $userstatic->lastname = $tab[$i][
'lastname'];
1386 $userstatic->firstname = $tab[$i][
'firstname'];
1387 echo $userstatic->LibStatut($tab[$i][
'statuscontact'], 3);
1389 if ($tab[$i][
'source'] ==
'external') {
1390 $contactstatic->id = $tab[$i][
'id'];
1391 $contactstatic->lastname = $tab[$i][
'lastname'];
1392 $contactstatic->firstname = $tab[$i][
'firstname'];
1393 echo $contactstatic->LibStatut($tab[$i][
'statuscontact'], 3);
1401 print
'</div><!-- tagtr -->';
1407 print
'</div><!-- contact list -->';
1411 print
'</div></div>';
1412 print
'<div class="clearboth"></div>';
1418 if ($action !=
'presend' && $action !=
'presend_addmessage' && $action !=
'editline') {
1419 print
'<div class="tabsAction">'.
"\n";
1420 $parameters = array();
1421 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
1426 if (empty($reshook)) {
1428 if (isset(
$object->status) &&
$object->status < Ticket::STATUS_CLOSED && $action !=
"presend" && $action !=
"presend_addmessage") {
1429 print
dolGetButtonAction(
'', $langs->trans(
'SendMail'),
'default', $_SERVER[
"PHP_SELF"].
'?action=presend_addmessage&send_email=1&private_message=0&mode=init&token='.
newToken().
'&track_id='.
$object->track_id.
'#formmailbeforetitle',
'');
1433 if (isset(
$object->status) &&
$object->status < Ticket::STATUS_CLOSED && $action !=
"presend" && $action !=
"presend_addmessage") {
1434 print
dolGetButtonAction(
'', $langs->trans(
'TicketAddPrivateMessage'),
'default', $_SERVER[
"PHP_SELF"].
'?action=presend_addmessage&mode=init&token='.
newToken().
'&track_id='.
$object->track_id.
'#formmailbeforetitle',
'');
1440 print
dolGetButtonAction($langs->trans(
'UnableToCreateInterIfNoSocid'), $langs->trans(
'TicketAddIntervention'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1442 if (
$object->fk_soc > 0 && isset(
$object->status) &&
$object->status < Ticket::STATUS_CLOSED && $user->hasRight(
'ficheinter',
'creer')) {
1443 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,
'');
1447 if (isset(
$object->status) &&
$object->status >= 0 &&
$object->status < Ticket::STATUS_CLOSED && $user->hasRight(
'ticket',
'write')) {
1448 print
dolGetButtonAction(
'', $langs->trans(
'CloseTicket'),
'default', $_SERVER[
"PHP_SELF"].
'?action=close&token='.
newToken().
'&track_id='.
$object->track_id,
'');
1452 if (isset(
$object->status) &&
$object->status > 0 &&
$object->status < Ticket::STATUS_CLOSED && $user->hasRight(
'ticket',
'write')) {
1453 print
dolGetButtonAction(
'', $langs->trans(
'AbandonTicket'),
'default', $_SERVER[
"PHP_SELF"].
'?action=abandon&token='.
newToken().
'&track_id='.
$object->track_id,
'');
1457 if (!$user->socid && (isset(
$object->status) && (
$object->status == Ticket::STATUS_CLOSED ||
$object->status == Ticket::STATUS_CANCELED)) && !$user->socid) {
1462 if ($permissiontoedit) {
1463 print
dolGetButtonAction(
'', $langs->trans(
'Modify'),
'default', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=edit&token='.
newToken(),
'', $permissiontoedit);
1467 if ($user->hasRight(
'ticket',
'delete') && !$user->socid) {
1471 print
'</div>'.
"\n";
1475 if (
GETPOST(
'modelselected')) {
1476 $action =
'presend';
1479 if (GETPOSTISSET(
'actionbis') && $action ==
'presend') {
1480 $action =
'presend_addmessage';
1484 if ($action ==
'presend' || $action ==
'presend_addmessage') {
1489 $outputlangs = $langs;
1492 $newlang =
GETPOST(
'lang_id',
'aZ09');
1494 $newlang =
$object->thirdparty->default_lang;
1496 if (!empty($newlang)) {
1497 $outputlangs =
new Translate(
"", $conf);
1498 $outputlangs->setDefaultLang($newlang);
1501 $arrayoffamiliestoexclude = array(
'objectamount');
1503 $action =
'add_message';
1504 $modelmail =
'ticket_send';
1507 $morehtmlright =
'';
1511 $morehtmlright .= $form->textwithpicto(
'<span class="opacitymedium">'.$langs->trans(
"TicketMessageSubstitutionReplacedByGenericValues").
'</span>', $help, 1,
'helpclickable',
'', 0, 3,
'helpsubstitution');
1515 print
'<div id="formmailbeforetitle" name="formmailbeforetitle"></div>';
1517 print
load_fiche_titre($langs->trans(
'TicketAddMessage'), $morehtmlright,
'messages@ticket');
1523 $formticket->action = $action;
1524 $formticket->track_id =
$object->track_id;
1525 $formticket->ref =
$object->ref;
1526 $formticket->id =
$object->id;
1527 $formticket->trackid =
'tic'.$object->id;
1529 $formticket->withfile = 2;
1530 $formticket->withcancel = 1;
1531 $formticket->param = array(
'fk_user_create' => $user->id);
1532 $formticket->param[
'langsmodels'] = (empty($newlang) ? $langs->defaultlang : $newlang);
1535 $formticket->param[
'models'] = $modelmail;
1536 $formticket->param[
'models_id'] =
GETPOSTINT(
'modelmailselected');
1538 $formticket->param[
'returnurl'] = $_SERVER[
"PHP_SELF"].
'?track_id='.
$object->track_id;
1540 $formticket->withsubstit = 1;
1541 $formticket->substit = $substitutionarray;
1542 $formticket->backtopage = $backtopage;
1544 $formticket->showMessageForm(
'100%');
1550 $param =
'&id='.$object->id;
1551 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
1552 $param .=
'&contextpage='.$contextpage;
1554 if ($limit > 0 && $limit != $conf->liste_limit) {
1555 $param .=
'&limit='.$limit;
1558 $param .=
'&actioncode='.urlencode($actioncode);
1560 if ($search_agenda_label) {
1561 $param .=
'&search_agenda_label='.urlencode($search_agenda_label);
1564 $morehtmlright =
'';
1566 $messagingUrl = DOL_URL_ROOT.
'/ticket/agenda.php?track_id='.
$object->track_id;
1567 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'MessageListViewType'),
'',
'fa fa-bars imgforviewmode', $messagingUrl,
'', 1);
1570 $btnstatus =
$object->status < Ticket::STATUS_CLOSED && $action !=
"presend" && $action !=
"presend_addmessage" && $action !=
"add_message";
1571 $url =
'card.php?track_id='.$object->track_id.
'&action=presend_addmessage&mode=init';
1572 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'TicketAddMessage'),
'',
'fa fa-comment-dots', $url,
'add-new-ticket-title-button', $btnstatus);
1575 $btnstatus =
$object->status < Ticket::STATUS_CLOSED && $action !=
"presend" && $action !=
"presend_addmessage" && $action !=
"add_message";
1576 $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);
1577 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'AddAction'),
'',
'fa fa-plus-circle', $url,
'add-new-ticket-even-button', $btnstatus);
1579 print_barre_liste($langs->trans(
"ActionsOnTicket"), 0, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', 0, -1,
'', 0, $morehtmlright,
'', 0, 1, 1);
1583 $filters[
'search_agenda_label'] = $search_agenda_label;
1584 $filters[
'search_rowid'] = $search_rowid;
1586 show_actions_messaging($conf, $langs, $db,
$object,
null, 0, $actioncode,
'', $filters, $sortfield, $sortorder);
1589 if ($action !=
'presend' && $action !=
'presend_addmessage' && $action !=
'add_message') {
1590 print
'<div class="fichecenter"><div class="fichehalfleft">';
1591 print
'<a name="builddoc"></a>';
1597 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
1598 $genallowed = $permissiontoadd;
1599 $delallowed = $permissiontodelete;
1603 $codelang =
$object->thirdparty->default_lang;
1606 print $formfile->showdocuments(
'ticket', $filename, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 28, 0,
'', 0,
'', $codelang);
1609 $linktoelem = $form->showLinkToObjectBlock(
$object,
null, array(
'ticket'));
1610 $somethingshown = $form->showLinkedObjectBlock(
$object, $linktoelem);
1613 print
'<br><!-- Link to public interface -->'.
"\n";
1618 print
'<div class="fichehalfright">';
1622 $morehtmlcenter =
'<div class="nowraponall">';
1623 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullConversation'),
'',
'fa fa-comments imgforviewmode', DOL_URL_ROOT.
'/ticket/messaging.php?id='.
$object->id);
1624 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullList'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/ticket/agenda.php?id='.
$object->id);
1625 $morehtmlcenter .=
'</div>';
1628 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1630 $somethingshown = $formactions->showactions(
$object,
'ticket', $socid, 1,
'listactions', $MAXEVENT,
'', $morehtmlcenter);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class Actions of the module ticket.
Class to manage categories.
Class to manage contracts.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
Class to manage Dolibarr users.
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7)
Return, in clear text, value of a number of seconds in days, hours and minutes.
show_actions_messaging($conf, $langs, $db, $filterobj, $objcon=null, $noprint=0, $actioncode='', $donetodo='done', $filters=array(), $sortfield='a.datep, a.id', $sortorder='DESC')
Show html area with actions in messaging format.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_print_phone($phone, $countrycode='', $cid=0, $socid=0, $addlink='', $separ=" ", $withpicto='', $titlealt='', $adddivfloat=0, $morecss='')
Format phone numbers according to country.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
roundUpToNextMultiple($n, $x=5)
Round to next multiple.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0)
Set event message in dol_events session object.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null, $include=null)
Return array of possible common substitutions.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dolPrintLabel($s)
Return a string label (so on 1 line only and that should not contains any HTML) ready to be output on...
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
Class to generate the form for creating a new ticket.
project_prepare_head(Project $project, $moreparam='')
Prepare array with list of tabs.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
showDirectPublicLink($object)
Return string with full Url.
ticket_prepare_head($object)
Build tabs for a Ticket object.