26if (!defined(
'NOREQUIREMENU')) {
27 define(
'NOREQUIREMENU',
'1');
30if (!defined(
"NOLOGIN")) {
31 define(
"NOLOGIN",
'1');
33if (!defined(
'NOIPCHECK')) {
34 define(
'NOIPCHECK',
'1');
36if (!defined(
'NOBROWSERNOTIF')) {
37 define(
'NOBROWSERNOTIF',
'1');
44$entity = (!empty($_GET[
'entity']) ? (int) $_GET[
'entity'] : (!empty($_POST[
'entity']) ? (int) $_POST[
'entity'] : 1));
45if (is_numeric($entity)) {
46 define(
"DOLENTITY", $entity);
50require
'../../main.inc.php';
51require_once DOL_DOCUMENT_ROOT.
'/ticket/class/actions_ticket.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formticket.class.php';
53require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
54require_once DOL_DOCUMENT_ROOT.
'/core/lib/ticket.lib.php';
55require_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
56require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
57require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
68$langs->loadLangs(array(
"companies",
"other",
"ticket"));
71$action =
GETPOST(
'action',
'aZ09');
74$track_id =
GETPOST(
'track_id',
'alpha');
75$email = strtolower(
GETPOST(
'email',
'alpha'));
79if (
GETPOST(
'btn_view_ticket_list')) {
80 unset($_SESSION[
'track_id_customer']);
81 unset($_SESSION[
'email_customer']);
83if (empty($track_id) && isset($_SESSION[
'track_id_customer'])) {
84 $track_id = $_SESSION[
'track_id_customer'];
86if (empty($email) && isset($_SESSION[
'email_customer'])) {
87 $email = strtolower($_SESSION[
'email_customer']);
93$hookmanager->initHooks(array(
'ticketpubliclist',
'globalcard'));
105 $backtopage =
getDolGlobalString(
'TICKET_URL_PUBLIC_INTERFACE', DOL_URL_ROOT.
'/public/ticket/');
107 header(
"Location: ".$backtopage);
116$form =
new Form($db);
117$user_assign =
new User($db);
118$user_create =
new User($db);
122 print
'<div class="error">'.$langs->trans(
'TicketPublicInterfaceForbidden').
'</div>';
128$arrayofcss = array(
getDolGlobalString(
'TICKET_URL_PUBLIC_INTERFACE',
'/public/ticket/').
'css/styles.css.php');
130llxHeaderTicket($langs->trans(
"Tickets"),
"", 0, 0, $arrayofjs, $arrayofcss);
132$display_ticket_list =
false;
135if ($action ==
"view_ticketlist") {
137 if (!strlen($track_id)) {
139 array_push(
$object->errors, $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"TicketTrackId")));
143 if (!strlen($email)) {
145 array_push(
$object->errors, $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Email")));
150 array_push(
$object->errors, $langs->trans(
"ErrorEmailOrTrackingInvalid"));
156 $ret =
$object->fetch(0,
'', $track_id);
160 $contacts =
$object->liste_contact(-1,
'external');
161 foreach ($contacts as $contact) {
162 if (strtolower($contact[
'email']) == $email) {
163 $display_ticket_list =
true;
164 $_SESSION[
'email_customer'] = $email;
165 $_SESSION[
'track_id_customer'] = $track_id;
168 $display_ticket_list =
false;
173 if ($email == strtolower(
$object->thirdparty->email)) {
174 $display_ticket_list =
true;
175 $_SESSION[
'email_customer'] = $email;
176 $_SESSION[
'track_id_customer'] = $track_id;
179 if (
$object->fk_user_create > 0) {
180 $tmpuser =
new User($db);
181 $tmpuser->fetch(
$object->fk_user_create);
182 if ($email == strtolower($tmpuser->email)) {
183 $display_ticket_list =
true;
184 $_SESSION[
'email_customer'] = $email;
185 $_SESSION[
'track_id_customer'] = $track_id;
190 if ($email == $emailorigin) {
191 $display_ticket_list =
true;
192 $_SESSION[
'email_customer'] = $email;
193 $_SESSION[
'track_id_customer'] = $track_id;
197 array_push(
$object->errors, $langs->trans(
"ErrorTicketNotFound", $track_id));
209if ($action ==
"view_ticketlist") {
210 print
'<div class="ticketpublicarealist ticketlargemargin">';
213 if ($display_ticket_list) {
215 $search_fk_status =
GETPOST(
"search_fk_status",
'alpha');
216 $search_subject =
GETPOST(
"search_subject",
'alpha');
217 $search_type =
GETPOST(
"search_type",
'alpha');
218 $search_category =
GETPOST(
"search_category",
'alpha');
219 $search_severity =
GETPOST(
"search_severity",
'alpha');
220 $search_fk_user_create =
GETPOST(
"search_fk_user_create",
"intcomma");
221 $search_fk_user_assign =
GETPOST(
"search_fk_user_assign",
"intcomma");
224 $url_page_current =
dol_buildpath(
'/public/ticket/list.php', 1);
225 $contextpage = $url_page_current;
228 if (
GETPOST(
"button_removefilter_x")) {
229 $search_fk_status =
'';
230 $search_subject =
'';
232 $search_category =
'';
233 $search_severity =
'';
234 $search_fk_user_create =
'';
235 $search_fk_user_assign =
'';
240 $extrafields->fetch_name_optionals_label(
$object->table_element);
242 $search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
246 $param =
'&action=view_ticketlist';
248 $param .=
'&entity='.((int) $entity);
251 $param .=
'&token='.newToken();
254 $arrayfields = array(
255 't.datec' => array(
'label' => $langs->trans(
"Date"),
'checked' =>
'1'),
256 't.date_read' => array(
'label' => $langs->trans(
"TicketReadOn"),
'checked' =>
'0'),
257 't.date_close' => array(
'label' => $langs->trans(
"TicketCloseOn"),
'checked' =>
'0'),
258 't.ref' => array(
'label' => $langs->trans(
"Ref"),
'checked' =>
'1'),
260 't.fk_statut' => array(
'label' => $langs->trans(
"Status"),
'checked' =>
'1'),
261 't.subject' => array(
'label' => $langs->trans(
"Subject"),
'checked' =>
'1'),
262 'type.code' => array(
'label' => $langs->trans(
"Type"),
'checked' =>
'1'),
263 'category.code' => array(
'label' => $langs->trans(
"Category"),
'checked' =>
'1'),
264 'severity.code' => array(
'label' => $langs->trans(
"Severity"),
'checked' =>
'1'),
265 't.progress' => array(
'label' => $langs->trans(
"Progression"),
'checked' =>
'0'),
267 't.fk_user_create' => array(
'label' => $langs->trans(
"Author"),
'checked' =>
'1'),
268 't.fk_user_assign' => array(
'label' => $langs->trans(
"AssignedTo"),
'checked' =>
'0'),
277 unset($arrayfields[
't.progress']);
281 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
283 if (!empty($search_subject)) {
284 $filter[
't.subject'] = $search_subject;
285 $param .=
'&search_subject='.urlencode($search_subject);
287 if (!empty($search_type)) {
288 $filter[
't.type_code'] = $search_type;
289 $param .=
'&search_type='.urlencode($search_type);
291 if (!empty($search_category)) {
292 $filter[
't.category_code'] = $search_category;
293 $param .=
'&search_category='.urlencode($search_category);
295 if (!empty($search_severity)) {
296 $filter[
't.severity_code'] = $search_severity;
297 $param .=
'&search_severity='.urlencode($search_severity);
299 if (!empty($search_fk_user_assign)) {
301 if ($search_fk_user_assign > 0) {
302 $filter[
't.fk_user_assign'] = $search_fk_user_assign;
303 $param .=
'&search_fk_user_assign='.urlencode((
string) ($search_fk_user_assign));
306 if (!empty($search_fk_user_create)) {
308 if ($search_fk_user_create > 0) {
309 $filter[
't.fk_user_create'] = $search_fk_user_create;
310 $param .=
'&search_fk_user_create='.urlencode((
string) ($search_fk_user_create));
313 if ((isset($search_fk_status) && $search_fk_status !=
'') && $search_fk_status !=
'-1' && $search_fk_status !=
'non_closed') {
314 $filter[
't.fk_statut'] = $search_fk_status;
315 $param .=
'&search_fk_status='.urlencode($search_fk_status);
317 if (isset($search_fk_status) && $search_fk_status ==
'non_closed') {
318 $filter[
't.fk_statut'] = array(0, 1, 3, 4, 5, 6);
319 $param .=
'&search_fk_statut=openall';
322 require DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
324 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
325 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
328 $sortfield =
't.datec';
334 $limit = $conf->liste_limit;
337 if (empty($page) || $page == -1) {
340 $offset = $limit * $page;
341 $pageprev = $page - 1;
342 $pagenext = $page + 1;
345 $sql =
"SELECT DISTINCT";
348 $sql .=
" t.track_id,";
349 $sql .=
" t.fk_soc,";
350 $sql .=
" t.fk_project,";
351 $sql .=
" t.origin_email,";
352 $sql .=
" t.fk_user_create, uc.lastname as user_create_lastname, uc.firstname as user_create_firstname,";
353 $sql .=
" t.fk_user_assign, ua.lastname as user_assign_lastname, ua.firstname as user_assign_firstname,";
354 $sql .=
" t.subject,";
355 $sql .=
" t.message,";
356 $sql .=
" t.fk_statut,";
357 $sql .=
" t.resolution,";
359 $sql .=
" t.progress,";
361 $sql .=
" t.timing,";
362 $sql .=
" t.type_code,";
363 $sql .=
" t.category_code,";
364 $sql .=
" t.severity_code,";
366 $sql .=
" t.date_read,";
367 $sql .=
" t.date_close,";
369 $sql .=
" type.label as type_label, category.label as category_label, severity.label as severity_label";
371 if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
372 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
373 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
376 $sql .=
" FROM ".MAIN_DB_PREFIX.
"ticket as t";
377 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_type as type ON type.code = t.type_code";
378 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_category as category ON category.code = t.category_code";
379 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_severity as severity ON severity.code = t.severity_code";
380 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = t.fk_soc";
381 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as uc ON uc.rowid = t.fk_user_create";
382 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as ua ON ua.rowid = t.fk_user_assign";
383 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_contact as ec ON ec.element_id = t.rowid";
384 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_type_contact as tc ON ec.fk_c_type_contact = tc.rowid";
385 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"socpeople sp ON ec.fk_socpeople = sp.rowid";
386 if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
387 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"ticket_extrafields as ef on (t.rowid = ef.fk_object)";
389 $sql .=
" WHERE t.entity IN (".getEntity(
'ticket').
")";
390 $sql .=
" AND ((tc.source = 'external'";
391 $sql .=
" AND tc.element = '".$db->escape(
$object->element).
"'";
392 $sql .=
" AND tc.active = 1";
393 $sql .=
" AND sp.email = '".$db->escape($_SESSION[
'email_customer']).
"')";
394 $sql .=
" OR s.email = '".$db->escape($_SESSION[
'email_customer']).
"'";
395 $sql .=
" OR t.origin_email = '".$db->escape($_SESSION[
'email_customer']).
"')";
397 if (!empty($filter)) {
398 foreach ($filter as $key => $value) {
399 if (strpos($key,
'date')) {
400 $sql .=
" AND ".$db->sanitize($key).
" = '".$db->escape($value).
"'";
401 } elseif (($key ==
't.fk_user_assign') || ($key ==
't.type_code') || ($key ==
't.category_code') || ($key ==
't.severity_code')) {
402 $sql .=
" AND ".$db->sanitize($key).
" = '".$db->escape($value).
"'";
403 } elseif ($key ==
't.fk_statut') {
404 if (is_array($value) && count($value) > 0) {
405 $sql .=
" AND ".$db->sanitize($key).
" IN (".$db->sanitize(implode(
',', $value)).
")";
407 $sql .=
" AND ".$db->sanitize($key).
" = ".((int) $value);
410 $sql .=
" AND ".$db->sanitize($key).
" LIKE '%".$db->escape($value).
"%'";
415 $sql .= $db->order($sortfield, $sortorder);
417 $resql = $db->query($sql);
419 $num_total = $db->num_rows($resql);
420 if (!empty($limit)) {
421 $sql .= $db->plimit($limit + 1, $offset);
424 $resql = $db->query($sql);
426 $num = $db->num_rows($resql);
428 $baseurl =
getDolGlobalString(
'TICKET_URL_PUBLIC_INTERFACE', DOL_URL_ROOT.
'/public/ticket/');
430 $newcardbutton =
'<a class="marginrightonly" href="'.$baseurl .
'create_ticket.php?action=create'.(!empty($entity) &&
isModEnabled(
'multicompany') ?
'&entity='.$entity :
'').
'&token='.
newToken().
'" rel="nofollow noopener"><span class="fa fa-15 fa-plus-circle valignmiddle btnTitle-icon" title="'.
dol_escape_htmltag($langs->trans(
"CreateTicket")).
'"></span></a>';
432 print_barre_liste($langs->trans(
'TicketList'), $page,
'list.php', $param, $sortfield, $sortorder,
'', $num, $num_total,
'ticket', 0, $newcardbutton);
435 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].(!empty($entity) &&
isModEnabled(
'multicompany') ?
'?entity='.$entity :
'').
'" id="searchFormList" >'.
"\n";
436 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
437 print
'<input type="hidden" name="token" value="'.newToken().
'">';
438 print
'<input type="hidden" name="action" value="view_ticketlist">';
439 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
440 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
442 $varpage = empty($contextpage) ? $url_page_current : $contextpage;
443 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
446 $parameters = array(
'arrayfields' => $arrayfields);
447 $reshook = $hookmanager->executeHooks(
'printFieldListHeader', $parameters, $object, $action);
448 print $hookmanager->resPrint;
450 print
'<div class="div-table-responsive">';
451 print
'<table class="liste '.($moreforfilter ?
"listwithfilterbefore" :
"").
'">';
454 print
'<tr class="liste_titre">';
456 if (!empty($arrayfields[
't.datec'][
'checked'])) {
457 print
'<td class="liste_titre"></td>';
460 if (!empty($arrayfields[
't.date_read'][
'checked'])) {
461 print
'<td class="liste_titre"></td>';
463 if (!empty($arrayfields[
't.date_close'][
'checked'])) {
464 print
'<td class="liste_titre"></td>';
467 if (!empty($arrayfields[
't.ref'][
'checked'])) {
468 print
'<td class="liste_titre"></td>';
471 if (!empty($arrayfields[
't.subject'][
'checked'])) {
472 print
'<td class="liste_titre">';
473 print
'<input type="text" class="flat maxwidth100" name="search_subject" value="'.$search_subject.
'">';
477 if (!empty($arrayfields[
'type.code'][
'checked'])) {
478 print
'<td class="liste_titre">';
479 $formTicket->selectTypesTickets($search_type,
'search_type',
'', 2, 1, 1, 0,
'maxwidth150');
483 if (!empty($arrayfields[
'category.code'][
'checked'])) {
484 print
'<td class="liste_titre">';
485 $formTicket->selectGroupTickets($search_category,
'search_category',
'(public:=:1)', 2, 1, 1, 0,
'maxwidth150');
489 if (!empty($arrayfields[
'severity.code'][
'checked'])) {
490 print
'<td class="liste_titre">';
491 $formTicket->selectSeveritiesTickets($search_severity,
'search_severity',
'', 2, 1, 1, 0,
'maxwidth150');
495 if (
getDolGlobalString(
'TICKET_SHOW_PROGRESSION') && !empty($arrayfields[
't.progress'][
'checked'])) {
496 print
'<td class="liste_titre"></td>';
499 if (!empty($arrayfields[
't.fk_user_create'][
'checked'])) {
500 print
'<td class="liste_titre"></td>';
503 if (!empty($arrayfields[
't.fk_user_assign'][
'checked'])) {
504 print
'<td class="liste_titre"></td>';
507 if (!empty($arrayfields[
't.tms'][
'checked'])) {
508 print
'<td class="liste_titre"></td>';
512 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
515 $parameters = array(
'arrayfields' => $arrayfields);
516 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
517 print $hookmanager->resPrint;
520 if (!empty($arrayfields[
't.fk_statut'][
'checked'])) {
521 print
'<td class="liste_titre">';
522 $selected = ($search_fk_status !=
"non_closed" ? $search_fk_status :
'');
528 print
'<td class="liste_titre maxwidthsearch">';
529 $searchpicto = $form->showFilterButtons();
535 print
'<tr class="liste_titre">';
536 if (!empty($arrayfields[
't.datec'][
'checked'])) {
537 print_liste_field_titre($arrayfields[
't.datec'][
'label'], $url_page_current,
't.datec',
'', $param,
'', $sortfield, $sortorder);
539 if (!empty($arrayfields[
't.date_read'][
'checked'])) {
540 print_liste_field_titre($arrayfields[
't.date_read'][
'label'], $url_page_current,
't.date_read',
'', $param,
'', $sortfield, $sortorder);
542 if (!empty($arrayfields[
't.date_close'][
'checked'])) {
543 print_liste_field_titre($arrayfields[
't.date_close'][
'label'], $url_page_current,
't.date_close',
'', $param,
'', $sortfield, $sortorder);
545 if (!empty($arrayfields[
't.ref'][
'checked'])) {
546 print_liste_field_titre($arrayfields[
't.ref'][
'label'], $url_page_current,
't.ref',
'', $param,
'', $sortfield, $sortorder);
548 if (!empty($arrayfields[
't.subject'][
'checked'])) {
551 if (!empty($arrayfields[
'type.code'][
'checked'])) {
552 print_liste_field_titre($arrayfields[
'type.code'][
'label'], $url_page_current,
'type.code',
'', $param,
'', $sortfield, $sortorder);
554 if (!empty($arrayfields[
'category.code'][
'checked'])) {
555 print_liste_field_titre($arrayfields[
'category.code'][
'label'], $url_page_current,
'category.code',
'', $param,
'', $sortfield, $sortorder);
557 if (!empty($arrayfields[
'severity.code'][
'checked'])) {
558 print_liste_field_titre($arrayfields[
'severity.code'][
'label'], $url_page_current,
'severity.code',
'', $param,
'', $sortfield, $sortorder);
560 if (
getDolGlobalString(
'TICKET_SHOW_PROGRESSION') && !empty($arrayfields[
't.progress'][
'checked'])) {
561 print_liste_field_titre($arrayfields[
't.progress'][
'label'], $url_page_current,
't.progress',
'', $param,
'', $sortfield, $sortorder);
563 if (!empty($arrayfields[
't.fk_user_create'][
'checked'])) {
564 print_liste_field_titre($arrayfields[
't.fk_user_create'][
'label'], $url_page_current,
't.fk_user_create',
'', $param,
'', $sortfield, $sortorder);
566 if (!empty($arrayfields[
't.fk_user_assign'][
'checked'])) {
567 print_liste_field_titre($arrayfields[
't.fk_user_assign'][
'label'], $url_page_current,
't.fk_user_assign',
'', $param,
'', $sortfield, $sortorder);
569 if (!empty($arrayfields[
't.tms'][
'checked'])) {
570 print_liste_field_titre($arrayfields[
't.tms'][
'label'], $url_page_current,
't.tms',
'', $param,
'', $sortfield, $sortorder);
574 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
577 $parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
578 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
579 print $hookmanager->resPrint;
581 if (!empty($arrayfields[
't.fk_statut'][
'checked'])) {
582 print_liste_field_titre($arrayfields[
't.fk_statut'][
'label'], $url_page_current,
't.fk_statut',
'', $param,
'', $sortfield, $sortorder);
584 print_liste_field_titre($selectedfields, $url_page_current,
"",
'',
'',
'align="right"', $sortfield, $sortorder,
'center maxwidthsearch ');
587 while ($obj = $db->fetch_object($resql)) {
588 print
'<tr class="oddeven">';
591 if (!empty($arrayfields[
't.datec'][
'checked'])) {
593 print
dol_print_date($db->jdate($obj->datec),
'dayhour',
'tzuserrel');
598 if (!empty($arrayfields[
't.date_read'][
'checked'])) {
600 print
dol_print_date($db->jdate($obj->date_read),
'dayhour',
'tzuserrel');
605 if (!empty($arrayfields[
't.date_close'][
'checked'])) {
607 print
dol_print_date($db->jdate($obj->date_close),
'dayhour',
'tzuserrel');
612 if (!empty($arrayfields[
't.ref'][
'checked'])) {
613 print
'<td class="nowraponall">';
614 print
'<a rel="nofollow" href="javascript:viewticket(\''.dol_escape_js($obj->track_id).
'\',\
''.dol_escape_js($_SESSION[
'email_customer']).
'\');
">';
615 print img_picto('', 'ticket', 'class="paddingrightonly
"');
622 if (!empty($arrayfields['t.subject']['checked'])) {
624 print '<a rel="nofollow
" href="javascript:viewticket(\
''.
dol_escape_js($obj->track_id).
'\',\
''.dol_escape_js($_SESSION[
'email_customer']).
'\');
">';
631 if (!empty($arrayfields['type.code']['checked'])) {
633 print $obj->type_label;
638 if (!empty($arrayfields['category.code']['checked'])) {
640 print $obj->category_label;
645 if (!empty($arrayfields['severity.code']['checked'])) {
647 print $obj->severity_label;
652 if (getDolGlobalString('TICKET_SHOW_PROGRESSION') && !empty($arrayfields['t.progress']['checked'])) {
654 print $obj->progress;
659 if (!empty($arrayfields['t.fk_user_create']['checked'])) {
660 print '<td title="'.dol_escape_htmltag($obj->origin_email).'">';
661 if ($obj->fk_user_create > 0) {
662 $user_create->firstname = (!empty($obj->user_create_firstname) ? $obj->user_create_firstname : '');
663 $user_create->name = (!empty($obj->user_create_lastname) ? $obj->user_create_lastname : '');
664 $user_create->id = (!empty($obj->fk_user_create) ? $obj->fk_user_create : '');
665 print $user_create->getFullName($langs);
667 print img_picto('', 'email', 'class="paddingrightonly
"');
668 print $langs->trans('Email');
674 if (!empty($arrayfields['t.fk_user_assign']['checked'])) {
676 if ($obj->fk_user_assign > 0) {
677 $user_assign->firstname = (!empty($obj->user_assign_firstname) ? $obj->user_assign_firstname : '');
678 $user_assign->lastname = (!empty($obj->user_assign_lastname) ? $obj->user_assign_lastname : '');
679 $user_assign->id = (!empty($obj->fk_user_assign) ? $obj->fk_user_assign : '');
680 print img_picto('', 'user', 'class="paddingrightonly
"');
681 print $user_assign->getFullName($langs);
686 if (!empty($arrayfields['t.tms']['checked'])) {
687 print '<td>'.dol_print_date($db->jdate($obj->tms), 'dayhour').'</td>';
691 if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
692 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
693 if (!empty($arrayfields["ef.
".$key]['checked'])) {
695 $cssstring = $extrafields->getCSSClass($key, $object->table_element, 'csslist');
697 print ' class="'.$cssstring.'"';
700 $tmpkey = 'options_'.$key;
701 print $extrafields->showOutputField($key, $obj->$tmpkey, '', $object->table_element);
708 if (!empty($arrayfields['t.fk_statut']['checked'])) {
709 print '<td class="nowraponall
">';
710 $object->status = $obj->fk_statut;
711 if (getDolGlobalString('TICKET_SHOW_PROGRESSION')) {
712 $object->progress = $obj->progress;
714 print $object->getLibStatut(2);
729 $url_public_ticket = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', dol_buildpath('/public/ticket/', 1));
731 print '<form method="POST
" id="form_view_ticket
" name="form_view_ticket
" action="'.$url_public_ticket.'view.php
'.(!empty($entity) && isModEnabled('multicompany
') ? '?entity=
'.$entity : '').'" style="display:none;
">';
732 print '<input type="hidden
" name="token
" value="'.newToken().'">';
733 print '<input type="hidden
" name="action
" value="view_ticket
">';
734 print '<input type="hidden
" name="btn_view_ticket_list
" value="1
">';
735 print '<input type="hidden
" name="track_id
" value="">';
736 print '<input type="hidden
" name="email" value="">';
738 print '<script type="text/javascript
">
739 function viewticket(ticket_id, email) {
740 var form = $("#form_view_ticket
");
741 form.find("input[
name=\\
"track_id\\"]
").val(ticket_id);
742 form.find("input[
name=\\
"email\\"]
").val(email);
748 dol_print_error($db);
751 print '<div class="error
">Not Allowed<br><a href="'.$_SERVER['PHP_SELF
'].'?track_id=
'.$object->track_id.'">'.$langs->trans("GoBack
").'</a></div>';
756 print '<div class="ticketpublicarea ticketlargemargin
">';
758 print '<p class="center opacitymedium
">'.$langs->trans("TicketPublicMsgViewLogIn
").'</p>';
761 print '<div id="form_view_ticket
">';
762 print '<form method="POST
" class="maxwidth1000 center
" name="form_view_ticketlist
" action="'.$_SERVER['PHP_SELF
'].(!empty($entity) && isModEnabled('multicompany
') ? '?entity=
'.$entity : '').'">';
763 print '<input type="hidden
" name="token
" value="'.newToken().'">';
764 print '<input type="hidden
" name="action
" value="view_ticketlist
">';
765 //print '<input type="hidden
" name="search_fk_status
" value="non_closed
">';
767 print '<p><label for="track_id
" style="display:
inline-block
" class="titlefieldcreate left
"><span class="fieldrequired
">';
768 print img_picto($langs->trans("TicketTrackId
"), 'generic', 'class="pictofixedwidth
"');
769 print $langs->trans("OneOfTicketTrackId
");
770 print '</span></label>';
771 print '<br class="showonsmartphone hidden
">';
772 print '<input class="minwidth100
" id="track_id
" name="track_id
" value="'.(GETPOST('track_id
', 'alpha
') ? GETPOST('track_id
', 'alpha
') : '').'" />';
775 print '<p><label for="email" style="display:
inline-block
" class="titlefieldcreate left
"><span class="fieldrequired
">';
776 print img_picto($langs->trans("Email
"), 'email', 'class="pictofixedwidth
"');
777 print $langs->trans('Email').'</span></label>';
778 print '<br class="showonsmartphone hidden
">';
779 print '<input class="minwidth100
" id="email" name="email" value="'.(GETPOST('email', 'alpha
') ? GETPOST('email', 'alpha
') : (!empty($_SESSION['customer_email
']) ? $_SESSION['customer_email
'] : "")).'" />';
782 print '<p style="text-align: center; margin-top: 1.5em;
">';
783 print '<input type="submit
" class="button button-select
" name="btn_view_ticket_list
" value="'.$langs->trans('ViewMyTicketList
').'" />';
785 print '<input type="submit
" class="button button-cancel
" name="cancel
" value="'.$langs->trans("Cancel").'">';
794if (getDolGlobalInt('TICKET_SHOW_COMPANY_FOOTER')) {
796 htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix, $object);
799llxFooter('', 'public');
if(! $sortfield) if(! $sortorder) $object
static getValidAddress($address, $format, $encode=0, $maxnumberofemail=0)
Return a formatted address string for SMTP protocol.
Class to manage Dolibarr users.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as p label as s rowid as s nom as s email
Sender: Who sends the email ("Sender" has sent emails on behalf of "From").
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into javascript code.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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...
multi select button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
Class to generate the form for creating a new ticket.
$conf db name
Only used if Module[ID]Name translation string is not found.
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.
llxHeaderTicket($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs=[], $arrayofcss=[])
Show http header, open body tag and show HTML header banner for public pages for tickets.