24 if (!defined(
'NOREQUIREMENU')) {
25 define(
'NOREQUIREMENU',
'1');
28 if (!defined(
"NOLOGIN")) {
29 define(
"NOLOGIN",
'1');
31 if (!defined(
'NOIPCHECK')) {
32 define(
'NOIPCHECK',
'1');
34 if (!defined(
'NOBROWSERNOTIF')) {
35 define(
'NOBROWSERNOTIF',
'1');
41 $entity = (!empty($_GET[
'entity']) ? (int) $_GET[
'entity'] : (!empty($_POST[
'entity']) ? (int) $_POST[
'entity'] : 1));
42 if (is_numeric($entity)) {
43 define(
"DOLENTITY", $entity);
47 require
'../../main.inc.php';
48 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/actions_ticket.class.php';
49 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formticket.class.php';
50 require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
51 require_once DOL_DOCUMENT_ROOT.
'/core/lib/ticket.lib.php';
52 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
53 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
54 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
57 $langs->loadLangs(array(
"companies",
"other",
"ticket"));
60 $action =
GETPOST(
'action',
'aZ09');
61 $cancel =
GETPOST(
'cancel',
'aZ09');
63 $track_id =
GETPOST(
'track_id',
'alpha');
64 $email = strtolower(
GETPOST(
'email',
'alpha'));
68 if (
GETPOST(
'btn_view_ticket_list')) {
69 unset($_SESSION[
'track_id_customer']);
70 unset($_SESSION[
'email_customer']);
72 if (isset($_SESSION[
'track_id_customer'])) {
73 $track_id = $_SESSION[
'track_id_customer'];
75 if (isset($_SESSION[
'email_customer'])) {
76 $email = strtolower($_SESSION[
'email_customer']);
82 $hookmanager->initHooks(array(
'ticketpubliclist',
'globalcard'));
95 $backtopage = DOL_URL_ROOT.
'/public/ticket/index.php';
97 header(
"Location: ".$backtopage);
101 if ($action ==
"view_ticketlist") {
103 $display_ticket_list =
false;
104 if (!strlen($track_id)) {
106 array_push($object->errors, $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"TicketTrackId")));
110 if (!strlen($email)) {
112 array_push($object->errors, $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Email")));
117 array_push($object->errors, $langs->trans(
"ErrorEmailOrTrackingInvalid"));
123 $ret = $object->fetch(
'',
'', $track_id);
125 if ($ret && $object->id > 0) {
127 $contacts = $object->liste_contact(-1,
'external');
128 foreach ($contacts as $contact) {
129 if (strtolower($contact[
'email']) == $email) {
130 $display_ticket_list =
true;
131 $_SESSION[
'email_customer'] = $email;
132 $_SESSION[
'track_id_customer'] = $track_id;
135 $display_ticket_list =
false;
138 if ($object->fk_soc > 0) {
139 $object->fetch_thirdparty();
140 if ($email == strtolower($object->thirdparty->email)) {
141 $display_ticket_list =
true;
142 $_SESSION[
'email_customer'] = $email;
143 $_SESSION[
'track_id_customer'] = $track_id;
146 if ($object->fk_user_create > 0) {
147 $tmpuser =
new User($db);
148 $tmpuser->fetch($object->fk_user_create);
149 if ($email == strtolower($tmpuser->email)) {
150 $display_ticket_list =
true;
151 $_SESSION[
'email_customer'] = $email;
152 $_SESSION[
'track_id_customer'] = $track_id;
157 if ($email == $emailorigin) {
158 $display_ticket_list =
true;
159 $_SESSION[
'email_customer'] = $email;
160 $_SESSION[
'track_id_customer'] = $track_id;
164 array_push($object->errors, $langs->trans(
"ErrorTicketNotFound", $track_id));
169 if ($error || $errors) {
180 $user_assign =
new User($db);
181 $user_create =
new User($db);
184 if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) {
185 print
'<div class="error">'.$langs->trans(
'TicketPublicInterfaceForbidden').
'</div>';
190 $arrayofjs = array();
191 $arrayofcss = array(
'/ticket/css/styles.css.php');
193 llxHeaderTicket($langs->trans(
"Tickets"),
"", 0, 0, $arrayofjs, $arrayofcss);
197 if ($action ==
"view_ticketlist") {
198 print
'<div class="ticketpublicarealist">';
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",
'int');
209 $search_fk_user_assign =
GETPOST(
"search_fk_user_assign",
'int');
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_');
232 $param =
'&action=view_ticketlist';
234 $param .=
'&entity='.$entity;
238 $arrayfields = array(
239 't.datec' => array(
'label' => $langs->trans(
"Date"),
'checked' => 1),
240 't.date_read' => array(
'label' => $langs->trans(
"TicketReadOn"),
'checked' => 0),
241 't.date_close' => array(
'label' => $langs->trans(
"TicketCloseOn"),
'checked' => 0),
242 't.ref' => array(
'label' => $langs->trans(
"Ref"),
'checked' => 1),
244 't.fk_statut' => array(
'label' => $langs->trans(
"Status"),
'checked' => 1),
245 't.subject' => array(
'label' => $langs->trans(
"Subject"),
'checked' => 1),
246 'type.code' => array(
'label' => $langs->trans(
"Type"),
'checked' => 1),
247 'category.code' => array(
'label' => $langs->trans(
"Category"),
'checked' => 1),
248 'severity.code' => array(
'label' => $langs->trans(
"Severity"),
'checked' => 1),
249 't.progress' => array(
'label' => $langs->trans(
"Progression"),
'checked' => 0),
251 't.fk_user_create' => array(
'label' => $langs->trans(
"Author"),
'checked' => 1),
252 't.fk_user_assign' => array(
'label' => $langs->trans(
"AssignedTo"),
'checked' => 0),
261 if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
262 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
263 if ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate') {
264 $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' =>(abs($extrafields->attributes[$object->table_element][
'list'][$key]) != 3) && $extrafields->attributes[$object->table_element][
'perms'][$key]);
268 if (!empty($search_subject)) {
269 $filter[
't.subject'] = $search_subject;
270 $param .=
'&search_subject='.urlencode($search_subject);
272 if (!empty($search_type)) {
273 $filter[
't.type_code'] = $search_type;
274 $param .=
'&search_type='.urlencode($search_type);
276 if (!empty($search_category)) {
277 $filter[
't.category_code'] = $search_category;
278 $param .=
'&search_category='.urlencode($search_category);
280 if (!empty($search_severity)) {
281 $filter[
't.severity_code'] = $search_severity;
282 $param .=
'&search_severity='.urlencode($search_severity);
284 if (!empty($search_fk_user_assign)) {
286 if ($search_fk_user_assign > 0) {
287 $filter[
't.fk_user_assign'] = $search_fk_user_assign;
288 $param .=
'&search_fk_user_assign='.urlencode($search_fk_user_assign);
291 if (!empty($search_fk_user_create)) {
293 if ($search_fk_user_create > 0) {
294 $filter[
't.fk_user_create'] = $search_fk_user_create;
295 $param .=
'&search_fk_user_create='.urlencode($search_fk_user_create);
298 if ((isset($search_fk_status) && $search_fk_status !=
'') && $search_fk_status !=
'-1' && $search_fk_status !=
'non_closed') {
299 $filter[
't.fk_statut'] = $search_fk_status;
300 $param .=
'&search_fk_status='.urlencode($search_fk_status);
302 if (isset($search_fk_status) && $search_fk_status ==
'non_closed') {
303 $filter[
't.fk_statut'] = array(0, 1, 3, 4, 5, 6);
304 $param .=
'&search_fk_status=non_closed';
307 require DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
309 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
310 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
313 $sortfield =
't.datec';
319 $limit = $conf->liste_limit;
322 if (empty($page) || $page == -1) {
325 $offset = $limit * $page;
326 $pageprev = $page - 1;
327 $pagenext = $page + 1;
330 $sql =
"SELECT DISTINCT";
333 $sql .=
" t.track_id,";
334 $sql .=
" t.fk_soc,";
335 $sql .=
" t.fk_project,";
336 $sql .=
" t.origin_email,";
337 $sql .=
" t.fk_user_create, uc.lastname as user_create_lastname, uc.firstname as user_create_firstname,";
338 $sql .=
" t.fk_user_assign, ua.lastname as user_assign_lastname, ua.firstname as user_assign_firstname,";
339 $sql .=
" t.subject,";
340 $sql .=
" t.message,";
341 $sql .=
" t.fk_statut,";
342 $sql .=
" t.resolution,";
343 $sql .=
" t.progress,";
344 $sql .=
" t.timing,";
345 $sql .=
" t.type_code,";
346 $sql .=
" t.category_code,";
347 $sql .=
" t.severity_code,";
349 $sql .=
" t.date_read,";
350 $sql .=
" t.date_close,";
352 $sql .=
" type.label as type_label, category.label as category_label, severity.label as severity_label";
354 if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
355 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
356 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
359 $sql .=
" FROM ".MAIN_DB_PREFIX.
"ticket as t";
360 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_type as type ON type.code = t.type_code";
361 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_category as category ON category.code = t.category_code";
362 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_severity as severity ON severity.code = t.severity_code";
363 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = t.fk_soc";
364 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as uc ON uc.rowid = t.fk_user_create";
365 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as ua ON ua.rowid = t.fk_user_assign";
366 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_contact as ec ON ec.element_id = t.rowid";
367 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_type_contact as tc ON ec.fk_c_type_contact = tc.rowid";
368 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"socpeople sp ON ec.fk_socpeople = sp.rowid";
369 if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
370 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"ticket_extrafields as ef on (t.rowid = ef.fk_object)";
372 $sql .=
" WHERE t.entity IN (".getEntity(
'ticket').
")";
373 $sql .=
" AND ((tc.source = 'external'";
374 $sql .=
" AND tc.element='".$db->escape($object->element).
"'";
375 $sql .=
" AND tc.active=1";
376 $sql .=
" AND sp.email='".$db->escape($_SESSION[
'email_customer']).
"')";
377 $sql .=
" OR s.email='".$db->escape($_SESSION[
'email_customer']).
"'";
378 $sql .=
" OR t.origin_email='".$db->escape($_SESSION[
'email_customer']).
"')";
380 if (!empty($filter)) {
381 foreach ($filter as $key => $value) {
382 if (strpos($key,
'date')) {
383 $sql .=
" AND ".$key.
" = '".$db->escape($value).
"'";
384 } elseif (($key ==
't.fk_user_assign') || ($key ==
't.type_code') || ($key ==
't.category_code') || ($key ==
't.severity_code')) {
385 $sql .=
" AND ".$key.
" = '".$db->escape($value).
"'";
386 } elseif ($key ==
't.fk_statut') {
387 if (is_array($value) && count($value) > 0) {
388 $sql .=
" AND ".$key.
" IN (".$db->sanitize(implode(
',', $value)).
")";
390 $sql .=
" AND ".$key.
" = ".((int) $value);
393 $sql .=
" AND ".$key.
" LIKE '%".$db->escape($value).
"%'";
398 $sql .= $db->order($sortfield, $sortorder);
400 $resql = $db->query($sql);
402 $num_total = $db->num_rows(
$resql);
403 if (!empty($limit)) {
404 $sql .= $db->plimit($limit + 1, $offset);
407 $resql = $db->query($sql);
409 $num = $db->num_rows(
$resql);
410 print_barre_liste($langs->trans(
'TicketList'), $page,
'/public/ticket/list.php', $param, $sortfield, $sortorder,
'', $num, $num_total,
'ticket');
413 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].(!empty($entity) &&
isModEnabled(
'multicompany')?
'?entity='.$entity:
'').
'" id="searchFormList" >'.
"\n";
414 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
415 print
'<input type="hidden" name="action" value="view_ticketlist">';
416 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
417 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
419 $varpage = empty($contextpage) ? $url_page_current : $contextpage;
420 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
423 $parameters=array(
'arrayfields'=>$arrayfields);
424 $reshook=$hookmanager->executeHooks(
'printFieldListHeader', $parameters, $object, $action);
425 print $hookmanager->resPrint;
427 print
'<table class="liste '.($moreforfilter ?
"listwithfilterbefore" :
"").
'">';
430 print
'<tr class="liste_titre">';
432 if (!empty($arrayfields[
't.datec'][
'checked'])) {
433 print
'<td class="liste_titre"></td>';
436 if (!empty($arrayfields[
't.date_read'][
'checked'])) {
437 print
'<td class="liste_titre"></td>';
439 if (!empty($arrayfields[
't.date_close'][
'checked'])) {
440 print
'<td class="liste_titre"></td>';
443 if (!empty($arrayfields[
't.ref'][
'checked'])) {
444 print
'<td class="liste_titre"></td>';
447 if (!empty($arrayfields[
't.subject'][
'checked'])) {
448 print
'<td class="liste_titre">';
449 print
'<input type="text" class="flat maxwidth100" name="search_subject" value="'.$search_subject.
'">';
453 if (!empty($arrayfields[
'type.code'][
'checked'])) {
454 print
'<td class="liste_titre">';
455 $formTicket->selectTypesTickets($search_type,
'search_type',
'', 2, 1, 1, 0,
'maxwidth150');
459 if (!empty($arrayfields[
'category.code'][
'checked'])) {
460 print
'<td class="liste_titre">';
461 $formTicket->selectGroupTickets($search_category,
'search_category',
'public=1', 2, 1, 1);
465 if (!empty($arrayfields[
'severity.code'][
'checked'])) {
466 print
'<td class="liste_titre">';
467 $formTicket->selectSeveritiesTickets($search_severity,
'search_severity',
'', 2, 1, 1);
471 if (!empty($arrayfields[
't.progress'][
'checked'])) {
472 print
'<td class="liste_titre"></td>';
475 if (!empty($arrayfields[
't.fk_user_create'][
'checked'])) {
476 print
'<td class="liste_titre"></td>';
479 if (!empty($arrayfields[
't.fk_user_assign'][
'checked'])) {
480 print
'<td class="liste_titre"></td>';
483 if (!empty($arrayfields[
't.tms'][
'checked'])) {
484 print
'<td class="liste_titre"></td>';
488 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
491 $parameters = array(
'arrayfields'=>$arrayfields);
492 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
493 print $hookmanager->resPrint;
496 if (!empty($arrayfields[
't.fk_statut'][
'checked'])) {
497 print
'<td class="liste_titre">';
498 $selected = ($search_fk_status !=
"non_closed" ? $search_fk_status :
'');
504 print
'<td class="liste_titre maxwidthsearch">';
505 $searchpicto =
$form->showFilterButtons();
511 print
'<tr class="liste_titre">';
512 if (!empty($arrayfields[
't.datec'][
'checked'])) {
513 print_liste_field_titre($arrayfields[
't.datec'][
'label'], $url_page_current,
't.datec',
'', $param,
'', $sortfield, $sortorder);
515 if (!empty($arrayfields[
't.date_read'][
'checked'])) {
516 print_liste_field_titre($arrayfields[
't.date_read'][
'label'], $url_page_current,
't.date_read',
'', $param,
'', $sortfield, $sortorder);
518 if (!empty($arrayfields[
't.date_close'][
'checked'])) {
519 print_liste_field_titre($arrayfields[
't.date_close'][
'label'], $url_page_current,
't.date_close',
'', $param,
'', $sortfield, $sortorder);
521 if (!empty($arrayfields[
't.ref'][
'checked'])) {
522 print_liste_field_titre($arrayfields[
't.ref'][
'label'], $url_page_current,
't.ref',
'', $param,
'', $sortfield, $sortorder);
524 if (!empty($arrayfields[
't.subject'][
'checked'])) {
527 if (!empty($arrayfields[
'type.code'][
'checked'])) {
528 print_liste_field_titre($arrayfields[
'type.code'][
'label'], $url_page_current,
'type.code',
'', $param,
'', $sortfield, $sortorder);
530 if (!empty($arrayfields[
'category.code'][
'checked'])) {
531 print_liste_field_titre($arrayfields[
'category.code'][
'label'], $url_page_current,
'category.code',
'', $param,
'', $sortfield, $sortorder);
533 if (!empty($arrayfields[
'severity.code'][
'checked'])) {
534 print_liste_field_titre($arrayfields[
'severity.code'][
'label'], $url_page_current,
'severity.code',
'', $param,
'', $sortfield, $sortorder);
536 if (!empty($arrayfields[
't.progress'][
'checked'])) {
537 print_liste_field_titre($arrayfields[
't.progress'][
'label'], $url_page_current,
't.progress',
'', $param,
'', $sortfield, $sortorder);
539 if (!empty($arrayfields[
't.fk_user_create'][
'checked'])) {
540 print_liste_field_titre($arrayfields[
't.fk_user_create'][
'label'], $url_page_current,
't.fk_user_create',
'', $param,
'', $sortfield, $sortorder);
542 if (!empty($arrayfields[
't.fk_user_assign'][
'checked'])) {
543 print_liste_field_titre($arrayfields[
't.fk_user_assign'][
'label'], $url_page_current,
't.fk_user_assign',
'', $param,
'', $sortfield, $sortorder);
545 if (!empty($arrayfields[
't.tms'][
'checked'])) {
546 print_liste_field_titre($arrayfields[
't.tms'][
'label'], $url_page_current,
't.tms',
'', $param,
'', $sortfield, $sortorder);
550 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
553 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
554 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
555 print $hookmanager->resPrint;
557 if (!empty($arrayfields[
't.fk_statut'][
'checked'])) {
558 print_liste_field_titre($arrayfields[
't.fk_statut'][
'label'], $url_page_current,
't.fk_statut',
'', $param,
'', $sortfield, $sortorder);
560 print_liste_field_titre($selectedfields, $url_page_current,
"",
'',
'',
'align="right"', $sortfield, $sortorder,
'center maxwidthsearch ');
563 while ($obj = $db->fetch_object(
$resql)) {
564 print
'<tr class="oddeven">';
567 if (!empty($arrayfields[
't.datec'][
'checked'])) {
574 if (!empty($arrayfields[
't.date_read'][
'checked'])) {
581 if (!empty($arrayfields[
't.date_close'][
'checked'])) {
588 if (!empty($arrayfields[
't.ref'][
'checked'])) {
589 print
'<td class="nowraponall">';
590 print
'<a rel="nofollow" href="javascript:viewticket(\''.dol_escape_js($obj->track_id).
'\',\
''.dol_escape_js($_SESSION[
'email_customer']).
'\');
">';
591 print img_picto('', 'ticket', 'class="paddingrightonly
"');
598 if (!empty($arrayfields['t.subject']['checked'])) {
600 print '<a rel="nofollow
" href="javascript:viewticket(\
''.
dol_escape_js($obj->track_id).
'\',\
''.dol_escape_js($_SESSION[
'email_customer']).
'\');
">';
607 if (!empty($arrayfields['type.code']['checked'])) {
609 print $obj->type_label;
614 if (!empty($arrayfields['category.code']['checked'])) {
616 print $obj->category_label;
621 if (!empty($arrayfields['severity.code']['checked'])) {
623 print $obj->severity_label;
628 if (!empty($arrayfields['t.progress']['checked'])) {
630 print $obj->progress;
635 if (!empty($arrayfields['t.fk_user_create']['checked'])) {
636 print '<td title="'.dol_escape_htmltag($obj->origin_email).'">';
637 if ($obj->fk_user_create > 0) {
638 $user_create->firstname = (!empty($obj->user_create_firstname) ? $obj->user_create_firstname : '');
639 $user_create->name = (!empty($obj->user_create_lastname) ? $obj->user_create_lastname : '');
640 $user_create->id = (!empty($obj->fk_user_create) ? $obj->fk_user_create : '');
641 print $user_create->getFullName($langs);
643 print img_picto('', 'email', 'class="paddingrightonly
"');
644 print $langs->trans('Email');
650 if (!empty($arrayfields['t.fk_user_assign']['checked'])) {
652 if ($obj->fk_user_assign > 0) {
653 $user_assign->firstname = (!empty($obj->user_assign_firstname) ? $obj->user_assign_firstname : '');
654 $user_assign->lastname = (!empty($obj->user_assign_lastname) ? $obj->user_assign_lastname : '');
655 $user_assign->id = (!empty($obj->fk_user_assign) ? $obj->fk_user_assign : '');
656 print img_picto('', 'user', 'class="paddingrightonly
"');
657 print $user_assign->getFullName($langs);
662 if (!empty($arrayfields['t.tms']['checked'])) {
663 print '<td>'.dol_print_date($db->jdate($obj->tms), 'dayhour').'</td>';
667 if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
668 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
669 if (!empty($arrayfields["ef.
".$key]['checked'])) {
671 $cssstring = $extrafields->getAlignFlag($key, $object->table_element);
673 print ' class="'.$cssstring.'"';
676 $tmpkey = 'options_'.$key;
677 print $extrafields->showOutputField($key, $obj->$tmpkey, '', $object->table_element);
684 if (!empty($arrayfields['t.fk_statut']['checked'])) {
685 print '<td class="nowraponall
">';
686 $object->fk_statut = $obj->fk_statut;
687 print $object->getLibStatut(2);
700 print '<form method="post
" id="form_view_ticket
" name="form_view_ticket
" action="'.dol_buildpath('/
public/ticket/view.php
', 1).(!empty($entity) && isModEnabled('multicompany
')?'?entity=
'.$entity:'').'" style="display:none;
">';
701 print '<input type="hidden
" name="token
" value="'.newToken().'">';
702 print '<input type="hidden
" name="action
" value="view_ticket
">';
703 print '<input type="hidden
" name="btn_view_ticket_list
" value="1
">';
704 print '<input type="hidden
" name="track_id
" value="">';
705 print '<input type="hidden
" name="email
" value="">';
707 print '<script type="text/javascript
">
708 function viewticket(ticket_id, email) {
709 var form = $("#form_view_ticket
");
710 form.find("input[
name=\\
"track_id\\"]
").val(ticket_id);
711 form.find("input[
name=\\
"email\\"]
").val(email);
717 dol_print_error($db);
720 print '<div class="error
">Not Allowed<br><a href="'.$_SERVER['PHP_SELF
'].'?track_id=
'.$object->track_id.'">'.$langs->trans('Back').'</a></div>';
725 print '<div class="ticketpublicarea
">';
727 print '<p class="center opacitymedium
">'.$langs->trans("TicketPublicMsgViewLogIn
").'</p>';
730 print '<div id="form_view_ticket
">';
731 print '<form method="post
" name="form_view_ticketlist
" action="'.$_SERVER['PHP_SELF
'].(!empty($entity) && isModEnabled('multicompany
')?'?entity=
'.$entity:'').'">';
732 print '<input type="hidden
" name="token
" value="'.newToken().'">';
733 print '<input type="hidden
" name="action
" value="view_ticketlist
">';
734 //print '<input type="hidden
" name="search_fk_status
" value="non_closed
">';
736 print '<p><label for="track_id
" style="display:
inline-block; width: 30%;
"><span class="fieldrequired
">'.$langs->trans("OneOfTicketTrackId
").'</span></label>';
737 print '<input size="30
" id="track_id
" name="track_id
" value="'.(GETPOST('track_id
', 'alpha
') ? GETPOST('track_id
', 'alpha
') : '').'" />';
740 print '<p><label for="email
" style="display:
inline-block; width: 30%;
"><span class="fieldrequired
">'.$langs->trans('Email').'</span></label>';
741 print '<input size="30
" id="email
" name="email
" value="'.(GETPOST('email
', 'alpha
') ? GETPOST('email
', 'alpha
') : (!empty($_SESSION['customer_email
']) ? $_SESSION['customer_email
'] : "")).'" />';
744 print '<p style="text-align: center; margin-top: 1.5em;
">';
745 print '<input type="submit
" class="button" name="btn_view_ticket_list
" value="'.$langs->trans('ViewMyTicketList
').'" />';
747 print '<input type="submit
" class="button button-cancel
" name="cancel
" value="'.$langs->trans("Cancel").'">';
757 htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix, $object);
759 llxFooter('', 'public');
static getValidAddress($address, $format, $encode=0, $maxnumberofemail=0)
Return a formatted address string for SMTP protocol.
Class to manage Dolibarr users.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into javascript code.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print_barre_liste($titre, $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.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
isModEnabled($module)
Is Dolibarr module enabled.
table tableforfield 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 header for public pages.