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';
64$langs->loadLangs(array(
"companies",
"other",
"ticket"));
69$track_id =
GETPOST(
'track_id',
'alpha', 3);
73$notifyTiers =
GETPOST(
"notify_tiers_at_create",
'alpha');
75$action =
GETPOST(
'action',
'aZ09');
76$cancel =
GETPOST(
'cancel',
'alpha');
77$backtopage =
GETPOST(
'backtopage',
'alpha');
78$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
79$contextpage =
GETPOST(
'contextpage',
'aZ');
82$sortfield =
GETPOST(
'sortfield',
'aZ09comma') ?
GETPOST(
'sortfield',
'aZ09comma') :
"a.datep";
83$sortorder =
GETPOST(
'sortorder',
'aZ09comma') ?
GETPOST(
'sortorder',
'aZ09comma') :
"desc";
84$search_rowid =
GETPOST(
'search_rowid');
85$search_agenda_label =
GETPOST(
'search_agenda_label');
87if (
GETPOST(
'actioncode',
'array')) {
88 $actioncode =
GETPOST(
'actioncode',
'array', 3);
89 if (!count($actioncode)) {
98$hookmanager->initHooks(array(
'ticketcard',
'globalcard'));
104$extrafields->fetch_name_optionals_label(
$object->table_element);
106$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
109$search_all =
GETPOST(
"search_all",
'alpha');
111foreach (
$object->fields as $key => $val) {
112 if (
GETPOST(
'search_'.$key,
'alpha')) {
113 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
117if (empty($action) && empty($id) && empty($ref)) {
122if (
GETPOST(
'modelselected',
'alpha')) {
128if ($id || $track_id || $ref) {
129 $res =
$object->fetch($id, $ref, $track_id);
141$url_page_current = DOL_URL_ROOT.
'/ticket/card.php';
144if ($user->socid > 0) {
145 $socid = $user->socid;
149$triggermodname =
'TICKET_MODIFY';
152$permissiontoread = $user->hasRight(
'ticket',
'read');
153$permissiontoadd = $user->hasRight(
'ticket',
'write');
154$permissiontodelete = $user->hasRight(
'ticket',
'delete');
155$permissiontoeditextra = $permissiontoadd;
156if (
GETPOST(
'attribute',
'aZ09') && isset($extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')])) {
158 $permissiontoeditextra =
dol_eval((
string) $extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')]);
161$upload_dir =
$conf->ticket->dir_output;
169$parameters = array();
170$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
176if (empty($reshook)) {
178 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
180 $search_agenda_label =
'';
183 $backurlforlist = DOL_URL_ROOT .
'/ticket/list.php';
185 if (empty($backtopage) || ($cancel && empty($id))) {
186 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
187 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
188 $backtopage = $backurlforlist;
190 $backtopage = DOL_URL_ROOT .
'/ticket/card.php?id=' . ((!empty($id) &&
$id > 0) ? $id :
'__ID__');
196 if (!empty($backtopageforcancel)) {
197 header(
"Location: " . $backtopageforcancel);
199 } elseif (!empty($backtopage)) {
200 header(
"Location: " . $backtopage);
206 if ((($action ==
'add' &&
GETPOST(
'save',
'alpha')) || ($action ==
'update' &&
$object->status < Ticket::STATUS_CLOSED)) && $permissiontoadd) {
207 $ifErrorAction = ($action ==
'add' ?
'create' :
'edit');
208 if ($action ==
'add') {
214 'ref' => [
'check' =>
'alpha',
'langs' =>
'Ref'],
215 'type_code' => [
'check' =>
'alpha',
'langs' =>
'TicketTypeRequest'],
216 'category_code' => [
'check' =>
'alpha',
'langs' =>
'TicketCategory'],
217 'severity_code' => [
'check' =>
'alpha',
'langs' =>
'TicketSeverity'],
218 'subject' => [
'check' =>
'alphanohtml',
'langs' =>
'Subject'],
219 'message' => [
'check' =>
'restricthtml',
'langs' =>
'Message']
224 if (!empty($error)) {
225 $action = $ifErrorAction;
228 $ret = $extrafields->setOptionalsFromPost(
null,
$object);
232 $getRef =
GETPOST(
'ref',
'alpha');
234 if (!empty($getRef)) {
235 $isExistingRef =
$object->checkExistingRef($action, $getRef);
237 $isExistingRef =
true;
242 if ($isExistingRef) {
243 if ($action ==
'update') {
247 } elseif ($action ==
'add') {
252 if (!empty($getRef)) {
265 $fk_user_assign =
GETPOSTINT(
'fk_user_assign');
269 if ($fk_user_assign > 0) {
270 $object->fk_user_assign = $fk_user_assign;
271 $object->status = $object::STATUS_ASSIGNED;
274 if ($action ==
'add') {
276 $object->type_label = $langs->trans($langs->getLabelFromKey($db,
$object->type_code,
'c_ticket_type',
'code',
'label'));
277 $object->category_label = $langs->trans($langs->getLabelFromKey($db,
$object->category_code,
'c_ticket_category',
'code',
'label'));
278 $object->severity_label = $langs->trans($langs->getLabelFromKey($db,
$object->severity_code,
'c_ticket_severity',
'code',
'label'));
279 $object->fk_user_create = $user->id;
280 $object->email_from = $user->email;
282 $notifyTiers =
GETPOST(
"notify_tiers_at_create",
'alpha');
283 $object->notify_tiers_at_create = empty($notifyTiers) ? 0 : 1;
293 $action = $ifErrorAction;
298 $categories =
GETPOST(
'categories',
'array');
299 $object->setCategories($categories);
302 if ($action ==
'add') {
306 $type_contact =
GETPOST(
"type",
'alpha');
308 if ($contactid > 0 && $type_contact) {
310 $result =
$object->add_contact($contactid, $typeid,
'external');
314 if (
GETPOST(
'origin',
'alpha') ==
'projet') {
320 if ($projectid > 0) {
321 $object->setProject($projectid);
325 if (
getDolGlobalString(
'TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND') && $user->hasRight(
'ticket',
'write')) {
326 if (!
$object->markAsRead($user) > 0) {
332 if ((empty($fk_user_assign) &&
getDolGlobalInt(
'TICKET_AUTO_ASSIGN_USER_CREATE') == 1) || (
getDolGlobalInt(
'TICKET_AUTO_ASSIGN_USER_CREATE') == 2)) {
333 $result =
$object->assignUser($user, $user->id, 1);
334 $object->add_contact($user->id,
"SUPPORTTEC",
'internal');
340 $object->copyFilesForTicket(
'');
346 if (!empty($backtopage)) {
350 $url =
'card.php?track_id=' . urlencode(
$object->track_id);
353 $url =
'card.php?track_id=' . urlencode(
$object->track_id);
356 header(
"Location: " . $url);
363 $action = $ifErrorAction;
368 if ($action ==
"set_read" && $permissiontoadd) {
371 if (
$object->markAsRead($user) > 0) {
374 header(
"Location: card.php?track_id=" .
$object->track_id);
383 if ($action ==
"assign_user" &&
GETPOST(
'btn_assign_user',
'alpha') && $permissiontoadd) {
385 $useroriginassign =
$object->fk_user_assign;
395 $ret =
$object->assignUser($user, $usertoassign);
403 if ($useroriginassign > 0) {
404 $internal_contacts =
$object->listeContact(-1,
'internal', 0,
'SUPPORTTEC');
405 foreach ($internal_contacts as $key => $contact) {
406 if ($contact[
'id'] !== $usertoassign) {
407 $result =
$object->delete_contact($contact[
'rowid']);
416 if ($usertoassign > 0 && $usertoassign !== $useroriginassign) {
417 $result =
$object->add_contact($usertoassign,
"SUPPORTTEC",
'internal', $notrigger = 0);
427 $object->fetch_user($usertoassign);
430 header(
"Location: card.php?track_id=" .
$object->track_id);
440 if ($action ==
'add_message' && GETPOSTISSET(
'btn_add_message') && $permissiontoread) {
444 if (!empty($backtopage)) {
447 $url =
'card.php?track_id=' . urlencode(
$object->track_id);
450 header(
"Location: " . $url);
458 if (($action ==
"confirm_close" || $action ==
"confirm_abandon") &&
GETPOST(
'confirm',
'alpha') ==
'yes' && $permissiontoadd) {
460 if (GETPOSTISSET(
'contactid')) {
464 if (
$object->close($user, ($action ==
"confirm_abandon" ? 1 : 0))) {
467 $url =
'card.php?track_id=' .
GETPOST(
'track_id',
'alpha');
468 header(
"Location: " . $url);
476 if ($action ==
"confirm_public_close" &&
GETPOST(
'confirm',
'alpha') ==
'yes' && $permissiontoadd) {
478 if ($_SESSION[
'email_customer'] ==
$object->origin_email || $_SESSION[
'email_customer'] ==
$object->thirdparty->email) {
483 setEventMessages(
'<div class="confirm">' . $langs->trans(
'TicketMarkedAsClosed') .
'</div>',
null,
'mesgs');
485 $url =
'card.php?track_id=' .
GETPOST(
'track_id',
'alpha');
486 header(
"Location: " . $url);
494 if ($action ==
'confirm_delete_ticket' &&
GETPOST(
'confirm',
'alpha') ==
"yes" && $permissiontodelete) {
496 if (
$object->delete($user) > 0) {
497 setEventMessages(
'<div class="confirm">' . $langs->trans(
'TicketDeletedSuccess') .
'</div>',
null,
'mesgs');
498 header(
"Location: " . DOL_URL_ROOT .
"/ticket/list.php");
501 $langs->load(
"errors");
502 $mesg =
'<div class="error">' . $langs->trans(
$object->error) .
'</div>';
509 if ($action ==
'set_thirdparty' && $user->hasRight(
'ticket',
'write')) {
512 $url = $_SERVER[
"PHP_SELF"] .
'?track_id=' .
GETPOST(
'track_id',
'alpha');
513 header(
"Location: " . $url);
519 if ($action ==
'set_progression' && $user->hasRight(
'ticket',
'write')) {
523 $url =
'card.php?track_id=' .
$object->track_id;
524 header(
"Location: " . $url);
530 if ($action ==
'set_categories' && $user->hasRight(
'ticket',
'write')) {
534 $url =
'card.php?track_id=' .
$object->track_id;
535 header(
"Location: " . $url);
541 if ($action ==
'setsubject' && $user->hasRight(
'ticket',
'write')) {
543 if ($action ==
'setsubject') {
547 if ($action ==
'setsubject' && empty(
$object->subject)) {
549 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Subject")),
null,
'errors');
553 if (!
$object->update($user) >= 0) {
559 header(
"Location: " . $_SERVER[
'PHP_SELF'] .
"?track_id=" .
$object->track_id);
564 if ($action ==
'confirm_reopen' && $user->hasRight(
'ticket',
'manage') && !
GETPOST(
'cancel')) {
567 if (
$object->status == Ticket::STATUS_CLOSED ||
$object->status == Ticket::STATUS_CANCELED) {
568 if (
$object->fk_user_assign !=
null) {
569 $res =
$object->setStatut(Ticket::STATUS_ASSIGNED,
null,
'', $triggermodname);
571 $res =
$object->setStatut(Ticket::STATUS_NOT_READ,
null,
'', $triggermodname);
574 $url =
'card.php?track_id=' .
$object->track_id;
575 header(
"Location: " . $url);
583 } elseif ($action ==
'classin' && $permissiontoadd) {
586 $object->setProject($projectid);
587 $url =
'card.php?track_id=' .
$object->track_id;
588 header(
"Location: " . $url);
591 } elseif ($action ==
'setcontract' && $permissiontoadd) {
595 $url =
'card.php?track_id=' .
$object->track_id;
596 header(
"Location: " . $url);
599 } elseif ($action ==
"set_message" && $user->hasRight(
'ticket',
'manage')) {
603 $fieldtomodify =
GETPOST(
'message_initial',
'restricthtml');
605 $object->message = $fieldtomodify;
612 setEventMessages($langs->trans(
'TicketMessageSuccesfullyUpdated'),
null,
'mesgs');
620 } elseif ($action ==
'confirm_set_status' && $permissiontoadd && !
GETPOST(
'cancel')) {
625 $res =
$object->setStatut($new_status,
null,
'',
'TICKET_MODIFY');
628 $url =
'card.php?track_id=' .
$object->track_id;
629 header(
"Location: " . $url);
639 if ($action ==
"update_extras" && $permissiontoeditextra) {
642 $attribute_name =
GETPOST(
'attribute',
'aZ09');
644 $ret = $extrafields->setOptionalsFromPost(
null,
$object, $attribute_name);
650 $result =
$object->updateExtraField($attribute_name, $triggermodname);
658 $action =
'edit_extras';
662 if ($action ==
"change_property" &&
GETPOST(
'btn_update_ticket_prop',
'alpha') && $permissiontoadd) {
666 $object->severity_code =
GETPOST(
'update_value_severity',
'aZ09');
667 $object->category_code =
GETPOST(
'update_value_category',
'aZ09');
680 $permissiondellink = $user->hasRight(
'ticket',
'write');
681 include DOL_DOCUMENT_ROOT .
'/core/actions_dellink.inc.php';
684 include DOL_DOCUMENT_ROOT .
'/core/actions_builddoc.inc.php';
687 $triggersendname =
'TICKET_SENTBYMAIL';
689 $autocopy =
'MAIN_MAIL_AUTOCOPY_TICKET_TO';
690 $trackid =
'tic' .
$object->id;
691 include DOL_DOCUMENT_ROOT .
'/core/actions_sendmails.inc.php';
694 if (GETPOSTISSET(
'actionbis') && $action ==
'presend') {
695 $action =
'presend_addmessage';
704$userstat =
new User($db);
705$form =
new Form($db);
708if (isModEnabled(
'project')) {
712$help_url =
'EN:Module_Ticket|FR:DocumentationModuleTicket';
714$title = $actionobject->getTitle($action,
$object);
716llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-ticket page-card');
718if ($action ==
'create' || $action ==
'presend') {
719 if (empty($permissiontoadd)) {
727 $formticket->trackid =
'';
729 if (
GETPOST(
"mode",
"aZ09") ==
'init' && empty($_POST)) {
730 $formticket->clear_attached_files();
733 $formticket->withfromsocid = $socid ? $socid : $user->socid;
734 $formticket->withfromcontactid = $contactid ? $contactid :
'';
735 $formticket->withtitletopic = 1;
736 $formticket->withnotifytiersatcreate = ($notifyTiers ? 1 : (
getDolGlobalString(
'TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION') ? 1 : 0));
737 $formticket->withusercreate = 0;
738 $formticket->withref = 1;
739 $formticket->fk_user_create = $user->id;
740 $formticket->withfile = 2;
741 $formticket->withextrafields = 1;
742 $formticket->param = array(
'origin' =>
GETPOST(
'origin'),
'originid' =>
GETPOST(
'originid'));
744 $formticket->withcancel = 1;
747 if (
GETPOST(
"mode",
"aZ09") ==
'init') {
748 $formticket->clear_attached_files();
751 $formticket->showForm(1,
'create', 0,
null, $action,
$object);
754} elseif ($action ==
'edit' && $user->rights->ticket->write &&
$object->status < Ticket::STATUS_CLOSED) {
755 if (empty($permissiontoadd)) {
765 $formticket->trackid =
$object->track_id;
766 $formticket->withfromsocid =
$object->socid;
767 $formticket->withtitletopic = 1;
769 $formticket->withnotifytiersatcreate = 0;
770 $formticket->withusercreate = 0;
771 $formticket->withref = 1;
772 $formticket->fk_user_create = $user->id;
773 $formticket->withfile = 0;
774 $formticket->action =
'update';
775 $formticket->withextrafields = 1;
776 $formticket->param = array(
'origin' =>
GETPOST(
'origin'),
'originid' =>
GETPOST(
'originid'));
778 $formticket->withcancel = 1;
780 $formticket->showForm(0,
'edit', 0,
null, $action,
$object);
784 if (!empty($res) && $res > 0) {
786 if (!$user->socid && (
getDolGlobalString(
'TICKET_LIMIT_VIEW_ASSIGNED_ONLY') &&
$object->fk_user_assign != $user->id) && !$user->hasRight(
'ticket',
'manage')) {
793 if ($action ==
'close') {
794 $thirdparty_contacts =
$object->getInfosTicketExternalContact(1);
795 $contacts_select = array(
796 '-2' => $langs->trans(
'TicketNotifyAllTiersAtClose'),
797 '-3' => $langs->trans(
'TicketNotNotifyTiersAtClose')
799 foreach ($thirdparty_contacts as $thirdparty_contact) {
800 $contacts_select[$thirdparty_contact[
'id']] = $thirdparty_contact[
'civility'] .
' ' . $thirdparty_contact[
'lastname'] .
' ' . $thirdparty_contact[
'firstname'];
805 $formquestion = array(
807 'name' =>
'contactid',
809 'label' => $langs->trans(
'NotifyThirdpartyOnTicketClosing'),
810 'values' => $contacts_select,
811 'default' => $default
815 $formconfirm = $form->formconfirm($url_page_current.
"?track_id=".
$object->track_id, $langs->trans(
"CloseATicket"), $langs->trans(
"ConfirmCloseAticket"),
"confirm_close", $formquestion,
'', 1);
818 if ($action ==
'abandon') {
819 $formconfirm = $form->formconfirm($url_page_current.
"?track_id=".
$object->track_id, $langs->trans(
"AbandonTicket"), $langs->trans(
"ConfirmAbandonTicket"),
"confirm_abandon",
'',
'', 1);
822 if ($action ==
'delete') {
823 $formconfirm = $form->formconfirm($url_page_current.
"?track_id=".
$object->track_id, $langs->trans(
"Delete"), $langs->trans(
"ConfirmDeleteTicket"),
"confirm_delete_ticket",
'',
'', 1);
826 if ($action ==
'reopen') {
827 $formconfirm = $form->formconfirm($url_page_current.
'?track_id='.
$object->track_id, $langs->trans(
'ReOpen'), $langs->trans(
'ConfirmReOpenTicket'),
'confirm_reopen',
'',
'', 1);
830 if ($action ==
'set_status') {
833 $formconfirm = $form->formconfirm($url_page_current.
"?track_id=".
$object->track_id.
"&new_status=".$new_status, $langs->trans(
"TicketChangeStatus"), $langs->trans(
"TicketConfirmChangeStatus", $langs->transnoentities(
$object->labelStatusShort[$new_status])),
"confirm_set_status",
'',
'', 1);
837 $parameters = array(
'formConfirm' => $formconfirm);
838 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters,
$object, $action);
839 if (empty($reshook)) {
840 $formconfirm .= $hookmanager->resPrint;
841 } elseif ($reshook > 0) {
842 $formconfirm = $hookmanager->resPrint;
849 if ($projectid > 0) {
850 $projectstat =
new Project($db);
851 if ($projectstat->fetch($projectid) > 0) {
852 $projectstat->fetch_thirdparty();
856 $userWrite = $projectstat->restrictedProjectArea($user,
'write');
862 print
dol_get_fiche_head($head,
'ticket', $langs->trans(
"Project"), 0, ($projectstat->public ?
'projectpub' :
'project'));
864 print
'<table class="border centpercent">';
866 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
869 print
'<tr><td>'.$langs->trans(
'Ref').
'</td><td colspan="3">';
871 if (!$user->hasRight(
'projet',
'all',
'lire')) {
872 $objectsListId = $projectstat->getProjectsAuthorizedForUser($user, $mine, 0);
873 $projectstat->next_prev_filter =
"rowid:IN:".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0');
875 print $form->showrefnav($projectstat,
'ref', $linkback, 1,
'ref',
'ref',
'');
879 print
'<tr><td>'.$langs->trans(
"Label").
'</td><td>'.$projectstat->title.
'</td></tr>';
882 print
"<tr><td>".$langs->trans(
"ThirdParty").
"</td>";
883 print
'<td colspan="3">';
884 if ($projectstat->thirdparty->id > 0) {
885 print $projectstat->thirdparty->getNomUrl(1);
893 print
'<tr><td>'.$langs->trans(
"Visibility").
'</td><td>';
894 if ($projectstat->public) {
895 print $langs->trans(
'SharedProject');
897 print $langs->trans(
'PrivateProject');
903 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>'.$projectstat->getLibStatut(4).
'</td></tr>';
909 print
"ErrorRecordNotFound";
911 } elseif ($socid > 0) {
917 dol_banner_tab(
$object->thirdparty,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom');
923 $object->next_prev_filter =
"te.fk_user_assign:=:".((int) $user->id);
924 } elseif ($user->socid > 0) {
925 $object->next_prev_filter =
"te.fk_soc:=:".((int) $user->socid);
930 print
dol_get_fiche_head($head,
'tabTicket', $langs->trans(
"Ticket"), -1,
'ticket', 0,
'',
'', 0,
'', 1);
932 $morehtmlref =
'<div class="refidno">';
934 if ($user->hasRight(
'ticket',
'write') && !$user->socid) {
935 $morehtmlref .=
'<a class="editfielda" href="'.$url_page_current.
'?action=editsubject&token='.
newToken().
'&track_id='.
$object->track_id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetTitle'), 0).
'</a> ';
937 if ($action !=
'editsubject') {
940 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
941 $morehtmlref .=
'<input type="hidden" name="action" value="setsubject">';
942 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
943 $morehtmlref .=
'<input type="hidden" name="id" value="'.$object->id.
'">';
944 $morehtmlref .=
'<input type="text" class="minwidth300" id="subject" name="subject" value="'.$object->subject.
'" autofocus="">';
945 $morehtmlref .=
'<input type="submit" class="smallpaddingimp button valignmiddle" name="modify" value="'.$langs->trans(
"Modify").
'">';
946 $morehtmlref .=
'<input type="submit" class="smallpaddingimp button button-cancel vlignmiddle" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
947 $morehtmlref .=
'</form>';
952 if (
$object->fk_user_create > 0) {
953 $morehtmlref .=
'<br>';
956 $fuser =
new User($db);
957 $fuser->fetch(
$object->fk_user_create);
958 $morehtmlref .= $fuser->getNomUrl(-1);
962 $createdfrompublicticket = 0;
963 $createdfromemailcollector = 0;
964 if (!empty(
$object->origin_email) && (empty(
$object->email_msgid) || preg_match(
'/dolibarr\-tic\d+/',
$object->email_msgid))) {
966 $createdfrompublicticket = 1;
967 } elseif (!empty(
$object->email_msgid)) {
969 $createdfromemailcollector = 1;
974 if ($createdfrompublicticket) {
975 $htmltooltip .= $langs->trans(
"OriginEmail").
': '.
$object->origin_email;
977 $morehtmlref .= ($createdbyshown ?
' - ' :
'<br>');
979 $morehtmlref .=
img_picto(
'',
'email',
'class="paddingrightonly"');
980 $morehtmlref .=
dol_escape_htmltag(
$object->origin_email).
' <small class="hideonsmartphone opacitymedium">- '.$form->textwithpicto($langs->trans(
"CreatedByPublicPortal"), $htmltooltip, 1,
'help',
'', 0, 3,
'tooltipcreatedbyportal').
'</small>';
981 } elseif ($createdfromemailcollector) {
982 $langs->load(
"mails");
984 $htmltooltip .=
'<b>'.$langs->trans(
"EmailMsgID").
':</b> '.
$object->email_msgid;
985 $htmltooltip .=
'<br><b>'.$langs->trans(
"EmailDate").
':</b> '.
dol_print_date(
$object->email_date,
'dayhour');
986 $htmltooltip .=
'<br><b>'.$langs->trans(
"MailFrom").
':</b> '.
$object->origin_email;
987 $htmltooltip .=
'<br><b>'.$langs->trans(
"MailReply").
':</b> '.
$object->origin_replyto;
988 $htmltooltip .=
'<br><b>'.$langs->trans(
"MailReferences").
':</b> '.
$object->origin_references;
989 $morehtmlref .= ($createdbyshown ?
' - ' :
'<br>');
991 $morehtmlref .=
img_picto(
'From',
'email',
'class="paddingrightonly"');
994 $morehtmlref .=
' - '.img_picto(
'ReplyTo',
'email',
'class="paddingrightonly"');
997 $morehtmlref .=
' <small class="hideonsmartphone opacitymedium">- '.$form->textwithpicto($langs->trans(
"CreatedByEmailCollector"), $htmltooltip, 1,
'help',
'', 0, 3,
'tooltipcreatedbyemailcollector').
'</small>';
1000 $permissiontoedit =
$object->status < 8 && !$user->socid && $user->hasRight(
'ticket',
'write');
1004 if (isModEnabled(
"societe")) {
1005 $morehtmlref .=
'<br>';
1006 if ($action !=
'editcustomer' && $permissiontoedit) {
1007 $morehtmlref .=
img_picto($langs->trans(
"ThirdParty"),
'company',
'class="pictofixedwidth"');
1008 $morehtmlref .=
'<a class="editfielda" href="'.$url_page_current.
'?action=editcustomer&token='.
newToken().
'&track_id='.
$object->track_id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetThirdParty'), 0).
'</a> ';
1010 $morehtmlref .= $form->form_thirdparty($url_page_current.
'?track_id='.
$object->track_id, (
string)
$object->socid, $action ==
'editcustomer' ?
'editcustomer' :
'none',
'', 1, 0, 0, array(), 1);
1012 $morehtmlref .=
' - <a href="'.DOL_URL_ROOT.
'/ticket/list.php?socid='.
$object->socid.
'&sortfield=t.datec&sortorder=desc'.(
getDolGlobalBool(
'TICKET_CLIENT_OTHER_TICKET_ONLY_OPEN') ?
'&search_fk_statut[]=openall' :
'').
'">'.
img_picto($langs->trans(
"Tickets"),
'ticket',
'class="pictofixedwidth"').
' '.$langs->trans(
"TicketHistory").
'</a>';
1017 if (isModEnabled(
'project')) {
1018 $langs->load(
"projects");
1019 $morehtmlref .=
'<br>';
1020 if ($permissiontoedit) {
1022 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project'.((is_object(
$object->project) &&
$object->project->public) ?
'pub' :
''),
'class="pictofixedwidth"');
1023 if ($action !=
'classify') {
1024 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
1026 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->socid, (
string)
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
1028 if (!empty(
$object->fk_project)) {
1030 $morehtmlref .=
$object->project->getNomUrl(1);
1031 if (
$object->project->title) {
1032 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag(
$object->project->title).
'</span>';
1041 if (isModEnabled(
'contract')) {
1042 $langs->load(
'contracts');
1043 $morehtmlref .=
'<br>';
1044 if ($permissiontoedit) {
1045 $morehtmlref .=
img_picto($langs->trans(
"Contract"),
'contract',
'class="pictofixedwidth"');
1046 if ($action ==
'edit_contrat') {
1048 $morehtmlref .= $formcontract->formSelectContract($_SERVER[
"PHP_SELF"].
'?id='.
$object->id,
$object->socid,
$object->fk_contract,
'contratid', 0, 1, 1, 1);
1050 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit_contrat&token='.
newToken().
'&id='.
$object->id.
'">';
1051 $morehtmlref .=
img_edit($langs->trans(
'SetContract'));
1052 $morehtmlref .=
'</a>';
1055 if (!empty(
$object->fk_contract)) {
1056 $contratstatic =
new Contrat($db);
1057 $contratstatic->fetch(
$object->fk_contract);
1059 $morehtmlref .= $contratstatic->getNomUrl(0, 0, 1);
1065 $morehtmlref .=
'</div>';
1067 $linkback =
'<a href="'.DOL_URL_ROOT.
'/ticket/list.php?restore_lastsearch_values=1"><strong>'.$langs->trans(
"BackToList").
'</strong></a> ';
1069 dol_banner_tab(
$object,
'ref', $linkback, ($user->socid ? 0 : 1),
'ref',
'ref', $morehtmlref);
1071 print
'<div class="fichecenter">';
1072 print
'<div class="fichehalfleft">';
1073 print
'<div class="underbanner clearboth"></div>';
1075 print
'<table class="border tableforfield centpercent">';
1078 print
'<tr><td class="titlefieldmiddle">'.$langs->trans(
"TicketTrackId").
'</td><td>';
1079 if (!empty(
$object->track_id)) {
1082 print $form->showrefnav(
$object,
'id', $linkback, 1,
'rowid',
'track_id');
1087 print $langs->trans(
'None');
1101 print
'<tr><td>'.$langs->trans(
"DateCreation").
'</td><td>';
1124 print
'<tr><td>'.$langs->trans(
"TicketReadOn").
'</td><td>';
1125 if (!empty(
$object->date_read)) {
1127 print
'<span class="opacitymedium"><span class="small"> - '.$langs->trans(
"TimeElapsedSince").
': ';
1135 print
'<tr><td>'.$langs->trans(
"TicketCloseOn").
'</td><td>';
1136 if (!empty(
$object->date_close)) {
1143 print
'<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
1144 print $langs->trans(
"AssignedTo");
1145 if (isset(
$object->status) &&
$object->status < $object::STATUS_CLOSED &&
GETPOST(
'set',
'alpha') !=
"assign_ticket" && $user->hasRight(
'ticket',
'manage')) {
1146 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>';
1148 print
'</td></tr></table>';
1150 if (
GETPOST(
'set',
'alpha') !=
"assign_ticket" &&
$object->fk_user_assign > 0) {
1151 $userstat->fetch(
$object->fk_user_assign);
1152 print $userstat->getNomUrl(-1);
1156 if (
GETPOST(
'set',
'alpha') ==
"assign_ticket" &&
$object->status < 8 && !$user->socid && $user->hasRight(
'ticket',
'write')) {
1157 print
'<form method="post" name="ticket" enctype="multipart/form-data" action="'.$url_page_current.
'">';
1158 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1159 print
'<input type="hidden" name="action" value="assign_user">';
1160 print
'<input type="hidden" name="track_id" value="'.$object->track_id.
'">';
1162 print $form->select_dolusers(empty(
$object->fk_user_assign) ? $user->id :
$object->fk_user_assign,
'fk_user_assign', 1);
1163 print
' <input type="submit" class="button smallpaddingimp" name="btn_assign_user" value="'.$langs->trans(
"Validate").
'" />';
1170 print
'<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
1171 print $langs->trans(
'Progression').
'</td><td class="left">';
1173 if ($action !=
'progression' && isset(
$object->status) &&
$object->status < $object::STATUS_CLOSED && !$user->socid) {
1174 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>';
1176 print
'</tr></table>';
1178 if ($user->hasRight(
'ticket',
'write') && $action ==
'progression') {
1179 print
'<form action="'.$url_page_current.
'" method="post">';
1180 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1181 print
'<input type="hidden" name="track_id" value="'.$track_id.
'">';
1182 print
'<input type="hidden" name="action" value="set_progression">';
1183 print
'<input type="text" class="flat width75" name="progress" value="'.$object->progress.
'">';
1184 print
' <input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
'Modify').
'">';
1193 if (isModEnabled(
'intervention')) {
1195 $num = count(
$object->linkedObjects);
1199 foreach (
$object->linkedObjects as $objecttype => $objects) {
1200 if ($objecttype ==
"fichinter") {
1201 '@phan-var-force Fichinter[] $objects';
1202 foreach ($objects as $fichinter) {
1205 $timing += $fichinter->duration;
1211 print $form->textwithpicto($langs->trans(
"TicketDurationAuto"), $langs->trans(
"TicketDurationAutoInfos"), 1);
1218 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1224 print
'</div><div class="fichehalfright">';
1227 print
'<form method="post" name="formticketproperties" action="'.$url_page_current.
'">';
1228 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1229 print
'<input type="hidden" name="action" value="change_property">';
1230 print
'<input type="hidden" name="track_id" value="'.$track_id.
'">';
1231 print
'<input type="hidden" name="trackid" value="'.$trackid.
'">';
1234 print
'<div class="div-table-responsive-no-min">';
1235 print
'<table class="border tableforfield centpercent margintable bordertopimp">';
1236 print
'<tr class="liste_titre">';
1238 print $langs->trans(
'TicketProperties');
1241 if (
GETPOST(
'set',
'alpha') ==
'properties' && $user->hasRight(
'ticket',
'write')) {
1242 print
'<input type="submit" class="button smallpaddingimp" name="btn_update_ticket_prop" value="'.$langs->trans(
"Modify").
'" />';
1245 if (isset(
$object->status) && (
$object->status < $object::STATUS_NEED_MORE_INFO || !
getDolGlobalInt(
'TICKET_DISALLOW_CLASSIFICATION_MODIFICATION_EVEN_IF_CLOSED')) && $user->hasRight(
'ticket',
'write')) {
1246 print
' <a class="editfielda" href="card.php?track_id='.$object->track_id.
'&set=properties">'.
img_edit($langs->trans(
'Modify')).
'</a>';
1252 if (
GETPOST(
'set',
'alpha') ==
'properties' && $user->hasRight(
'ticket',
'write')) {
1255 print
'<td class="titlefield">';
1256 print $langs->trans(
'Type');
1258 $formticket->selectTypesTickets(
$object->type_code,
'update_value_type',
'', 2);
1264 print $langs->trans(
'TicketCategory');
1266 $formticket->selectGroupTickets(
$object->category_code,
'update_value_category',
'', 2, 0, 0, 0,
'maxwidth500 widthcentpercentminusxx');
1272 print $langs->trans(
'TicketSeverity');
1274 $formticket->selectSeveritiesTickets(
$object->severity_code,
'update_value_severity',
'', 2);
1279 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td><td>';
1280 if (!empty(
$object->type_code)) {
1281 print $langs->getLabelFromKey($db,
'TicketTypeShort'.
$object->type_code,
'c_ticket_type',
'code',
'label',
$object->type_code);
1286 if (!empty(
$object->category_code)) {
1287 $s = $langs->getLabelFromKey($db,
'TicketCategoryShort'.
$object->category_code,
'c_ticket_category',
'code',
'label',
$object->category_code);
1289 print
'<tr><td>'.$langs->trans(
"TicketCategory").
'</td><td class="tdoverflowmax200" title="'.
dol_escape_htmltag($s).
'">';
1293 print
'<tr><td>'.$langs->trans(
"TicketSeverity").
'</td><td>';
1294 if (!empty(
$object->severity_code)) {
1295 print $langs->getLabelFromKey($db,
'TicketSeverityShort'.
$object->severity_code,
'c_ticket_severity',
'code',
'label',
$object->severity_code);
1305 if (isModEnabled(
'category')) {
1306 print
'<!-- tag/categories -->'.
"\n";
1307 print
'<table class="border centpercent tableforfield">';
1309 print
'<td class="valignmiddle titlefield">';
1310 print
'<table class="nobordernopadding centpercent"><tr><td class="none">';
1311 print $langs->trans(
"Categories");
1312 if ($action !=
'categories' && !$user->socid) {
1313 print
'</td><td class="right"><a class="editfielda" href="'.$url_page_current.
'?action=categories&track_id='.urlencode(
$object->track_id).
'">'.
img_edit($langs->trans(
'Modify')).
'</a>';
1319 if ($user->hasRight(
'ticket',
'write') && $action ==
'categories') {
1320 print
'<td colspan="3">';
1321 print
'<form action="'.$url_page_current.
'" method="POST">';
1322 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1323 print
'<input type="hidden" name="track_id" value="'.$track_id.
'">';
1324 print
'<input type="hidden" name="action" value="set_categories">';
1325 print $form->selectCategories(Categorie::TYPE_TICKET,
'categories',
$object);
1326 print
'<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
'Save').
'">';
1330 print
'<td colspan="3">';
1331 print $form->showCategories(
$object->id, Categorie::TYPE_TICKET, 1);
1339 $actionobject->viewTicketOriginalMessage($user, $action,
$object);
1343 print
'<!-- navbar with status -->';
1344 if (!$user->socid && $user->hasRight(
'ticket',
'write') && isset(
$object->status) &&
$object->status < $object::STATUS_CLOSED) {
1345 $actionobject->viewStatusActions(
$object);
1350 print
load_fiche_titre($langs->trans(
'Contacts'),
'',
'title_companies.png');
1352 print
'<div class="div-table-responsive-no-min">';
1353 print
'<div class="tagtable centpercent noborder allwidth">';
1355 print
'<div class="tagtr liste_titre">';
1356 print
'<div class="tagtd">'.$langs->trans(
"Source").
'</div>
1357 <div class="tagtd">' . $langs->trans(
"Company").
'</div>
1358 <div class="tagtd">' . $langs->trans(
"Contacts").
'</div>
1359 <div class="tagtd">' . $langs->trans(
"ContactType").
'</div>
1360 <div class="tagtd">' . $langs->trans(
"Phone").
'</div>
1361 <div class="tagtd center">' . $langs->trans(
"Status").
'</div>';
1362 print
'</div><!-- tagtr -->';
1365 $companystatic =
new Societe($db);
1366 $contactstatic =
new Contact($db);
1367 $userstatic =
new User($db);
1369 foreach (array(
'internal',
'external') as $source) {
1371 $tab = $tmpobject->listeContact(-1, $source);
1373 $num = is_array($tab) ? count($tab) : 0;
1375 foreach (array_keys($tab) as $i) {
1378 print
'<div class="tagtr '.($var ?
'pair' :
'impair').
'">';
1380 print
'<div class="tagtd left">';
1381 if ($tab_i[
'source'] ==
'internal') {
1382 echo $langs->trans(
"User");
1385 if ($tab_i[
'source'] ==
'external') {
1386 echo $langs->trans(
"ThirdPartyContact");
1390 print
'<div class="tagtd left">';
1392 if ($tab_i[
'socid'] > 0) {
1393 $companystatic->fetch($tab_i[
'socid']);
1394 echo $companystatic->getNomUrl(-1);
1396 if ($tab_i[
'socid'] < 0) {
1399 if (!$tab_i[
'socid']) {
1404 print
'<div class="tagtd">';
1405 if ($tab_i[
'source'] ==
'internal') {
1406 if ($userstatic->fetch($tab_i[
'id'])) {
1407 print $userstatic->getNomUrl(-1);
1410 if ($tab_i[
'source'] ==
'external') {
1411 if ($contactstatic->fetch($tab_i[
'id'])) {
1412 print $contactstatic->getNomUrl(-1);
1416 <div class="tagtd">' . $tab_i[
'libelle'].
'</div>';
1418 print
'<div class="tagtd">';
1422 if (array_key_exists(
'phone_perso', $tab_i) && !empty($tab_i[
'phone_perso'])) {
1424 print
'<br>'.dol_print_phone((
string) $tab_i[
'phone_perso'],
'', 0, 0,
'AC_TEL').
'<br>';
1426 if (!empty($tab_i[
'phone_mobile'])) {
1428 print
dol_print_phone($tab_i[
'phone_mobile'],
'', 0, 0,
'AC_TEL').
'<br>';
1432 print
'<div class="tagtd center">';
1434 echo
'<a href="contact.php?track_id='.$object->track_id.
'&action=swapstatut&ligne='.$tab_i[
'rowid'].
'">';
1437 if ($tab_i[
'source'] ==
'internal') {
1438 $userstatic->id = $tab_i[
'id'];
1439 $userstatic->lastname = $tab_i[
'lastname'];
1440 $userstatic->firstname = $tab_i[
'firstname'];
1441 echo $userstatic->LibStatut($tab_i[
'statuscontact'], 3);
1443 if ($tab_i[
'source'] ==
'external') {
1444 $contactstatic->id = $tab_i[
'id'];
1445 $contactstatic->lastname = $tab_i[
'lastname'];
1446 $contactstatic->firstname = $tab_i[
'firstname'];
1447 echo $contactstatic->LibStatut($tab_i[
'statuscontact'], 3);
1455 print
'</div><!-- tagtr -->';
1461 print
'</div><!-- contact list -->';
1465 print
'</div></div>';
1466 print
'<div class="clearboth"></div>';
1472 if ($action !=
'presend' && $action !=
'presend_addmessage' && $action !=
'editline') {
1473 print
'<div class="tabsAction">'.
"\n";
1474 $parameters = array();
1475 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
1480 if (empty($reshook)) {
1482 if (isset(
$object->status) &&
$object->status < Ticket::STATUS_CLOSED && $action !=
"presend" && $action !=
"presend_addmessage") {
1483 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',
'');
1487 if (isset(
$object->status) &&
$object->status < Ticket::STATUS_CLOSED && $action !=
"presend" && $action !=
"presend_addmessage") {
1488 print
dolGetButtonAction(
'', $langs->trans(
'TicketAddPrivateMessage'),
'default', $_SERVER[
"PHP_SELF"].
'?action=presend_addmessage&mode=init&token='.
newToken().
'&track_id='.
$object->track_id.
'#formmailbeforetitle',
'');
1494 print
dolGetButtonAction($langs->trans(
'UnableToCreateInterIfNoSocid'), $langs->trans(
'TicketAddIntervention'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1496 if (
$object->fk_soc > 0 && isset(
$object->status) &&
$object->status < Ticket::STATUS_CLOSED && $user->hasRight(
'ficheinter',
'creer')) {
1497 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,
'');
1501 if (isset(
$object->status) &&
$object->status >= 0 &&
$object->status < Ticket::STATUS_CLOSED && $user->hasRight(
'ticket',
'write')) {
1502 print
dolGetButtonAction(
'', $langs->trans(
'CloseTicket'),
'default', $_SERVER[
"PHP_SELF"].
'?action=close&token='.
newToken().
'&track_id='.
$object->track_id,
'');
1506 if (isset(
$object->status) &&
$object->status > 0 &&
$object->status < Ticket::STATUS_CLOSED && $user->hasRight(
'ticket',
'write')) {
1507 print
dolGetButtonAction(
'', $langs->trans(
'AbandonTicket'),
'default', $_SERVER[
"PHP_SELF"].
'?action=abandon&token='.
newToken().
'&track_id='.
$object->track_id,
'');
1511 if (!$user->socid && (isset(
$object->status) && (
$object->status == Ticket::STATUS_CLOSED ||
$object->status == Ticket::STATUS_CANCELED)) && !$user->socid) {
1516 if ($permissiontoedit) {
1517 print
dolGetButtonAction(
'', $langs->trans(
'Modify'),
'default', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=edit&token='.
newToken(),
'', $permissiontoedit);
1521 if ($user->hasRight(
'ticket',
'delete') && !$user->socid) {
1525 print
'</div>'.
"\n";
1529 if (
GETPOST(
'modelselected')) {
1530 $action =
'presend';
1533 if (GETPOSTISSET(
'actionbis') && $action ==
'presend') {
1534 $action =
'presend_addmessage';
1538 if ($action ==
'presend' || $action ==
'presend_addmessage') {
1543 $outputlangs = $langs;
1546 $newlang =
GETPOST(
'lang_id',
'aZ09');
1548 $newlang =
$object->thirdparty->default_lang;
1550 if (!empty($newlang)) {
1552 $outputlangs->setDefaultLang($newlang);
1555 $arrayoffamiliestoexclude = array(
'objectamount');
1557 $action =
'add_message';
1558 $modelmail =
'ticket_send';
1561 $morehtmlright =
'';
1563 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude,
$object);
1565 $morehtmlright .= $form->textwithpicto(
'<span class="opacitymedium">'.$langs->trans(
"TicketMessageSubstitutionReplacedByGenericValues").
'</span>', $help, 1,
'helpclickable',
'', 0, 3,
'helpsubstitution');
1569 print
'<div id="formmailbeforetitle" name="formmailbeforetitle"></div>';
1571 print
load_fiche_titre($langs->trans(
'TicketAddMessage'), $morehtmlright,
'messages@ticket');
1577 $formticket->action = $action;
1578 $formticket->track_id =
$object->track_id;
1579 $formticket->ref =
$object->ref;
1580 $formticket->id =
$object->id;
1581 $formticket->trackid =
'tic'.$object->id;
1583 $formticket->withfile = 2;
1584 $formticket->withcancel = 1;
1585 $formticket->param = array(
'fk_user_create' => $user->id);
1586 $formticket->param[
'langsmodels'] = (empty($newlang) ? $langs->defaultlang : $newlang);
1589 $formticket->param[
'models'] = $modelmail;
1590 $formticket->param[
'models_id'] =
GETPOSTINT(
'modelmailselected');
1592 $formticket->param[
'returnurl'] = $_SERVER[
"PHP_SELF"].
'?track_id='.urldecode(
$object->track_id);
1594 $formticket->withsubstit = 1;
1595 $formticket->substit = $substitutionarray;
1596 $formticket->backtopage = $backtopage;
1598 $formticket->showMessageForm(
'100%');
1604 $param =
'&id='.$object->id;
1605 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
1606 $param .=
'&contextpage='.$contextpage;
1608 if ($limit > 0 && $limit !=
$conf->liste_limit) {
1609 $param .=
'&limit='.$limit;
1612 $param .=
'&actioncode='.urlencode($actioncode);
1614 if ($search_agenda_label) {
1615 $param .=
'&search_agenda_label='.urlencode($search_agenda_label);
1618 $morehtmlright =
'';
1620 $messagingUrl = DOL_URL_ROOT.
'/ticket/agenda.php?track_id='.
$object->track_id;
1621 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'MessageListViewType'),
'',
'fa fa-bars imgforviewmode', $messagingUrl,
'', 1);
1624 $btnstatus =
$object->status < Ticket::STATUS_CLOSED && $action !=
"presend" && $action !=
"presend_addmessage" && $action !=
"add_message";
1625 $url =
'card.php?track_id='.$object->track_id.
'&action=presend_addmessage&mode=init';
1626 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'TicketAddMessage'),
'',
'fa fa-comment-dots', $url,
'add-new-ticket-title-button', (
int) $btnstatus);
1629 $btnstatus =
$object->status < Ticket::STATUS_CLOSED && $action !=
"presend" && $action !=
"presend_addmessage" && $action !=
"add_message";
1630 $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);
1631 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'AddAction'),
'',
'fa fa-plus-circle', $url,
'add-new-ticket-even-button', (
int) $btnstatus);
1633 print_barre_liste($langs->trans(
"ActionsOnTicket"), 0, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', 0, -1,
'', 0, $morehtmlright,
'', 0, 1, 1);
1637 $filters[
'search_agenda_label'] = $search_agenda_label;
1638 $filters[
'search_rowid'] = $search_rowid;
1640 show_actions_messaging(
$conf, $langs, $db,
$object,
null, 0, $actioncode,
'', $filters, $sortfield, $sortorder);
1643 if ($action !=
'presend' && $action !=
'presend_addmessage' && $action !=
'add_message') {
1644 print
'<div class="fichecenter"><div class="fichehalfleft">';
1645 print
'<a name="builddoc"></a>';
1651 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
1652 $genallowed = $permissiontoadd;
1653 $delallowed = $permissiontodelete;
1657 $codelang =
$object->thirdparty->default_lang;
1660 print $formfile->showdocuments(
'ticket', $filename, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $codelang);
1663 $tmparray = $form->showLinkToObjectBlock(
$object, array(), array(
'ticket'), 1);
1664 $linktoelem = $tmparray[
'linktoelem'];
1665 $htmltoenteralink = $tmparray[
'htmltoenteralink'];
1666 print $htmltoenteralink;
1668 $somethingshown = $form->showLinkedObjectBlock(
$object, $linktoelem);
1671 print
'<br><!-- Link to public interface -->'.
"\n";
1676 print
'<div class="fichehalfright">';
1680 $morehtmlcenter =
'<div class="nowraponall">';
1681 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullConversation'),
'',
'fa fa-comments imgforviewmode', DOL_URL_ROOT.
'/ticket/messaging.php?id='.
$object->id);
1682 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullList'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/ticket/agenda.php?id='.
$object->id);
1683 $morehtmlcenter .=
'</div>';
1686 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1688 $somethingshown = $formactions->showactions(
$object,
'ticket', $socid, 1,
'listactions', $MAXEVENT,
'', $morehtmlcenter);
$id
Support class for third parties, contacts, members, users or resources.
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class Actions of the module ticket.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
dol_print_ip($ip, $mode=0, $showname=0)
Return an IP formatted to be shown on screen.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
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_print_phone($phone, $countrycode='', $cid=0, $socid=0, $addlink='', $separ=" ", $withpicto='', $titlealt='', $adddivfloat=0, $morecss='paddingright')
Format phone numbers according to country.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
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.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=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.
dolPrintLabel($s, $escapeonlyhtmltags=0)
Return a string label (so on 1 line only and that should not contains any HTML) ready to be output on...
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...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalBool($key, $default=false)
Return a Dolibarr global constant boolean value.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.