33require
'../main.inc.php';
41require_once DOL_DOCUMENT_ROOT.
'/ticket/class/actions_ticket.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formticket.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
46include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
47include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
48include_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
51$langs->loadLangs(array(
"ticket",
"companies",
"other",
"projects",
"contracts"));
54$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
55$massaction =
GETPOST(
'massaction',
'alpha');
57$confirm =
GETPOST(
'confirm',
'alpha');
58$cancel =
GETPOST(
'cancel',
'alpha');
59$toselect =
GETPOST(
'toselect',
'array:int');
60$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'ticketlist';
61$backtopage =
GETPOST(
'backtopage',
'alpha');
62$optioncss =
GETPOST(
'optioncss',
'aZ');
63$mode =
GETPOST(
'mode',
'alpha');
69$project_ref =
GETPOST(
'project_ref',
'alpha');
70$search_societe =
GETPOST(
'search_societe',
'alpha');
84$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
85$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
87if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
91$offset = $limit * $page;
98$diroutputmassaction =
$conf->ticket->dir_output.
'/temp/massgeneration/'.$user->id;
100 $hookmanager->initHooks(array(
'thirdpartyticket',
'globalcard'));
101} elseif ($projectid > 0) {
102 $hookmanager->initHooks(array(
'projectticket',
'globalcard'));
104 $hookmanager->initHooks(array(
'ticketlist'));
107$extrafields->fetch_name_optionals_label(
$object->table_element);
108$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
112 $sortfield =
"t.datec";
123$search_all = trim(
GETPOST(
"search_all",
'alphanohtml'));
125foreach (
$object->fields as $key => $val) {
127 $search[$key] =
GETPOST(
'search_'.$key,
'array:alpha');
128 } elseif (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
129 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
133 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
140$fieldstosearchall = array();
141foreach (
$object->fields as $key => $val) {
142 if (!empty($val[
'searchall'])) {
143 $fieldstosearchall[
't.'.$key] = $val[
'label'];
146$fieldstosearchall[
's.name_alias'] =
"AliasNameShort";
147$fieldstosearchall[
's.zip'] =
"Zip";
148$fieldstosearchall[
's.town'] =
"Town";
151$arrayfields = array();
152foreach (
$object->fields as $key => $val) {
154 if (!empty($val[
'visible'])) {
155 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
156 $arrayfields[
't.'.$key] = array(
157 'label' => $val[
'label'],
158 'checked' => (($visible < 0) ? 0 : 1),
159 'enabled' => (abs($visible) != 3 && (bool)
dol_eval((
string) $val[
'enabled'], 1)),
160 'position' => $val[
'position'],
161 'help' => isset($val[
'help']) ? $val[
'help'] :
''
166include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
168$parameters = array(
'arrayfields' => &$arrayfields);
169$reshook = $hookmanager->executeHooks(
'completeArrayFields', $parameters, $object, $action);
176if (!$user->hasRight(
'ticket',
'read')) {
180if ($user->socid > 0) {
181 $socid = $user->socid;
185$url_page_current = DOL_URL_ROOT.
'/ticket/list.php';
189 $tmpproject->fetch(0, $project_ref);
190 $projectid = $tmpproject->id;
191 $search_fk_project = $projectid;
194$permissiontoread = $user->hasRight(
'ticket',
'read');
195$permissiontoadd = $user->hasRight(
'ticket',
'write');
196$permissiontodelete = $user->hasRight(
'ticket',
'delete');
205if (
GETPOST(
'cancel',
'alpha')) {
209if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend' && $massaction !=
'presendonclose' && $massaction !=
'close') {
213$parameters = array(
'arrayfields' => &$arrayfields);
215 $parameters[
'socid'] = $socid;
218 $parameters[
'projectid'] = $projectid;
220$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
225if (empty($reshook)) {
227 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
230 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
231 foreach (
$object->fields as $key => $val) {
233 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
234 $search[$key.
'_dtstart'] =
'';
235 $search[$key.
'_dtend'] =
'';
239 $search_array_options = array();
240 $search_societe =
'';
241 $search_date_start =
'';
242 $search_date_end =
'';
243 $search_dateread_start =
'';
244 $search_dateread_end =
'';
245 $search_dateclose_start =
'';
246 $search_dateclose_end =
'';
248 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
249 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
254 $objectclass =
'Ticket';
255 $objectlabel =
'Ticket';
256 $uploaddir =
$conf->ticket->dir_output;
258 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
261 if (!$error && $massaction ==
'close' && $permissiontoadd) {
266 foreach ($toselect as $toselectid) {
267 $result = $objecttmp->fetch($toselectid);
269 $result = $objecttmp->close($user);
294 if (!$error && $massaction ==
'reopen' && $permissiontoadd) {
299 foreach ($toselect as $toselectid) {
300 $result = $objecttmp->fetch($toselectid);
302 if ($objecttmp->status == Ticket::STATUS_CLOSED || $objecttmp->status == Ticket::STATUS_CANCELED) {
304 $result = $objecttmp->setStatut(Ticket::STATUS_ASSIGNED,
null,
'',
'TICKET_MODIFY');
314 $langs->load(
"errors");
315 setEventMessages($langs->trans(
"ErrorObjectMustHaveStatusClosedToBeReOpened", $objecttmp->ref),
null,
'errors');
354 $socstatic->fetch($socid);
355 $moretitle = $langs->trans(
"ThirdParty") .
' - ';
356 if (
getDolGlobalString(
'MAIN_HTML_TITLE') && preg_match(
'/thirdpartynameonly/',
$conf->global->MAIN_HTML_TITLE) && $socstatic->name) {
357 $moretitle = $socstatic->name .
' - ';
361$title = $moretitle . $langs->trans(
'Tickets');
369$sql .=
$object->getFieldList(
't');
371if (!empty($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 :
'');
377$parameters = array();
378$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
379$sql .= $hookmanager->resPrint;
380$sql = preg_replace(
'/,\s*$/',
'', $sql);
384$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
385if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
386 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
389$parameters = array();
390$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
391$sql .= $hookmanager->resPrint;
392$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON (t.fk_soc = s.rowid)";
393$sql .=
" WHERE t.entity IN (".getEntity(
$object->element).
")";
395 $sql .=
" AND t.fk_soc = ".((int) $socid);
398foreach ($search as $key => $val) {
399 $tmpkey =
't.' . $key;
400 if ($key ==
'fk_statut' && !empty($search[
'fk_statut'])) {
401 $newarrayofstatus = array();
402 if (is_array($search[
'fk_statut'])) {
403 foreach ($search[
'fk_statut'] as $key2 => $val2) {
404 if (in_array($val2, array(
'openall',
'closeall'))) {
407 $newarrayofstatus[] = $val2;
410 if ($search[
'fk_statut'] ===
'openall' || (is_array($search[
'fk_statut']) && in_array(
'openall', $search[
'fk_statut']))) {
412 $newarrayofstatus[] = Ticket::STATUS_READ;
413 $newarrayofstatus[] = Ticket::STATUS_ASSIGNED;
414 $newarrayofstatus[] = Ticket::STATUS_IN_PROGRESS;
415 $newarrayofstatus[] = Ticket::STATUS_NEED_MORE_INFO;
416 $newarrayofstatus[] = Ticket::STATUS_WAITING;
418 if ($search[
'fk_statut'] ===
'closeall' || (is_array($search[
'fk_statut']) && in_array(
'closeall', $search[
'fk_statut']))) {
419 $newarrayofstatus[] = Ticket::STATUS_CLOSED;
420 $newarrayofstatus[] = Ticket::STATUS_CANCELED;
422 if (count($newarrayofstatus)) {
423 $sql .=
natural_search($tmpkey, implode(
',', $newarrayofstatus), 2);
426 } elseif ($key ==
'fk_user_assign' || $key ==
'fk_user_create' || $key ==
'fk_project' || $key ==
'fk_contract') {
427 if ($search[$key] > 0) {
431 } elseif ($key ==
'type_code') {
432 $newarrayoftypecodes = is_array($search[$key]) ? $search[$key] : (!empty($search[$key]) ? explode(
',', $search[$key]) : array());
433 if (count($newarrayoftypecodes)) {
434 $sql .=
natural_search($tmpkey, implode(
',', $newarrayoftypecodes), 3);
441 if ((is_array($search[$key]) && !empty($search[$key])) || (!is_array($search[$key]) && $search[$key] !=
'')) {
446 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
448if ($search_societe) {
451if ($search_fk_project > 0) {
452 $sql .=
natural_search(
't.fk_project', (
string) $search_fk_project, 2);
454if ($search_fk_contract > 0) {
455 $sql .=
natural_search(
't.fk_contract', (
string) $search_fk_contract, 2);
457if ($search_date_start) {
458 $sql .=
" AND t.datec >= '".$db->idate($search_date_start).
"'";
460if ($search_date_end) {
461 $sql .=
" AND t.datec <= '".$db->idate($search_date_end).
"'";
463if ($search_dateread_start) {
464 $sql .=
" AND t.date_read >= '".$db->idate($search_dateread_start).
"'";
466if ($search_dateread_end) {
467 $sql .=
" AND t.date_read <= '".$db->idate($search_dateread_end).
"'";
469if ($search_dateclose_start) {
470 $sql .=
" AND t.date_close >= '".$db->idate($search_dateclose_start).
"'";
472if ($search_dateclose_end) {
473 $sql .=
" AND t.date_close <= '".$db->idate($search_dateclose_end).
"'";
476if (!$user->socid && ($mode ==
"mine" || (!$user->admin &&
getDolGlobalString(
'TICKET_LIMIT_VIEW_ASSIGNED_ONLY')))) {
477 $sql .=
" AND (t.fk_user_assign = ".((int) $user->id);
479 $sql .=
" OR t.fk_user_create = ".((int) $user->id);
485include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
487$parameters = array();
488$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
489$sql .= $hookmanager->resPrint;
492$nbtotalofrecords =
'';
495 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
496 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
497 $resql =
$db->query($sqlforcount);
499 $objforcount =
$db->fetch_object($resql);
500 $nbtotalofrecords = $objforcount->nbtotalofrecords;
505 if (($page * $limit) > (
int) $nbtotalofrecords) {
513$sql .=
$db->order($sortfield, $sortorder);
515 $sql .=
$db->plimit($limit + 1, $offset);
518$resql =
$db->query($sql);
524$num =
$db->num_rows($resql);
527if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
528 $obj =
$db->fetch_object($resql);
530 header(
"Location: ".DOL_URL_ROOT.
'/ticket/card.php?id='.
$id);
538llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-ticket page-list bodyforlist');
540if ($socid && !$projectid && !$project_ref && $user->hasRight(
'societe',
'lire')) {
542 $res = $socstat->fetch($socid);
549 print
dol_get_fiche_head($head,
'ticket', $langs->trans(
"ThirdParty"), -1,
'company');
551 dol_banner_tab($socstat,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom');
553 print
'<div class="fichecenter">';
555 print
'<div class="underbanner clearboth"></div>';
556 print
'<table class="border centpercent tableforfield">';
559 print
'<tr><td class="titlefield">'.$langs->trans(
'NatureOfThirdParty').
'</td><td>';
560 print $socstat->getTypeUrl(1);
564 if ($socstat->client && !empty($socstat->code_client)) {
565 print
'<tr><td class="titlefield">';
566 print $langs->trans(
'CustomerCode').
'</td><td>';
568 $tmpcheck = $socstat->check_codeclient();
569 if ($tmpcheck != 0 && $tmpcheck != -5) {
570 print
' <span class="error">('.$langs->trans(
"WrongCustomerCode").
')</span>';
576 if ($socstat->fournisseur && !empty($socstat->code_fournisseur)) {
577 print
'<tr><td class="titlefield">';
578 print $langs->trans(
'SupplierCode').
'</td><td>';
580 $tmpcheck = $socstat->check_codefournisseur();
581 if ($tmpcheck != 0 && $tmpcheck != -5) {
582 print
' <span class="error">('.$langs->trans(
"WrongSupplierCode").
')</span>';
596if ($projectid > 0 || $project_ref) {
598 if ($projectstat->fetch($projectid, $project_ref) > 0) {
599 $projectid = $projectstat->id;
600 $projectstat->fetch_thirdparty();
607 $userWrite = $projectstat->restrictedProjectArea($user,
'write');
612 print
dol_get_fiche_head($head,
'ticket', $langs->trans(
"Project"), -1, ($projectstat->public ?
'projectpub' :
'project'));
616 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
618 $morehtmlref =
'<div class="refidno">';
620 $morehtmlref .=
$object->title;
622 if (!empty(
$object->thirdparty->id) &&
$object->thirdparty->id > 0) {
623 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'project');
625 $morehtmlref .=
'</div>';
628 if (!$user->hasRight(
'projet',
'all',
'lire')) {
629 $objectsListId =
$object->getProjectsAuthorizedForUser($user, 0, 0);
630 $object->next_prev_filter =
"rowid:IN:".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0');
633 dol_banner_tab($object,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
635 print
'<div class="fichecenter">';
636 print
'<div class="underbanner clearboth"></div>';
638 print
'<table class="border tableforfield centpercent">';
641 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
642 if ($projectstat->public) {
643 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
644 print $langs->trans(
'SharedProject');
646 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
647 print $langs->trans(
'PrivateProject');
660 print
"ErrorRecordNotFound";
664$arrayofselected = is_array($toselect) ? $toselect : array();
668 $param .=
'&mode='.urlencode($mode);
670if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
671 $param .=
'&contextpage='.urlencode($contextpage);
673if ($limit > 0 && $limit !=
$conf->liste_limit) {
674 $param .=
'&limit='.((int) $limit);
676if ($optioncss !=
'') {
677 $param .=
'&optioncss='.urlencode($optioncss);
679foreach ($search as $key => $val) {
680 if (is_array($search[$key])) {
681 foreach ($search[$key] as $skey) {
683 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
686 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
687 $param .=
'&search_'.$key.
'month='.(
GETPOSTINT(
'search_'.$key.
'month'));
688 $param .=
'&search_'.$key.
'day='.(
GETPOSTINT(
'search_'.$key.
'day'));
689 $param .=
'&search_'.$key.
'year='.(
GETPOSTINT(
'search_'.$key.
'year'));
690 } elseif ($search[$key] !=
'') {
691 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
695include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
697$parameters = array(
'param' => &$param);
698$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
699$param .= $hookmanager->resPrint;
701 $param .=
'&socid='.urlencode((
string) ($socid));
703if ($search_societe) {
704 $param .=
'&search_societe='.urlencode($search_societe);
707 $param .=
'&projectid='.urlencode((
string) ($projectid));
709if ($contractid > 0) {
710 $param .=
'&contractid='.urlencode((
string) ($contractid));
712if ($search_date_start) {
714 $param .=
'&search_date_startday='.((int) $tmparray[
'mday']);
715 $param .=
'&search_date_startmonth='.((int) $tmparray[
'mon']);
716 $param .=
'&search_date_startyear='.((int) $tmparray[
'year']);
718if ($search_date_end) {
720 $param .=
'&search_date_endday='.((int) $tmparray[
'mday']);
721 $param .=
'&search_date_endmonth='.((int) $tmparray[
'mon']);
722 $param .=
'&search_date_endyear='.((int) $tmparray[
'year']);
724if ($search_dateread_start) {
726 $param .=
'&search_dateread_startday='.((int) $tmparray[
'mday']);
727 $param .=
'&search_dateread_startmonth='.((int) $tmparray[
'mon']);
728 $param .=
'&search_dateread_startyear='.((int) $tmparray[
'year']);
730if ($search_dateread_end) {
732 $param .=
'&search_dateread_endday='.((int) $tmparray[
'mday']);
733 $param .=
'&search_dateread_endmonth='.((int) $tmparray[
'mon']);
734 $param .=
'&search_dateread_endyear='.((int) $tmparray[
'year']);
736if ($search_dateclose_start) {
738 $param .=
'&search_dateclose_startday='.((int) $tmparray[
'mday']);
739 $param .=
'&search_dateclose_startmonth='.((int) $tmparray[
'mon']);
740 $param .=
'&search_dateclose_startyear='.((int) $tmparray[
'year']);
742if ($search_dateclose_end) {
744 $param .=
'&search_date_endday='.((int) $tmparray[
'mday']);
745 $param .=
'&search_date_endmonth='.((int) $tmparray[
'mon']);
746 $param .=
'&search_date_endyear='.((int) $tmparray[
'year']);
749$arrayofmassactions = array(
753if ($permissiontoadd) {
754 $arrayofmassactions[
'presendonclose'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Close");
755 $arrayofmassactions[
'reopen'] =
img_picto(
'',
'folder-open',
'class="pictofixedwidth"').$langs->trans(
"ReOpen");
757if ($permissiontodelete) {
758 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
760if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
761 $arrayofmassactions = array();
763$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
765print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
766if ($optioncss !=
'') {
767 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
769print
'<input type="hidden" name="token" value="'.newToken().
'">';
770print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
771print
'<input type="hidden" name="action" value="list">';
772print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
773print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
774print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
775print
'<input type="hidden" name="page_y" value="">';
776print
'<input type="hidden" name="mode" value="'.$mode.
'" >';
779 print
'<input type="hidden" name="socid" value="'.$socid.
'" >';
782 print
'<input type="hidden" name="projectid" value="'.$projectid.
'" >';
785$url = DOL_URL_ROOT.
'/ticket/card.php?action=create&mode=init'.($socid ?
'&socid='.$socid :
'').($projectid ?
'&origin=projet_project&originid='.$projectid :
'');
787 $url .=
'&socid='.$socid;
790$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss' =>
'reposition'));
791$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanban'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
792$newcardbutton .=
dolGetButtonTitle($langs->trans(
'Statistics'),
'',
'fa fa-chart-bar imgforviewmode', DOL_URL_ROOT.
'/ticket/stats/index.php?mode=statistics&objecttype=ticket@ticket'.preg_replace(
'/(&|\?)*(mode|groupby)=[^&]+/',
'', $param),
'', ($mode ==
'statistics' ? 2 : 1), array(
'morecss' =>
'reposition'));
794$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewTicket'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'ticket',
'write'));
801print_barre_liste($langs->trans(
'Tickets'), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
803if ($mode ==
'mine') {
804 print
'<div class="opacitymedium">'.$langs->trans(
'TicketAssignedToMeInfos').
'</div><br>';
807$topicmail =
"SendTicketRef";
808$modelmail =
"ticket";
810$trackid =
'tic'.$object->id;
811include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
814if ($massaction ==
'presendonclose') {
815 $hidden_form = array([
817 "name" =>
"massaction",
821 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassTicketClosingSendEmail"), $langs->trans(
"ConfirmMassTicketClosingSendEmailQuestion"),
'confirm_send_close', $hidden_form, $selectedchoice, 0, 200, 500, 1);
826 foreach ($fieldstosearchall as $key => $val) {
827 $fieldstosearchall[$key] = $langs->trans($val);
828 $setupstring .= $key.
"=".$val.
";";
830 print
'<!-- Search done like if TICKET_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
831 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
839$parameters = array();
840$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
841if (empty($reshook)) {
842 $moreforfilter .= $hookmanager->resPrint;
844 $moreforfilter = $hookmanager->resPrint;
847if (!empty($moreforfilter)) {
848 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
849 print $moreforfilter;
853$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
854$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
855$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
856$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
858print
'<div class="div-table-responsive">';
859print
'<div class="div-table-responsive-inside">';
860print
'<table class="tagtable noborder nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
865print
'<tr class="liste_titre_filter">';
867if (
$conf->main_checkbox_left_column) {
868 print
'<td class="liste_titre maxwidthsearch center">';
869 $searchpicto = $form->showFilterButtons(
'left');
873foreach (
$object->fields as $key => $val) {
874 $searchkey = empty($search[$key]) ?
'' : $search[$key];
875 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
876 if ($key ==
'fk_statut') {
877 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
878 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
879 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
880 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
881 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
882 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'id',
'rowid',
'ref',
'status')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
883 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
885 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
886 if ($key ==
'progress') {
887 print
'<td class="liste_titre right'.($cssforfield ?
' '.$cssforfield :
'').
'">';
888 print
'<input type="text" class="flat maxwidth50" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
890 } elseif ($key ==
'type_code') {
891 print
'<td class="liste_titre">';
892 $formTicket->selectTypesTickets(empty($search[$key]) ?
'' : $search[$key],
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'), 1);
894 } elseif ($key ==
'category_code') {
895 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
896 $formTicket->selectGroupTickets(
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'));
898 } elseif ($key ==
'severity_code') {
899 print
'<td class="liste_titre center'.($cssforfield ?
' '.$cssforfield :
'').
'">';
900 $formTicket->selectSeveritiesTickets(
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'));
902 } elseif ($key ==
'fk_user_assign' || $key ==
'fk_user_create') {
903 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
904 print $form->select_dolusers((empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key, 1, null, 0,
'',
'',
'0', 0, 0,
'', 0,
'', (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth100'));
906 } elseif ($key ==
'fk_statut') {
907 $arrayofstatus = array();
908 $langs->load(
"ticket");
909 $arrayofstatus[
'openall'] = array(
'id' =>
'openall',
'labelhtml' =>
'<b>-- '.$langs->trans(
'OpenAll').
'</b>',
'label' =>
'-- '.$langs->trans(
'OpenAll'));
910 foreach (
$object->labelStatusShort as $key2 => $val2) {
911 if ($key2 == Ticket::STATUS_CLOSED) {
912 $arrayofstatus[
'closeall'] = array(
'id' =>
'closeall',
'labelhtml' =>
'<b>-- '.$langs->trans(
'ClosedAll').
'</b>',
'label' =>
'-- '.$langs->trans(
'ClosedAll'));
914 $arrayofstatus[$key2] = array(
'id' => $key2,
'labelhtml' => $val2,
'label' => $val2);
916 print
'<td class="liste_titre center parentonrightofpage'.($cssforfield ?
' '.$cssforfield :
'').
'">';
920 $selectedarray =
null;
921 if (!empty($search[$key])) {
922 if (is_array($search[$key])) {
923 $selectedarray = array_values($search[$key]);
925 $selectedarray = array($search[$key]);
928 print
Form::multiselectarray(
'search_fk_statut', $arrayofstatus, $selectedarray, 0, 0,
'search_status width150 onrightofpage', 1, 0,
'',
'',
'');
930 } elseif ($key ==
"fk_soc") {
931 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'"><input type="text" class="flat maxwidth75" name="search_societe" value="'.
dol_escape_htmltag($search_societe).
'"></td>';
932 } elseif ($key ==
"datec" || $key ==
'date_read' || $key ==
'date_close') {
933 print
'<td class="liste_titre center">';
934 print
'<div class="nowrap">';
937 print $form->selectDate($search_date_start ?: -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
940 print $form->selectDate($search_dateread_start ?: -1,
'search_dateread_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
943 print $form->selectDate($search_dateclose_start ?: -1,
'search_dateclose_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
946 print
'<div class="nowrap">';
949 print $form->selectDate($search_date_end ?: -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
952 print $form->selectDate($search_dateread_end ?: -1,
'search_dateread_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
955 print $form->selectDate($search_dateclose_end ?: -1,
'search_dateclose_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
960 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
961 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
962 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], $search[$key], $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
963 } elseif (strpos($val[
'type'],
'integer:') === 0) {
964 print
$object->showInputField($val, $key, !empty($search[$key]) ? $search[$key] :
"",
'',
'',
'search_',
'maxwidth150', 1);
965 } elseif (!preg_match(
'/^(date|timestamp)/', $val[
'type'])) {
966 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
973include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
976$parameters = array(
'arrayfields' => $arrayfields);
977$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
978print $hookmanager->resPrint;
980if (!
$conf->main_checkbox_left_column) {
981 print
'<td class="liste_titre center maxwidthsearch">';
982 $searchpicto = $form->showFilterButtons();
993print
'<tr class="liste_titre">';
994if (
$conf->main_checkbox_left_column) {
995 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
998foreach (
$object->fields as $key => $val) {
999 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
1000 if ($key ==
'fk_statut' || $key ==
'severity_code') {
1001 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
1002 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
1003 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
1004 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
1005 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
1006 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'id',
'rowid',
'ref',
'status')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
1007 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
1009 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
1010 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
1011 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
''), 0, (empty($val[
'helplist']) ?
'' : $val[
'helplist'])).
"\n";
1016include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1018$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &
$totalarray);
1019$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1020print $hookmanager->resPrint;
1021if (!
$conf->main_checkbox_left_column) {
1022 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1029$needToFetchEachLine = 0;
1030if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
1031 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
1032 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
1033 $needToFetchEachLine++;
1045$imaxinloop = ($limit ? min($num, $limit) : $num);
1046$cacheofoutputfield = array();
1047while ($i < $imaxinloop) {
1048 $obj =
$db->fetch_object($resql);
1054 $object->setVarsFromFetchObj($obj);
1055 $object->type_code = $obj->type_code;
1058 if ($mode ==
'kanban') {
1060 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1061 print
'<div class="box-flex-container kanban">';
1066 $arraydata = array();
1067 if ($obj->fk_user_assign > 0) {
1068 $user_temp->fetch($obj->fk_user_assign);
1069 $arraydata[
'user_assignment'] = $user_temp->getNomUrl(-3);
1071 $arraydata[
'selected'] = in_array(
$object->id, $arrayofselected);
1074 print
$object->getKanbanView(
'', $arraydata);
1075 if ($i == ($imaxinloop - 1)) {
1082 print
'<tr data-rowid="'.$object->id.
'" class="oddeven row-with-select">';
1085 if (
$conf->main_checkbox_left_column) {
1086 print
'<td class="nowrap center">';
1087 if ($massactionbutton || $massaction) {
1089 if (in_array(
$object->id, $arrayofselected)) {
1092 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1100 foreach (
$object->fields as $key => $val) {
1101 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
1102 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
1103 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
1106 if (in_array($val[
'type'], array(
'timestamp'))) {
1107 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
1109 if (in_array($key, array(
'ref',
'fk_project'))) {
1110 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
1112 if (in_array($key, array(
'subject'))) {
1113 $cssforfield =
'minwidth200 tdoverflowbydiv';
1116 if ($key ==
'fk_statut' || $key ==
'severity_code') {
1117 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
1119 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
1120 print
'<td'.($cssforfield ?
' class="'.$cssforfield.((preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) ?
' classfortooltip' :
'').
'"' :
'');
1121 if (preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) {
1122 print
' title="'.dolPrintHTMLForAttribute((
string)
$object->$key).
'"';
1125 if ($key ==
'fk_statut') {
1126 print
$object->getLibStatut(5);
1127 } elseif ($key ==
'subject') {
1128 print
'<div class="small twolinesmax lineheightsmall minwidth150 maxwidth250 classfortooltip">';
1131 } elseif ($key ==
'type_code') {
1132 $s = $langs->getLabelFromKey(
$db,
'TicketTypeShort'.
$object->type_code,
'c_ticket_type',
'code',
'label',
$object->type_code);
1133 print
'<span title="'.dolPrintHTMLForAttribute($s).
'">';
1136 } elseif ($key ==
'category_code') {
1137 $s = $langs->getLabelFromKey(
$db,
'TicketCategoryShort'.
$object->category_code,
'c_ticket_category',
'code',
'label',
$object->category_code);
1138 print
'<span title="'.dolPrintHTMLForAttribute($s).
'">';
1141 } elseif ($key ==
'severity_code') {
1142 $s = $langs->getLabelFromKey(
$db,
'TicketSeverityShort'.
$object->severity_code,
'c_ticket_severity',
'code',
'label',
$object->severity_code);
1143 print
'<span title="'.dolPrintHTMLForAttribute($s).
'">';
1146 } elseif ($key ==
'tms') {
1148 } elseif ($key ==
'fk_user_create') {
1149 if (
$object->fk_user_create > 0) {
1150 if (isset(
$conf->cache[
'user'][
$object->fk_user_create])) {
1151 $user_temp =
$conf->cache[
'user'][
$object->fk_user_create];
1154 $user_temp->fetch(
$object->fk_user_create);
1155 $conf->cache[
'user'][
$object->fk_user_create] = $user_temp;
1157 print $user_temp->getNomUrl(-1);
1159 } elseif ($key ==
'fk_user_assign') {
1160 if (
$object->fk_user_assign > 0) {
1161 if (isset(
$conf->cache[
'user'][
$object->fk_user_assign])) {
1162 $user_temp =
$conf->cache[
'user'][
$object->fk_user_assign];
1165 $user_temp->fetch(
$object->fk_user_assign);
1166 $conf->cache[
'user'][
$object->fk_user_assign] = $user_temp;
1168 print $user_temp->getNomUrl(-1);
1170 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
1171 print
$object->showOutputField($val, $key,
$db->jdate($obj->$key),
'');
1172 } elseif ($key ==
'ref') {
1173 print
$object->showOutputField($val, $key, $obj->$key,
'');
1176 $is_open = (
$object->status != Ticket::STATUS_CLOSED &&
$object->status != Ticket::STATUS_CANCELED);
1178 if ($is_open && $should_show_warning) {
1179 $date_last_msg_sent = (int)
$object->date_last_msg_sent;
1180 $hour_diff = ($now - $date_last_msg_sent) / 3600 ;
1182 if (
getDolGlobalString(
'TICKET_DELAY_BEFORE_FIRST_RESPONSE') && $date_last_msg_sent == 0) {
1183 $creation_date =
$object->datec;
1184 $hour_diff_creation = ($now - $creation_date) / 3600 ;
1185 if ($hour_diff_creation >
getDolGlobalInt(
'TICKET_DELAY_BEFORE_FIRST_RESPONSE')) {
1186 print
" " .
img_picto($langs->trans(
'Late') .
' : ' . $langs->trans(
'TicketsDelayForFirstResponseTooLong',
getDolGlobalString(
'TICKET_DELAY_BEFORE_FIRST_RESPONSE')),
'warning',
'style="color: red;"', 0, 0, 0,
'',
'');
1189 print
" " .
img_picto($langs->trans(
'Late') .
' : ' . $langs->trans(
'TicketsDelayFromLastResponseTooLong',
getDolGlobalString(
'TICKET_DELAY_SINCE_LAST_RESPONSE')),
'warning');
1193 $tmp = explode(
':', $val[
'type']);
1194 if ($tmp[0] ==
'integer' && !empty($tmp[1]) && class_exists($tmp[1])) {
1197 if ($key && $obj->$key && $val[
'type'] && array_key_exists($key.
'-'.$obj->$key.
'-'.$val[
'type'], $cacheofoutputfield)) {
1198 $result = $cacheofoutputfield[$key.
'-'.$obj->$key.
'-'.$val[
'type']];
1200 $result =
$object->showOutputField($val, $key, $obj->$key,
'');
1201 $cacheofoutputfield[$key.
'-'.$obj->$key.
'-'.$val[
'type']] = $result;
1204 $result =
$object->showOutputField($val, $key, $obj->$key,
'');
1213 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
1228 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1230 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &
$totalarray);
1231 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1232 print $hookmanager->resPrint;
1235 if (!
$conf->main_checkbox_left_column) {
1236 print
'<td class="nowrap center">';
1237 if ($massactionbutton || $massaction) {
1239 if (in_array(
$object->id, $arrayofselected)) {
1242 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1257include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1263 foreach ($arrayfields as $key => $val) {
1264 if (!empty($val[
'checked'])) {
1268 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1274$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
1275$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
1276print $hookmanager->resPrint;
1278print
'</table>'.
"\n";
1282print
'</form>'.
"\n";
1286if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
1287 $hidegeneratedfilelistifempty = 1;
1288 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1289 $hidegeneratedfilelistifempty = 0;
1292 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
1296 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1297 $urlsource .= str_replace(
'&',
'&', $param);
1299 $filedir = $diroutputmassaction;
1300 $genallowed = $permissiontoread;
1301 $delallowed = $permissiontoadd;
1303 print $formfile->showdocuments(
'massfilesarea_ticket',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $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 to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
const STATUS_NOT_READ
Status.
Class to manage Dolibarr users.
societe_prepare_head(Societe $object, $subtabs='')
Return array of tabs to used on pages for third parties cards.
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
GETPOSTISARRAY($paramname, $method=0)
Return true if the parameter $paramname is submit from a POST OR GET as an array.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
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)
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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...
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
Class to generate the form for creating a new ticket.
project_prepare_head(Project $project, $moreparam='')
Prepare array with list of tabs.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.