24if (!defined(
'NOREQUIREMENU')) {
25 define(
'NOREQUIREMENU',
'1');
28if (!defined(
"NOLOGIN")) {
29 define(
"NOLOGIN",
'1');
31if (!defined(
'NOIPCHECK')) {
32 define(
'NOIPCHECK',
'1');
34if (!defined(
'NOBROWSERNOTIF')) {
35 define(
'NOBROWSERNOTIF',
'1');
42$entity = (!empty($_GET[
'entity']) ? (int) $_GET[
'entity'] : (!empty($_POST[
'entity']) ? (int) $_POST[
'entity'] : 1));
43if (is_numeric($entity)) {
44 define(
"DOLENTITY", $entity);
48require
'../../main.inc.php';
49require_once DOL_DOCUMENT_ROOT.
'/ticket/class/actions_ticket.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formticket.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/core/lib/ticket.lib.php';
53require_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
54require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
55require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
58$langs->loadLangs(array(
"companies",
"other",
"ticket"));
61$action =
GETPOST(
'action',
'aZ09');
62$cancel =
GETPOST(
'cancel',
'aZ09');
64$track_id =
GETPOST(
'track_id',
'alpha');
65$email = strtolower(
GETPOST(
'email',
'alpha'));
69if (
GETPOST(
'btn_view_ticket_list')) {
70 unset($_SESSION[
'track_id_customer']);
71 unset($_SESSION[
'email_customer']);
73if (isset($_SESSION[
'track_id_customer'])) {
74 $track_id = $_SESSION[
'track_id_customer'];
76if (isset($_SESSION[
'email_customer'])) {
77 $email = strtolower($_SESSION[
'email_customer']);
83$hookmanager->initHooks(array(
'ticketpubliclist',
'globalcard'));
85if (!isModEnabled(
'ticket')) {
96 $backtopage =
getDolGlobalString(
'TICKET_URL_PUBLIC_INTERFACE', DOL_URL_ROOT.
'/public/ticket/');
98 header(
"Location: ".$backtopage);
102if ($action ==
"view_ticketlist") {
104 $display_ticket_list =
false;
105 if (!strlen($track_id)) {
107 array_push(
$object->errors, $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"TicketTrackId")));
111 if (!strlen($email)) {
113 array_push(
$object->errors, $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Email")));
118 array_push(
$object->errors, $langs->trans(
"ErrorEmailOrTrackingInvalid"));
124 $ret =
$object->fetch(
'',
'', $track_id);
128 $contacts =
$object->liste_contact(-1,
'external');
129 foreach ($contacts as $contact) {
130 if (strtolower($contact[
'email']) == $email) {
131 $display_ticket_list =
true;
132 $_SESSION[
'email_customer'] = $email;
133 $_SESSION[
'track_id_customer'] = $track_id;
136 $display_ticket_list =
false;
141 if ($email == strtolower(
$object->thirdparty->email)) {
142 $display_ticket_list =
true;
143 $_SESSION[
'email_customer'] = $email;
144 $_SESSION[
'track_id_customer'] = $track_id;
147 if (
$object->fk_user_create > 0) {
148 $tmpuser =
new User($db);
149 $tmpuser->fetch(
$object->fk_user_create);
150 if ($email == strtolower($tmpuser->email)) {
151 $display_ticket_list =
true;
152 $_SESSION[
'email_customer'] = $email;
153 $_SESSION[
'track_id_customer'] = $track_id;
158 if ($email == $emailorigin) {
159 $display_ticket_list =
true;
160 $_SESSION[
'email_customer'] = $email;
161 $_SESSION[
'track_id_customer'] = $track_id;
165 array_push(
$object->errors, $langs->trans(
"ErrorTicketNotFound", $track_id));
170 if ($error || $errors) {
180$form =
new Form($db);
181$user_assign =
new User($db);
182$user_create =
new User($db);
186 print
'<div class="error">'.$langs->trans(
'TicketPublicInterfaceForbidden').
'</div>';
192$arrayofcss = array(
getDolGlobalString(
'TICKET_URL_PUBLIC_INTERFACE',
'/ticket/').
'css/styles.css.php');
194llxHeaderTicket($langs->trans(
"Tickets"),
"", 0, 0, $arrayofjs, $arrayofcss);
197if ($action ==
"view_ticketlist") {
198 print
'<div class="ticketpublicarealist ticketlargemargin centpercent">';
201 if ($display_ticket_list) {
203 $search_fk_status =
GETPOST(
"search_fk_status",
'alpha');
204 $search_subject =
GETPOST(
"search_subject",
'alpha');
205 $search_type =
GETPOST(
"search_type",
'alpha');
206 $search_category =
GETPOST(
"search_category",
'alpha');
207 $search_severity =
GETPOST(
"search_severity",
'alpha');
208 $search_fk_user_create =
GETPOST(
"search_fk_user_create",
"intcomma");
209 $search_fk_user_assign =
GETPOST(
"search_fk_user_assign",
"intcomma");
212 $url_page_current =
dol_buildpath(
'/public/ticket/list.php', 1);
215 if (
GETPOST(
"button_removefilter_x")) {
216 $search_fk_status =
'';
217 $search_subject =
'';
219 $search_category =
'';
220 $search_severity =
'';
221 $search_fk_user_create =
'';
222 $search_fk_user_assign =
'';
227 $extrafields->fetch_name_optionals_label(
$object->table_element);
229 $search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
233 $param =
'&action=view_ticketlist';
234 if (!empty($entity) && isModEnabled(
'multicompany')) {
235 $param .=
'&entity='.((int) $entity);
238 $param .=
'&token='.newToken();
241 $arrayfields = array(
242 't.datec' => array(
'label' => $langs->trans(
"Date"),
'checked' => 1),
243 't.date_read' => array(
'label' => $langs->trans(
"TicketReadOn"),
'checked' => 0),
244 't.date_close' => array(
'label' => $langs->trans(
"TicketCloseOn"),
'checked' => 0),
245 't.ref' => array(
'label' => $langs->trans(
"Ref"),
'checked' => 1),
247 't.fk_statut' => array(
'label' => $langs->trans(
"Status"),
'checked' => 1),
248 't.subject' => array(
'label' => $langs->trans(
"Subject"),
'checked' => 1),
249 'type.code' => array(
'label' => $langs->trans(
"Type"),
'checked' => 1),
250 'category.code' => array(
'label' => $langs->trans(
"Category"),
'checked' => 1),
251 'severity.code' => array(
'label' => $langs->trans(
"Severity"),
'checked' => 1),
252 't.progress' => array(
'label' => $langs->trans(
"Progression"),
'checked' => 0),
254 't.fk_user_create' => array(
'label' => $langs->trans(
"Author"),
'checked' => 1),
255 't.fk_user_assign' => array(
'label' => $langs->trans(
"AssignedTo"),
'checked' => 0),
264 unset($arrayfields[
't.progress']);
268 if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
269 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
270 if ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate') {
271 $enabled = abs((
int)
dol_eval($extrafields->attributes[
$object->table_element][
'list'][$key], 1, 1,
'2'));
272 $enabled = (($enabled == 0 || $enabled == 3) ? 0 : $enabled);
273 $arrayfields[
"ef.".$key] = array(
'label' => $extrafields->attributes[
$object->table_element][
'label'][$key],
'checked' => ($extrafields->attributes[
$object->table_element][
'list'][$key] < 0) ? 0 : 1,
'position' => $extrafields->attributes[
$object->table_element][
'pos'][$key],
'enabled' => $enabled && $extrafields->attributes[
$object->table_element][
'perms'][$key]);
277 if (!empty($search_subject)) {
278 $filter[
't.subject'] = $search_subject;
279 $param .=
'&search_subject='.urlencode($search_subject);
281 if (!empty($search_type)) {
282 $filter[
't.type_code'] = $search_type;
283 $param .=
'&search_type='.urlencode($search_type);
285 if (!empty($search_category)) {
286 $filter[
't.category_code'] = $search_category;
287 $param .=
'&search_category='.urlencode($search_category);
289 if (!empty($search_severity)) {
290 $filter[
't.severity_code'] = $search_severity;
291 $param .=
'&search_severity='.urlencode($search_severity);
293 if (!empty($search_fk_user_assign)) {
295 if ($search_fk_user_assign > 0) {
296 $filter[
't.fk_user_assign'] = $search_fk_user_assign;
297 $param .=
'&search_fk_user_assign='.urlencode((
string) ($search_fk_user_assign));
300 if (!empty($search_fk_user_create)) {
302 if ($search_fk_user_create > 0) {
303 $filter[
't.fk_user_create'] = $search_fk_user_create;
304 $param .=
'&search_fk_user_create='.urlencode((
string) ($search_fk_user_create));
307 if ((isset($search_fk_status) && $search_fk_status !=
'') && $search_fk_status !=
'-1' && $search_fk_status !=
'non_closed') {
308 $filter[
't.fk_statut'] = $search_fk_status;
309 $param .=
'&search_fk_status='.urlencode($search_fk_status);
311 if (isset($search_fk_status) && $search_fk_status ==
'non_closed') {
312 $filter[
't.fk_statut'] = array(0, 1, 3, 4, 5, 6);
313 $param .=
'&search_fk_status=non_closed';
316 require DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
318 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
319 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
322 $sortfield =
't.datec';
328 $limit = $conf->liste_limit;
331 if (empty($page) || $page == -1) {
334 $offset = $limit * $page;
335 $pageprev = $page - 1;
336 $pagenext = $page + 1;
339 $sql =
"SELECT DISTINCT";
342 $sql .=
" t.track_id,";
343 $sql .=
" t.fk_soc,";
344 $sql .=
" t.fk_project,";
345 $sql .=
" t.origin_email,";
346 $sql .=
" t.fk_user_create, uc.lastname as user_create_lastname, uc.firstname as user_create_firstname,";
347 $sql .=
" t.fk_user_assign, ua.lastname as user_assign_lastname, ua.firstname as user_assign_firstname,";
348 $sql .=
" t.subject,";
349 $sql .=
" t.message,";
350 $sql .=
" t.fk_statut,";
351 $sql .=
" t.resolution,";
353 $sql .=
" t.progress,";
355 $sql .=
" t.timing,";
356 $sql .=
" t.type_code,";
357 $sql .=
" t.category_code,";
358 $sql .=
" t.severity_code,";
360 $sql .=
" t.date_read,";
361 $sql .=
" t.date_close,";
363 $sql .=
" type.label as type_label, category.label as category_label, severity.label as severity_label";
365 if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
366 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
367 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
370 $sql .=
" FROM ".MAIN_DB_PREFIX.
"ticket as t";
371 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_type as type ON type.code = t.type_code";
372 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_category as category ON category.code = t.category_code";
373 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_severity as severity ON severity.code = t.severity_code";
374 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = t.fk_soc";
375 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as uc ON uc.rowid = t.fk_user_create";
376 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as ua ON ua.rowid = t.fk_user_assign";
377 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_contact as ec ON ec.element_id = t.rowid";
378 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_type_contact as tc ON ec.fk_c_type_contact = tc.rowid";
379 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"socpeople sp ON ec.fk_socpeople = sp.rowid";
380 if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
381 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"ticket_extrafields as ef on (t.rowid = ef.fk_object)";
383 $sql .=
" WHERE t.entity IN (".getEntity(
'ticket').
")";
384 $sql .=
" AND ((tc.source = 'external'";
385 $sql .=
" AND tc.element='".$db->escape(
$object->element).
"'";
386 $sql .=
" AND tc.active=1";
387 $sql .=
" AND sp.email='".$db->escape($_SESSION[
'email_customer']).
"')";
388 $sql .=
" OR s.email='".$db->escape($_SESSION[
'email_customer']).
"'";
389 $sql .=
" OR t.origin_email='".$db->escape($_SESSION[
'email_customer']).
"')";
391 if (!empty($filter)) {
392 foreach ($filter as $key => $value) {
393 if (strpos($key,
'date')) {
394 $sql .=
" AND ".$key.
" = '".$db->escape($value).
"'";
395 } elseif (($key ==
't.fk_user_assign') || ($key ==
't.type_code') || ($key ==
't.category_code') || ($key ==
't.severity_code')) {
396 $sql .=
" AND ".$key.
" = '".$db->escape($value).
"'";
397 } elseif ($key ==
't.fk_statut') {
398 if (is_array($value) && count($value) > 0) {
399 $sql .=
" AND ".$key.
" IN (".$db->sanitize(implode(
',', $value)).
")";
401 $sql .=
" AND ".$key.
" = ".((int) $value);
404 $sql .=
" AND ".$key.
" LIKE '%".$db->escape($value).
"%'";
409 $sql .= $db->order($sortfield, $sortorder);
411 $resql = $db->query($sql);
413 $num_total = $db->num_rows($resql);
414 if (!empty($limit)) {
415 $sql .= $db->plimit($limit + 1, $offset);
418 $resql = $db->query($sql);
420 $num = $db->num_rows($resql);
422 $baseurl =
getDolGlobalString(
'TICKET_URL_PUBLIC_INTERFACE', DOL_URL_ROOT.
'/public/ticket/');
424 $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>';
426 print_barre_liste($langs->trans(
'TicketList'), $page,
'list.php', $param, $sortfield, $sortorder,
'', $num, $num_total,
'ticket', 0, $newcardbutton);
429 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].(!empty($entity) && isModEnabled(
'multicompany') ?
'?entity='.$entity :
'').
'" id="searchFormList" >'.
"\n";
430 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
431 print
'<input type="hidden" name="token" value="'.newToken().
'">';
432 print
'<input type="hidden" name="action" value="view_ticketlist">';
433 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
434 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
436 $varpage = empty($contextpage) ? $url_page_current : $contextpage;
437 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
440 $parameters = array(
'arrayfields' => $arrayfields);
441 $reshook = $hookmanager->executeHooks(
'printFieldListHeader', $parameters, $object, $action);
442 print $hookmanager->resPrint;
444 print
'<div class="div-table-responsive">';
445 print
'<table class="liste '.($moreforfilter ?
"listwithfilterbefore" :
"").
'">';
448 print
'<tr class="liste_titre">';
450 if (!empty($arrayfields[
't.datec'][
'checked'])) {
451 print
'<td class="liste_titre"></td>';
454 if (!empty($arrayfields[
't.date_read'][
'checked'])) {
455 print
'<td class="liste_titre"></td>';
457 if (!empty($arrayfields[
't.date_close'][
'checked'])) {
458 print
'<td class="liste_titre"></td>';
461 if (!empty($arrayfields[
't.ref'][
'checked'])) {
462 print
'<td class="liste_titre"></td>';
465 if (!empty($arrayfields[
't.subject'][
'checked'])) {
466 print
'<td class="liste_titre">';
467 print
'<input type="text" class="flat maxwidth100" name="search_subject" value="'.$search_subject.
'">';
471 if (!empty($arrayfields[
'type.code'][
'checked'])) {
472 print
'<td class="liste_titre">';
473 $formTicket->selectTypesTickets($search_type,
'search_type',
'', 2, 1, 1, 0,
'maxwidth150');
477 if (!empty($arrayfields[
'category.code'][
'checked'])) {
478 print
'<td class="liste_titre">';
479 $formTicket->selectGroupTickets($search_category,
'search_category',
'(public:=:1)', 2, 1, 1, 0,
'maxwidth150');
483 if (!empty($arrayfields[
'severity.code'][
'checked'])) {
484 print
'<td class="liste_titre">';
485 $formTicket->selectSeveritiesTickets($search_severity,
'search_severity',
'', 2, 1, 1, 0,
'maxwidth150');
489 if (
getDolGlobalString(
'TICKET_SHOW_PROGRESSION') && !empty($arrayfields[
't.progress'][
'checked'])) {
490 print
'<td class="liste_titre"></td>';
493 if (!empty($arrayfields[
't.fk_user_create'][
'checked'])) {
494 print
'<td class="liste_titre"></td>';
497 if (!empty($arrayfields[
't.fk_user_assign'][
'checked'])) {
498 print
'<td class="liste_titre"></td>';
501 if (!empty($arrayfields[
't.tms'][
'checked'])) {
502 print
'<td class="liste_titre"></td>';
506 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
509 $parameters = array(
'arrayfields' => $arrayfields);
510 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
511 print $hookmanager->resPrint;
514 if (!empty($arrayfields[
't.fk_statut'][
'checked'])) {
515 print
'<td class="liste_titre">';
516 $selected = ($search_fk_status !=
"non_closed" ? $search_fk_status :
'');
522 print
'<td class="liste_titre maxwidthsearch">';
523 $searchpicto = $form->showFilterButtons();
529 print
'<tr class="liste_titre">';
530 if (!empty($arrayfields[
't.datec'][
'checked'])) {
531 print_liste_field_titre($arrayfields[
't.datec'][
'label'], $url_page_current,
't.datec',
'', $param,
'', $sortfield, $sortorder);
533 if (!empty($arrayfields[
't.date_read'][
'checked'])) {
534 print_liste_field_titre($arrayfields[
't.date_read'][
'label'], $url_page_current,
't.date_read',
'', $param,
'', $sortfield, $sortorder);
536 if (!empty($arrayfields[
't.date_close'][
'checked'])) {
537 print_liste_field_titre($arrayfields[
't.date_close'][
'label'], $url_page_current,
't.date_close',
'', $param,
'', $sortfield, $sortorder);
539 if (!empty($arrayfields[
't.ref'][
'checked'])) {
540 print_liste_field_titre($arrayfields[
't.ref'][
'label'], $url_page_current,
't.ref',
'', $param,
'', $sortfield, $sortorder);
542 if (!empty($arrayfields[
't.subject'][
'checked'])) {
545 if (!empty($arrayfields[
'type.code'][
'checked'])) {
546 print_liste_field_titre($arrayfields[
'type.code'][
'label'], $url_page_current,
'type.code',
'', $param,
'', $sortfield, $sortorder);
548 if (!empty($arrayfields[
'category.code'][
'checked'])) {
549 print_liste_field_titre($arrayfields[
'category.code'][
'label'], $url_page_current,
'category.code',
'', $param,
'', $sortfield, $sortorder);
551 if (!empty($arrayfields[
'severity.code'][
'checked'])) {
552 print_liste_field_titre($arrayfields[
'severity.code'][
'label'], $url_page_current,
'severity.code',
'', $param,
'', $sortfield, $sortorder);
554 if (
getDolGlobalString(
'TICKET_SHOW_PROGRESSION') && !empty($arrayfields[
't.progress'][
'checked'])) {
555 print_liste_field_titre($arrayfields[
't.progress'][
'label'], $url_page_current,
't.progress',
'', $param,
'', $sortfield, $sortorder);
557 if (!empty($arrayfields[
't.fk_user_create'][
'checked'])) {
558 print_liste_field_titre($arrayfields[
't.fk_user_create'][
'label'], $url_page_current,
't.fk_user_create',
'', $param,
'', $sortfield, $sortorder);
560 if (!empty($arrayfields[
't.fk_user_assign'][
'checked'])) {
561 print_liste_field_titre($arrayfields[
't.fk_user_assign'][
'label'], $url_page_current,
't.fk_user_assign',
'', $param,
'', $sortfield, $sortorder);
563 if (!empty($arrayfields[
't.tms'][
'checked'])) {
564 print_liste_field_titre($arrayfields[
't.tms'][
'label'], $url_page_current,
't.tms',
'', $param,
'', $sortfield, $sortorder);
568 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
571 $parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
572 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
573 print $hookmanager->resPrint;
575 if (!empty($arrayfields[
't.fk_statut'][
'checked'])) {
576 print_liste_field_titre($arrayfields[
't.fk_statut'][
'label'], $url_page_current,
't.fk_statut',
'', $param,
'', $sortfield, $sortorder);
578 print_liste_field_titre($selectedfields, $url_page_current,
"",
'',
'',
'align="right"', $sortfield, $sortorder,
'center maxwidthsearch ');
581 while ($obj = $db->fetch_object($resql)) {
582 print
'<tr class="oddeven">';
585 if (!empty($arrayfields[
't.datec'][
'checked'])) {
587 print
dol_print_date($db->jdate($obj->datec),
'dayhour',
'tzuserrel');
592 if (!empty($arrayfields[
't.date_read'][
'checked'])) {
594 print
dol_print_date($db->jdate($obj->date_read),
'dayhour',
'tzuserrel');
599 if (!empty($arrayfields[
't.date_close'][
'checked'])) {
601 print
dol_print_date($db->jdate($obj->date_close),
'dayhour',
'tzuserrel');
606 if (!empty($arrayfields[
't.ref'][
'checked'])) {
607 print
'<td class="nowraponall">';
608 print
'<a rel="nofollow" href="javascript:viewticket(\''.dol_escape_js($obj->track_id).
'\',\
''.dol_escape_js($_SESSION[
'email_customer']).
'\');
">';
609 print img_picto('', 'ticket', 'class="paddingrightonly
"');
616 if (!empty($arrayfields['t.subject']['checked'])) {
618 print '<a rel="nofollow
" href="javascript:viewticket(\
''.
dol_escape_js($obj->track_id).
'\',\
''.dol_escape_js($_SESSION[
'email_customer']).
'\');
">';
625 if (!empty($arrayfields['type.code']['checked'])) {
627 print $obj->type_label;
632 if (!empty($arrayfields['category.code']['checked'])) {
634 print $obj->category_label;
639 if (!empty($arrayfields['severity.code']['checked'])) {
641 print $obj->severity_label;
646 if (getDolGlobalString('TICKET_SHOW_PROGRESSION') && !empty($arrayfields['t.progress']['checked'])) {
648 print $obj->progress;
653 if (!empty($arrayfields['t.fk_user_create']['checked'])) {
654 print '<td title="'.dol_escape_htmltag($obj->origin_email).'">';
655 if ($obj->fk_user_create > 0) {
656 $user_create->firstname = (!empty($obj->user_create_firstname) ? $obj->user_create_firstname : '');
657 $user_create->name = (!empty($obj->user_create_lastname) ? $obj->user_create_lastname : '');
658 $user_create->id = (!empty($obj->fk_user_create) ? $obj->fk_user_create : '');
659 print $user_create->getFullName($langs);
661 print img_picto('', 'email', 'class="paddingrightonly
"');
662 print $langs->trans('Email');
668 if (!empty($arrayfields['t.fk_user_assign']['checked'])) {
670 if ($obj->fk_user_assign > 0) {
671 $user_assign->firstname = (!empty($obj->user_assign_firstname) ? $obj->user_assign_firstname : '');
672 $user_assign->lastname = (!empty($obj->user_assign_lastname) ? $obj->user_assign_lastname : '');
673 $user_assign->id = (!empty($obj->fk_user_assign) ? $obj->fk_user_assign : '');
674 print img_picto('', 'user', 'class="paddingrightonly
"');
675 print $user_assign->getFullName($langs);
680 if (!empty($arrayfields['t.tms']['checked'])) {
681 print '<td>'.dol_print_date($db->jdate($obj->tms), 'dayhour').'</td>';
685 if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
686 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
687 if (!empty($arrayfields["ef.
".$key]['checked'])) {
689 $cssstring = $extrafields->getAlignFlag($key, $object->table_element);
691 print ' class="'.$cssstring.'"';
694 $tmpkey = 'options_'.$key;
695 print $extrafields->showOutputField($key, $obj->$tmpkey, '', $object->table_element);
702 if (!empty($arrayfields['t.fk_statut']['checked'])) {
703 print '<td class="nowraponall
">';
704 $object->fk_statut = $obj->fk_statut;
705 print $object->getLibStatut(2);
720 $url_public_ticket = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', dol_buildpath('/public/ticket/', 1));
722 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;
">';
723 print '<input type="hidden
" name="token
" value="'.newToken().'">';
724 print '<input type="hidden
" name="action
" value="view_ticket
">';
725 print '<input type="hidden
" name="btn_view_ticket_list
" value="1
">';
726 print '<input type="hidden
" name="track_id
" value="">';
727 print '<input type="hidden
" name="email
" value="">';
729 print '<script type="text/javascript
">
730 function viewticket(ticket_id, email) {
731 var form = $("#form_view_ticket
");
732 form.find("input[
name=\\
"track_id\\"]
").val(ticket_id);
733 form.find("input[
name=\\
"email\\"]
").val(email);
739 dol_print_error($db);
742 print '<div class="error
">Not Allowed<br><a href="'.$_SERVER['PHP_SELF
'].'?track_id=
'.$object->track_id.'">'.$langs->trans('Back').'</a></div>';
747 print '<div class="ticketpublicarea ticketlargemargin centpercent
">';
749 print '<p class="center opacitymedium
">'.$langs->trans("TicketPublicMsgViewLogIn
").'</p>';
752 print '<div id="form_view_ticket
">';
753 print '<form method="POST
" class="maxwidth1000 center
" name="form_view_ticketlist
" action="'.$_SERVER['PHP_SELF
'].(!empty($entity) && isModEnabled('multicompany
') ? '?entity=
'.$entity : '').'">';
754 print '<input type="hidden
" name="token
" value="'.newToken().'">';
755 print '<input type="hidden
" name="action
" value="view_ticketlist
">';
756 //print '<input type="hidden
" name="search_fk_status
" value="non_closed
">';
758 print '<p><label for="track_id
" style="display:
inline-block
" class="titlefieldcreate left
"><span class="fieldrequired
">';
759 print img_picto($langs->trans("TicketTrackId
"), 'generic', 'class="pictofixedwidth
"');
760 print $langs->trans("OneOfTicketTrackId
");
761 print '</span></label>';
762 print '<br class="showonsmartphone hidden
">';
763 print '<input class="minwidth100
" id="track_id
" name="track_id
" value="'.(GETPOST('track_id
', 'alpha
') ? GETPOST('track_id
', 'alpha
') : '').'" />';
766 print '<p><label for="email
" style="display:
inline-block
" class="titlefieldcreate left
"><span class="fieldrequired
">';
767 print img_picto($langs->trans("Email
"), 'email', 'class="pictofixedwidth
"');
768 print $langs->trans('Email').'</span></label>';
769 print '<br class="showonsmartphone hidden
">';
770 print '<input class="minwidth100
" id="email
" name="email
" value="'.(GETPOST('email
', 'alpha
') ? GETPOST('email
', 'alpha
') : (!empty($_SESSION['customer_email
']) ? $_SESSION['customer_email
'] : "")).'" />';
773 print '<p style="text-align: center; margin-top: 1.5em;
">';
774 print '<input type="submit
" class="button button-select
" name="btn_view_ticket_list
" value="'.$langs->trans('ViewMyTicketList
').'" />';
776 print '<input type="submit
" class="button button-cancel
" name="cancel
" value="'.$langs->trans("Cancel").'">';
785if (getDolGlobalInt('TICKET_SHOW_COMPANY_FOOTER')) {
787 htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix, $object);
790llxFooter('', 'public');
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
static getValidAddress($address, $format, $encode=0, $maxnumberofemail=0)
Return a formatted address string for SMTP protocol.
Class to manage Dolibarr users.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into javascript code.
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'.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $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, $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.
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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...
ui state ui widget content ui state ui widget header ui state a ui 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.