30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/ticket/class/actions_ticket.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formticket.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
36include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
37include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
38include_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
41$langs->loadLangs(array(
"ticket",
"companies",
"other",
"projects",
"contracts"));
44$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
45$massaction =
GETPOST(
'massaction',
'alpha');
46$show_files =
GETPOST(
'show_files',
'int');
47$confirm =
GETPOST(
'confirm',
'alpha');
48$cancel =
GETPOST(
'cancel',
'alpha');
49$toselect =
GETPOST(
'toselect',
'array');
50$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'ticketlist';
51$backtopage =
GETPOST(
'backtopage',
'alpha');
52$optioncss =
GETPOST(
'optioncss',
'aZ');
53$mode =
GETPOST(
'mode',
'alpha');
56$msg_id =
GETPOST(
'msg_id',
'int');
57$socid =
GETPOST(
'socid',
'int');
58$contractid =
GETPOST(
'contractid',
'int');
59$projectid =
GETPOST(
'projectid',
'int');
60$project_ref =
GETPOST(
'project_ref',
'alpha');
61$search_societe =
GETPOST(
'search_societe',
'alpha');
62$search_fk_project =
GETPOST(
'search_fk_project',
'int') ?
GETPOST(
'search_fk_project',
'int') :
GETPOST(
'projectid',
'int');
63$search_fk_contract =
GETPOST(
'search_fk_contract',
'int') ?
GETPOST(
'search_fk_contract',
'int') :
GETPOST(
'contractid',
'int');
65$search_date_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_startmonth',
'int'),
GETPOST(
'search_date_startday',
'int'),
GETPOST(
'search_date_startyear',
'int'));
66$search_date_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_endmonth',
'int'),
GETPOST(
'search_date_endday',
'int'),
GETPOST(
'search_date_endyear',
'int'));
67$search_dateread_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_dateread_startmonth',
'int'),
GETPOST(
'search_dateread_startday',
'int'),
GETPOST(
'search_dateread_startyear',
'int'));
68$search_dateread_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_dateread_endmonth',
'int'),
GETPOST(
'search_dateread_endday',
'int'),
GETPOST(
'search_dateread_endyear',
'int'));
69$search_dateclose_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_dateclose_startmonth',
'int'),
GETPOST(
'search_dateclose_startday',
'int'),
GETPOST(
'search_dateclose_startyear',
'int'));
70$search_dateclose_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_dateclose_endmonth',
'int'),
GETPOST(
'search_dateclose_endday',
'int'),
GETPOST(
'search_dateclose_endyear',
'int'));
74$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
75$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
76$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
77$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
78if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
82$offset = $limit * $page;
89$diroutputmassaction = $conf->ticket->dir_output.
'/temp/massgeneration/'.$user->id;
91 $hookmanager->initHooks(array(
'thirdpartyticket',
'globalcard'));
92} elseif ($projectid > 0) {
93 $hookmanager->initHooks(array(
'projectticket',
'globalcard'));
95 $hookmanager->initHooks(array(
'ticketlist'));
98$extrafields->fetch_name_optionals_label($object->table_element);
99$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
103 $sortfield =
"t.datec";
109if (
GETPOST(
'search_fk_status',
'alpha') ==
'non_closed') {
110 $_GET[
'search_fk_statut'][] =
'openall';
114$search_all = (GETPOSTISSET(
"search_all") ?
GETPOST(
"search_all",
'alpha') :
GETPOST(
'sall'));
116foreach ($object->fields as $key => $val) {
117 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
118 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
122 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
123 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
124 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
129$fieldstosearchall = array();
130foreach ($object->fields as $key => $val) {
131 if (!empty($val[
'searchall'])) {
132 $fieldstosearchall[
't.'.$key] = $val[
'label'];
135$fieldstosearchall[
's.name_alias'] =
"AliasNameShort";
136$fieldstosearchall[
's.zip'] =
"Zip";
137$fieldstosearchall[
's.town'] =
"Town";
140$arrayfields = array();
141foreach ($object->fields as $key => $val) {
143 if (!empty($val[
'visible'])) {
144 $visible = (int)
dol_eval($val[
'visible'], 1);
145 $arrayfields[
't.'.$key] = array(
146 'label'=>$val[
'label'],
147 'checked'=>(($visible < 0) ? 0 : 1),
148 'enabled'=>(abs($visible) != 3 &&
dol_eval($val[
'enabled'], 1)),
149 'position'=>$val[
'position'],
150 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
155include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
162if (!$user->hasRight(
'ticket',
'read')) {
166if ($user->socid > 0) {
167 $socid = $user->socid;
171$url_page_current = DOL_URL_ROOT.
'/ticket/list.php';
174 $tmpproject =
new Project($db);
175 $tmpproject->fetch(0, $project_ref);
176 $projectid = $tmpproject->id;
177 $search_fk_project = $projectid;
180$permissiontoread = $user->rights->ticket->read;
181$permissiontoadd = $user->rights->ticket->write;
182$permissiontodelete = $user->rights->ticket->delete;
191if (
GETPOST(
'cancel',
'alpha')) {
195if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend' && $massaction !=
'presendonclose' && $massaction !=
'close') {
199$parameters = array();
201 $parameters[
'socid'] = $socid;
204 $parameters[
'projectid'] = $projectid;
206$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
211if (empty($reshook)) {
213 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
216 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
217 foreach ($object->fields as $key => $val) {
219 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
220 $search[$key.
'_dtstart'] =
'';
221 $search[$key.
'_dtend'] =
'';
225 $search_array_options = array();
226 $search_date_start =
'';
227 $search_date_end =
'';
228 $search_dateread_start =
'';
229 $search_dateread_end =
'';
230 $search_dateclose_start =
'';
231 $search_dateclose_end =
'';
233 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
234 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
239 $objectclass =
'Ticket';
240 $objectlabel =
'Ticket';
241 $uploaddir = $conf->ticket->dir_output;
242 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
245 if (!$error && $massaction ==
'close' && $permissiontoadd) {
246 $objecttmp =
new $objectclass($db);
251 foreach ($toselect as $toselectid) {
252 $result = $objecttmp->fetch($toselectid);
254 $result = $objecttmp->close($user);
284 if (!$error && $massaction ==
'reopen' && $permissiontoadd) {
285 $objecttmp =
new $objectclass($db);
290 foreach ($toselect as $toselectid) {
291 $result = $objecttmp->fetch($toselectid);
293 if ($objecttmp->status == Ticket::STATUS_CLOSED || $objecttmp->status == Ticket::STATUS_CANCELED) {
294 $result = $objecttmp->setStatut(Ticket::STATUS_ASSIGNED);
303 $langs->load(
"errors");
304 setEventMessages($langs->trans(
"ErrorObjectMustHaveStatusClosedToBeReOpened", $objecttmp->ref),
null,
'errors');
336$form =
new Form($db);
341$user_temp =
new User($db);
348 $socstatic->fetch($socid);
349 $moretitle = $langs->trans(
"ThirdParty") .
' - ';
350 if (
getDolGlobalString(
'MAIN_HTML_TITLE') && preg_match(
'/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $socstatic->name) {
351 $moretitle = $socstatic->name .
' - ';
355$title = $moretitle . $langs->trans(
'Tickets');
363$sql .= $object->getFieldList(
't');
365if (!empty($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 :
'');
371$parameters = array();
372$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
373$sql .= $hookmanager->resPrint;
374$sql = preg_replace(
'/,\s*$/',
'', $sql);
378$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
379if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
380 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
383$parameters = array();
384$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
385$sql .= $hookmanager->resPrint;
386$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON (t.fk_soc = s.rowid)";
387$sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
389 $sql .=
" AND t.fk_soc = ".((int) $socid);
392foreach ($search as $key => $val) {
393 if ($key ==
'fk_statut' && !empty($search[
'fk_statut'])) {
394 $newarrayofstatus = array();
395 foreach ($search[
'fk_statut'] as $key2 => $val2) {
396 if (in_array($val2, array(
'openall',
'closeall'))) {
399 $newarrayofstatus[] = $val2;
401 if ($search[
'fk_statut'] ==
'openall' || in_array(
'openall', $search[
'fk_statut'])) {
403 $newarrayofstatus[] = Ticket::STATUS_READ;
404 $newarrayofstatus[] = Ticket::STATUS_ASSIGNED;
405 $newarrayofstatus[] = Ticket::STATUS_IN_PROGRESS;
406 $newarrayofstatus[] = Ticket::STATUS_NEED_MORE_INFO;
407 $newarrayofstatus[] = Ticket::STATUS_WAITING;
409 if ($search[
'fk_statut'] ==
'closeall' || in_array(
'closeall', $search[
'fk_statut'])) {
410 $newarrayofstatus[] = Ticket::STATUS_CLOSED;
411 $newarrayofstatus[] = Ticket::STATUS_CANCELED;
413 if (count($newarrayofstatus)) {
417 } elseif ($key ==
'fk_user_assign' || $key ==
'fk_user_create' || $key ==
'fk_project' || $key ==
'fk_contract') {
418 if ($search[$key] > 0) {
422 } elseif ($key ==
'type_code') {
423 $newarrayoftypecodes = is_array($search[$key]) ? $search[$key] : (!empty($search[$key]) ? explode(
',', $search[$key]) : array());
424 if (count($newarrayoftypecodes)) {
430 $mode_search = ((!empty($object->fields[$key]) && ($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))) ? 1 : 0);
432 if ((is_array($search[$key]) && !empty($search[$key])) || (!is_array($search[$key]) && $search[$key] !=
'')) {
437 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
439if ($search_societe) {
442if ($search_fk_project > 0) {
445if ($search_fk_contract > 0) {
448if ($search_date_start) {
449 $sql .=
" AND t.datec >= '".$db->idate($search_date_start).
"'";
451if ($search_date_end) {
452 $sql .=
" AND t.datec <= '".$db->idate($search_date_end).
"'";
454if ($search_dateread_start) {
455 $sql .=
" AND t.date_read >= '".$db->idate($search_dateread_start).
"'";
457if ($search_dateread_end) {
458 $sql .=
" AND t.date_read <= '".$db->idate($search_dateread_end).
"'";
460if ($search_dateclose_start) {
461 $sql .=
" AND t.date_close >= '".$db->idate($search_dateclose_start).
"'";
463if ($search_dateclose_end) {
464 $sql .=
" AND t.date_close <= '".$db->idate($search_dateclose_end).
"'";
467if (!$user->socid && ($mode ==
"mine" || (!$user->admin &&
getDolGlobalString(
'TICKET_LIMIT_VIEW_ASSIGNED_ONLY')))) {
468 $sql .=
" AND (t.fk_user_assign = ".((int) $user->id);
470 $sql .=
" OR t.fk_user_create = ".((int) $user->id);
476include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
478$parameters = array();
479$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
480$sql .= $hookmanager->resPrint;
483$nbtotalofrecords =
'';
486 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
487 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
488 $resql = $db->query($sqlforcount);
490 $objforcount = $db->fetch_object($resql);
491 $nbtotalofrecords = $objforcount->nbtotalofrecords;
496 if (($page * $limit) > $nbtotalofrecords) {
504$sql .= $db->order($sortfield, $sortorder);
506 $sql .= $db->plimit($limit + 1, $offset);
509$resql = $db->query($sql);
515$num = $db->num_rows($resql);
518if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
519 $obj = $db->fetch_object($resql);
521 header(
"Location: ".DOL_URL_ROOT.
'/ticket/card.php?id='.$id);
529llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist');
531if ($socid && !$projectid && !$project_ref && $user->hasRight(
'societe',
'lire')) {
533 $res = $socstat->fetch($socid);
535 $tmpobject = $object;
538 $object = $tmpobject;
540 print
dol_get_fiche_head($head,
'ticket', $langs->trans(
"ThirdParty"), -1,
'company');
542 dol_banner_tab($socstat,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom');
544 print
'<div class="fichecenter">';
546 print
'<div class="underbanner clearboth"></div>';
547 print
'<table class="border centpercent tableforfield">';
550 print
'<tr><td class="titlefield">'.$langs->trans(
'NatureOfThirdParty').
'</td><td>';
551 print $socstat->getTypeUrl(1);
555 if ($socstat->client && !empty($socstat->code_client)) {
556 print
'<tr><td class="titlefield">';
557 print $langs->trans(
'CustomerCode').
'</td><td>';
559 $tmpcheck = $socstat->check_codeclient();
560 if ($tmpcheck != 0 && $tmpcheck != -5) {
561 print
' <span class="error">('.$langs->trans(
"WrongCustomerCode").
')</span>';
567 if ($socstat->fournisseur && !empty($socstat->code_fournisseur)) {
568 print
'<tr><td class="titlefield">';
569 print $langs->trans(
'SupplierCode').
'</td><td>';
571 $tmpcheck = $socstat->check_codefournisseur();
572 if ($tmpcheck != 0 && $tmpcheck != -5) {
573 print
' <span class="error">('.$langs->trans(
"WrongSupplierCode").
')</span>';
585if ($projectid > 0 || $project_ref) {
586 $projectstat =
new Project($db);
587 if ($projectstat->fetch($projectid, $project_ref) > 0) {
588 $projectid = $projectstat->id;
589 $projectstat->fetch_thirdparty();
591 $savobject = $object;
592 $object = $projectstat;
596 $userWrite = $projectstat->restrictedProjectArea($user,
'write');
601 print
dol_get_fiche_head($head,
'ticket', $langs->trans(
"Project"), -1, ($projectstat->public ?
'projectpub' :
'project'));
605 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
607 $morehtmlref =
'<div class="refidno">';
609 $morehtmlref .= $object->title;
611 if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
612 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'project');
614 $morehtmlref .=
'</div>';
617 if (!$user->hasRight(
'projet',
'all',
'lire')) {
618 $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
619 $object->next_prev_filter =
"rowid IN (".$db->sanitize(count($objectsListId) ? join(
',', array_keys($objectsListId)) :
'0').
")";
622 dol_banner_tab($object,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
624 print
'<div class="fichecenter">';
625 print
'<div class="underbanner clearboth"></div>';
627 print
'<table class="border tableforfield centpercent">';
630 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
631 if ($projectstat->public) {
632 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
633 print $langs->trans(
'SharedProject');
635 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
636 print $langs->trans(
'PrivateProject');
645 $object = $savobject;
647 print
"ErrorRecordNotFound";
651$arrayofselected = is_array($toselect) ? $toselect : array();
655 $param .=
'&mode='.urlencode($mode);
657if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
658 $param .=
'&contextpage='.urlencode($contextpage);
660if ($limit > 0 && $limit != $conf->liste_limit) {
661 $param .=
'&limit='.((int) $limit);
663foreach ($search as $key => $val) {
664 if (is_array($search[$key])) {
665 foreach ($search[$key] as $skey) {
667 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
670 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
671 $param .=
'&search_'.$key.
'month='.((int)
GETPOST(
'search_'.$key.
'month',
'int'));
672 $param .=
'&search_'.$key.
'day='.((int)
GETPOST(
'search_'.$key.
'day',
'int'));
673 $param .=
'&search_'.$key.
'year='.((int)
GETPOST(
'search_'.$key.
'year',
'int'));
674 } elseif ($search[$key] !=
'') {
675 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
678if ($optioncss !=
'') {
679 $param .=
'&optioncss='.urlencode($optioncss);
682include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
684$parameters = array(
'param' => &$param);
685$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
686$param .= $hookmanager->resPrint;
688 $param .=
'&socid='.urlencode($socid);
690if ($search_societe) {
691 $param .=
'&search_societe='.urlencode($search_societe);
694 $param .=
'&projectid='.urlencode($projectid);
696if ($contractid > 0) {
697 $param .=
'&contractid='.urlencode($contractid);
699if ($search_date_start) {
701 $param .=
'&search_date_startday='.urlencode($tmparray[
'mday']);
702 $param .=
'&search_date_startmonth='.urlencode($tmparray[
'mon']);
703 $param .=
'&search_date_startyear='.urlencode($tmparray[
'year']);
705if ($search_date_end) {
707 $param .=
'&search_date_endday='.urlencode($tmparray[
'mday']);
708 $param .=
'&search_date_endmonth='.urlencode($tmparray[
'mon']);
709 $param .=
'&search_date_endyear='.urlencode($tmparray[
'year']);
711if ($search_dateread_start) {
713 $param .=
'&search_dateread_startday='.urlencode($tmparray[
'mday']);
714 $param .=
'&search_dateread_startmonth='.urlencode($tmparray[
'mon']);
715 $param .=
'&search_dateread_startyear='.urlencode($tmparray[
'year']);
717if ($search_dateread_end) {
719 $param .=
'&search_dateread_endday='.urlencode($tmparray[
'mday']);
720 $param .=
'&search_dateread_endmonth='.urlencode($tmparray[
'mon']);
721 $param .=
'&search_dateread_endyear='.urlencode($tmparray[
'year']);
723if ($search_dateclose_start) {
725 $param .=
'&search_dateclose_startday='.urlencode($tmparray[
'mday']);
726 $param .=
'&search_dateclose_startmonth='.urlencode($tmparray[
'mon']);
727 $param .=
'&search_dateclose_startyear='.urlencode($tmparray[
'year']);
729if ($search_dateclose_end) {
731 $param .=
'&search_date_endday='.urlencode($tmparray[
'mday']);
732 $param .=
'&search_date_endmonth='.urlencode($tmparray[
'mon']);
733 $param .=
'&search_date_endyear='.urlencode($tmparray[
'year']);
736$arrayofmassactions = array(
740if ($permissiontoadd) {
741 $arrayofmassactions[
'presendonclose'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Close");
742 $arrayofmassactions[
'reopen'] =
img_picto(
'',
'folder-open',
'class="pictofixedwidth"').$langs->trans(
"ReOpen");
744if ($permissiontodelete) {
745 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
747if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
748 $arrayofmassactions = array();
750$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
752print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
753if ($optioncss !=
'') {
754 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
756print
'<input type="hidden" name="token" value="'.newToken().
'">';
757print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
758print
'<input type="hidden" name="action" value="list">';
759print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
760print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
761print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
762print
'<input type="hidden" name="mode" value="'.$mode.
'" >';
765 print
'<input type="hidden" name="socid" value="'.$socid.
'" >';
768 print
'<input type="hidden" name="projectid" value="'.$projectid.
'" >';
771$url = DOL_URL_ROOT.
'/ticket/card.php?action=create'.($socid ?
'&socid='.$socid :
'').($projectid ?
'&origin=projet_project&originid='.$projectid :
'');
773 $url .=
'&socid='.$socid;
776$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'));
777$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'));
779$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewTicket'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'ticket',
'write'));
786print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
788if ($mode ==
'mine') {
789 print
'<div class="opacitymedium">'.$langs->trans(
'TicketAssignedToMeInfos').
'</div><br>';
792$topicmail =
"SendTicketRef";
793$modelmail =
"ticket";
794$objecttmp =
new Ticket($db);
795$trackid =
'tic'.$object->id;
796include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
799if ($massaction ==
'presendonclose') {
800 $hidden_form = array([
802 "name" =>
"massaction",
806 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassTicketClosingSendEmail"), $langs->trans(
"ConfirmMassTicketClosingSendEmailQuestion"),
'confirm_send_close', $hidden_form, $selectedchoice, 0, 200, 500, 1);
811 foreach ($fieldstosearchall as $key => $val) {
812 $fieldstosearchall[$key] = $langs->trans($val);
813 $setupstring .= $key.
"=".$val.
";";
815 print
'<!-- Search done like if TICKET_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
816 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>'.
"\n";
824$parameters = array();
825$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
826if (empty($reshook)) {
827 $moreforfilter .= $hookmanager->resPrint;
829 $moreforfilter = $hookmanager->resPrint;
832if (!empty($moreforfilter)) {
833 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
834 print $moreforfilter;
838$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
839$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
840$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
842print
'<div class="div-table-responsive">';
843print
'<div class="div-table-responsive-inside">';
844print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
849print
'<tr class="liste_titre_filter">';
852 print
'<td class="liste_titre maxwidthsearch center">';
853 $searchpicto = $form->showFilterButtons(
'left');
857foreach ($object->fields as $key => $val) {
858 $searchkey = empty($search[$key]) ?
'' : $search[$key];
859 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
860 if ($key ==
'fk_statut') {
861 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
862 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
863 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
864 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
865 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
866 } 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'])) {
867 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
869 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
870 if ($key ==
'progress') {
871 print
'<td class="liste_titre right'.($cssforfield ?
' '.$cssforfield :
'').
'">';
872 print
'<input type="text" class="flat maxwidth50" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
874 } elseif ($key ==
'type_code') {
875 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
876 $formTicket->selectTypesTickets(empty($search[$key]) ?
'' : $search[$key],
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'), 1);
878 } elseif ($key ==
'category_code') {
879 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
880 $formTicket->selectGroupTickets(
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'));
882 } elseif ($key ==
'severity_code') {
883 print
'<td class="liste_titre center'.($cssforfield ?
' '.$cssforfield :
'').
'">';
884 $formTicket->selectSeveritiesTickets(
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'));
886 } elseif ($key ==
'fk_user_assign' || $key ==
'fk_user_create') {
887 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
888 print $form->select_dolusers((empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key, 1, null, 0,
'',
'',
'0', 0, 0,
'', 0,
'', (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth100'));
890 } elseif ($key ==
'fk_statut') {
891 $arrayofstatus = array();
892 $arrayofstatus[
'openall'] =
'-- '.$langs->trans(
'OpenAll').
' --';
893 foreach ($object->labelStatusShort as $key2 => $val2) {
894 if ($key2 == Ticket::STATUS_CLOSED) {
895 $arrayofstatus[
'closeall'] =
'-- '.$langs->trans(
'ClosedAll').
' --';
897 $arrayofstatus[$key2] = $val2;
899 print
'<td class="liste_titre center parentonrightofpage'.($cssforfield ?
' '.$cssforfield :
'').
'">';
903 $selectedarray =
null;
904 if (!empty($search[$key])) {
905 $selectedarray = array_values($search[$key]);
907 print
Form::multiselectarray(
'search_fk_statut', $arrayofstatus, $selectedarray, 0, 0,
'search_status width150 onrightofpage', 1, 0,
'',
'',
'');
909 } elseif ($key ==
"fk_soc") {
910 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'"><input type="text" class="flat maxwidth75" name="search_societe" value="'.
dol_escape_htmltag($search_societe).
'"></td>';
911 } elseif ($key ==
"datec" || $key ==
'date_read' || $key ==
'date_close') {
912 print
'<td class="liste_titre center">';
913 print
'<div class="nowrap">';
916 print $form->selectDate($search_date_start ?: -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
919 print $form->selectDate($search_dateread_start ?: -1,
'search_dateread_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
922 print $form->selectDate($search_dateclose_start ?: -1,
'search_dateclose_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
925 print
'<div class="nowrap">';
928 print $form->selectDate($search_date_end ?: -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
931 print $form->selectDate($search_dateread_end ?: -1,
'search_dateread_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
934 print $form->selectDate($search_dateclose_end ?: -1,
'search_dateclose_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
939 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
940 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
941 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], $search[$key], $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
942 } elseif (strpos($val[
'type'],
'integer:') === 0) {
943 print $object->showInputField($val, $key, !empty($search[$key]) ? $search[$key] :
"",
'',
'',
'search_',
'maxwidth150', 1);
944 } elseif (!preg_match(
'/^(date|timestamp)/', $val[
'type'])) {
945 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
952include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
955$parameters = array(
'arrayfields'=>$arrayfields);
956$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
957print $hookmanager->resPrint;
960 print
'<td class="liste_titre center maxwidthsearch">';
961 $searchpicto = $form->showFilterButtons();
967$totalarray = array();
968$totalarray[
'nbfield'] = 0;
972print
'<tr class="liste_titre">';
974 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
975 $totalarray[
'nbfield']++;
977foreach ($object->fields as $key => $val) {
978 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
979 if ($key ==
'fk_statut' || $key ==
'severity_code') {
980 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
981 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
982 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
983 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
984 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
985 } 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'])) {
986 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
988 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
989 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
990 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";
991 $totalarray[
'nbfield']++;
995include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
997$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
998$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
999print $hookmanager->resPrint;
1001 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1002 $totalarray[
'nbfield']++;
1008$needToFetchEachLine = 0;
1009if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
1010 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
1011 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
1012 $needToFetchEachLine++;
1021$savnbfield = $totalarray[
'nbfield'];
1022$totalarray = array();
1023$totalarray[
'nbfield'] = 0;
1024$imaxinloop = ($limit ? min($num, $limit) : $num);
1025$cacheofoutputfield = array();
1026while ($i < $imaxinloop) {
1027 $obj = $db->fetch_object($resql);
1033 $object->setVarsFromFetchObj($obj);
1034 $object->type_code = $obj->type_code;
1035 $object->status = $object->fk_statut;
1037 if ($mode ==
'kanban') {
1039 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1040 print
'<div class="box-flex-container kanban">';
1045 $arraydata = array();
1046 if ($obj->fk_user_assign > 0) {
1047 $user_temp->fetch($obj->fk_user_assign);
1048 $arraydata[
'user_assignment'] = $user_temp->getNomUrl(-3);
1050 $arraydata[
'selected'] = in_array($object->id, $arrayofselected);
1053 print $object->getKanbanView(
'', $arraydata);
1054 if ($i == ($imaxinloop - 1)) {
1061 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
1064 print
'<td class="nowrap center">';
1065 if ($massactionbutton || $massaction) {
1067 if (in_array($object->id, $arrayofselected)) {
1070 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1074 $totalarray[
'nbfield']++;
1077 foreach ($object->fields as $key => $val) {
1078 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
1079 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
1080 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
1082 if (in_array($val[
'type'], array(
'timestamp'))) {
1083 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
1085 if (in_array($key, array(
'ref',
'fk_project'))) {
1086 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
1088 if ($key ==
'fk_statut' || $key ==
'severity_code') {
1089 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
1091 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
1093 if ($cssforfield || (array_key_exists(
'css', $val) && $val[
'css'])) {
1097 if ($cssforfield && array_key_exists(
'css', $val) && $val[
'css']) {
1100 if (array_key_exists(
'css', $val)) {
1103 if ($cssforfield || (array_key_exists(
'css', $val) && $val[
'css'])) {
1107 if ($key ==
'fk_statut') {
1108 print $object->getLibStatut(5);
1109 } elseif ($key ==
'subject') {
1111 print
'<span title="'.dol_escape_htmltag($s).
'">';
1114 } elseif ($key ==
'type_code') {
1115 $s = $langs->getLabelFromKey($db,
'TicketTypeShort'.$object->type_code,
'c_ticket_type',
'code',
'label', $object->type_code);
1116 print
'<span title="'.dol_escape_htmltag($s).
'">';
1119 } elseif ($key ==
'category_code') {
1120 $s = $langs->getLabelFromKey($db,
'TicketCategoryShort'.$object->category_code,
'c_ticket_category',
'code',
'label', $object->category_code);
1121 print
'<span title="'.dol_escape_htmltag($s).
'">';
1124 } elseif ($key ==
'severity_code') {
1125 $s = $langs->getLabelFromKey($db,
'TicketSeverityShort'.$object->severity_code,
'c_ticket_severity',
'code',
'label', $object->severity_code);
1126 print
'<span title="'.dol_escape_htmltag($s).
'">';
1129 } elseif ($key ==
'tms') {
1130 print
dol_print_date($db->jdate($obj->$key),
'dayhour',
'tzuser');
1131 } elseif ($key ==
'fk_user_create') {
1132 if ($object->fk_user_create > 0) {
1133 if (isset($conf->cache[
'user'][$object->fk_user_create])) {
1134 $user_temp = $conf->cache[
'user'][$object->fk_user_create];
1136 $user_temp =
new User($db);
1137 $user_temp->fetch($object->fk_user_create);
1138 $conf->cache[
'user'][$object->fk_user_create] = $user_temp;
1140 print $user_temp->getNomUrl(-1);
1142 } elseif ($key ==
'fk_user_assign') {
1143 if ($object->fk_user_assign > 0) {
1144 if (isset($conf->cache[
'user'][$object->fk_user_assign])) {
1145 $user_temp = $conf->cache[
'user'][$object->fk_user_assign];
1147 $user_temp =
new User($db);
1148 $user_temp->fetch($object->fk_user_assign);
1149 $conf->cache[
'user'][$object->fk_user_assign] = $user_temp;
1151 print $user_temp->getNomUrl(-1);
1153 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
1154 print $object->showOutputField($val, $key, $db->jdate($obj->$key),
'');
1155 } elseif ($key ==
'ref') {
1156 print $object->showOutputField($val, $key, $obj->$key,
'');
1159 $is_open = ($object->status != Ticket::STATUS_CLOSED && $object->status != Ticket::STATUS_CANCELED);
1161 if ($is_open && $should_show_warning) {
1162 $date_last_msg_sent = (int) $object->date_last_msg_sent;
1163 $hour_diff = ($now - $date_last_msg_sent) / 3600 ;
1165 if (
getDolGlobalString(
'TICKET_DELAY_BEFORE_FIRST_RESPONSE') && $date_last_msg_sent == 0) {
1166 $creation_date = $object->datec;
1167 $hour_diff_creation = ($now - $creation_date) / 3600 ;
1168 if ($hour_diff_creation >
getDolGlobalString(
'TICKET_DELAY_BEFORE_FIRST_RESPONSE')) {
1169 print
" " .
img_picto($langs->trans(
'Late') .
' : ' . $langs->trans(
'TicketsDelayForFirstResponseTooLong',
getDolGlobalString(
'TICKET_DELAY_BEFORE_FIRST_RESPONSE')),
'warning',
'style="color: red;"',
false, 0, 0,
'',
'');
1172 print
" " .
img_picto($langs->trans(
'Late') .
' : ' . $langs->trans(
'TicketsDelayFromLastResponseTooLong',
getDolGlobalString(
'TICKET_DELAY_SINCE_LAST_RESPONSE')),
'warning');
1176 $tmp = explode(
':', $val[
'type']);
1177 if ($tmp[0] ==
'integer' && !empty($tmp[1]) && class_exists($tmp[1])) {
1180 if ($key && $obj->$key && $val[
'type'] && array_key_exists($key.
'-'.$obj->$key.
'-'.$val[
'type'], $cacheofoutputfield)) {
1181 $result = $cacheofoutputfield[$key.
'-'.$obj->$key.
'-'.$val[
'type']];
1183 $result = $object->showOutputField($val, $key, $obj->$key,
'');
1184 $cacheofoutputfield[$key.
'-'.$obj->$key.
'-'.$val[
'type']] = $result;
1187 $result = $object->showOutputField($val, $key, $obj->$key,
'');
1194 $totalarray[
'nbfield']++;
1196 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
1198 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
1200 if (!isset($totalarray[
'val'])) {
1201 $totalarray[
'val'] = array();
1203 if (!isset($totalarray[
'val'][
't.'.$key])) {
1204 $totalarray[
'val'][
't.'.$key] = 0;
1206 $totalarray[
'val'][
't.'.$key] += $object->$key;
1211 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1213 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1214 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1215 print $hookmanager->resPrint;
1218 print
'<td class="nowrap center">';
1219 if ($massactionbutton || $massaction) {
1221 if (in_array($object->id, $arrayofselected)) {
1224 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1229 $totalarray[
'nbfield']++;
1239include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1245 foreach ($arrayfields as $key => $val) {
1246 if (!empty($val[
'checked'])) {
1250 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1256$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
1257$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
1258print $hookmanager->resPrint;
1260print
'</table>'.
"\n";
1264print
'</form>'.
"\n";
1268if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
1269 $hidegeneratedfilelistifempty = 1;
1270 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1271 $hidegeneratedfilelistifempty = 0;
1274 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
1278 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1279 $urlsource .= str_replace(
'&',
'&', $param);
1281 $filedir = $diroutputmassaction;
1282 $genallowed = $permissiontoread;
1283 $delallowed = $permissiontoadd;
1285 print $formfile->showdocuments(
'massfilesarea_ticket',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
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)
Return array of tabs to used on pages for third parties cards.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
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_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
dol_eval($s, $returnvalue=0, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
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.
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.
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
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...
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.