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"));
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$projectid =
GETPOST(
'projectid',
'int');
59$project_ref =
GETPOST(
'project_ref',
'alpha');
60$search_societe =
GETPOST(
'search_societe',
'alpha');
61$search_fk_project =
GETPOST(
'search_fk_project',
'int') ?
GETPOST(
'search_fk_project',
'int') :
GETPOST(
'projectid',
'int');
62$search_date_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_startmonth',
'int'),
GETPOST(
'search_date_startday',
'int'),
GETPOST(
'search_date_startyear',
'int'));
63$search_date_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_endmonth',
'int'),
GETPOST(
'search_date_endday',
'int'),
GETPOST(
'search_date_endyear',
'int'));
64$search_dateread_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_dateread_startmonth',
'int'),
GETPOST(
'search_dateread_startday',
'int'),
GETPOST(
'search_dateread_startyear',
'int'));
65$search_dateread_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_dateread_endmonth',
'int'),
GETPOST(
'search_dateread_endday',
'int'),
GETPOST(
'search_dateread_endyear',
'int'));
66$search_dateclose_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_dateclose_startmonth',
'int'),
GETPOST(
'search_dateclose_startday',
'int'),
GETPOST(
'search_dateclose_startyear',
'int'));
67$search_dateclose_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_dateclose_endmonth',
'int'),
GETPOST(
'search_dateclose_endday',
'int'),
GETPOST(
'search_dateclose_endyear',
'int'));
71$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
72$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
73$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
74$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
75if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
79$offset = $limit * $page;
86$diroutputmassaction = $conf->ticket->dir_output.
'/temp/massgeneration/'.$user->id;
88 $hookmanager->initHooks(array(
'thirdpartyticket',
'globalcard'));
89} elseif ($projectid > 0) {
90 $hookmanager->initHooks(array(
'projectticket',
'globalcard'));
92 $hookmanager->initHooks(array(
'ticketlist'));
95$extrafields->fetch_name_optionals_label($object->table_element);
96$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
100 $sortfield =
"t.datec";
106if (
GETPOST(
'search_fk_status',
'alpha') ==
'non_closed') {
107 $_GET[
'search_fk_statut'][] =
'openall';
111$search_all = (GETPOSTISSET(
"search_all") ?
GETPOST(
"search_all",
'alpha') :
GETPOST(
'sall'));
113foreach ($object->fields as $key => $val) {
114 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
115 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
119 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
120 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
121 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
126$fieldstosearchall = array();
127foreach ($object->fields as $key => $val) {
128 if (!empty($val[
'searchall'])) {
129 $fieldstosearchall[
't.'.$key] = $val[
'label'];
132$fieldstosearchall[
's.name_alias'] =
"AliasNameShort";
133$fieldstosearchall[
's.zip'] =
"Zip";
134$fieldstosearchall[
's.town'] =
"Town";
137$arrayfields = array();
138foreach ($object->fields as $key => $val) {
140 if (!empty($val[
'visible'])) {
141 $visible = (int)
dol_eval($val[
'visible'], 1);
142 $arrayfields[
't.'.$key] = array(
143 'label'=>$val[
'label'],
144 'checked'=>(($visible < 0) ? 0 : 1),
145 'enabled'=>(abs($visible) != 3 &&
dol_eval($val[
'enabled'], 1)),
146 'position'=>$val[
'position'],
147 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
152include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
159if (!$user->rights->ticket->read) {
163if ($user->socid > 0) $socid = $user->socid;
166$url_page_current = DOL_URL_ROOT.
'/ticket/list.php';
169 $tmpproject =
new Project($db);
170 $tmpproject->fetch(0, $project_ref);
171 $projectid = $tmpproject->id;
172 $search_fk_project = $projectid;
175$permissiontoread = $user->rights->ticket->read;
176$permissiontoadd = $user->rights->ticket->write;
177$permissiontodelete = $user->rights->ticket->delete;
186if (
GETPOST(
'cancel',
'alpha')) {
190if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend' && $massaction !=
'presendonclose' && $massaction !=
'close') {
194$parameters = array();
196 $parameters[
'socid'] = $socid;
199 $parameters[
'projectid'] = $projectid;
201$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
206if (empty($reshook)) {
208 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
211 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
212 foreach ($object->fields as $key => $val) {
214 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
215 $search[$key.
'_dtstart'] =
'';
216 $search[$key.
'_dtend'] =
'';
220 $search_array_options = array();
221 $search_date_start =
'';
222 $search_date_end =
'';
223 $search_dateread_start =
'';
224 $search_dateread_end =
'';
225 $search_dateclose_start =
'';
226 $search_dateclose_end =
'';
228 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
229 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
234 $objectclass =
'Ticket';
235 $objectlabel =
'Ticket';
236 $uploaddir = $conf->ticket->dir_output;
237 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
240 if (!$error && $massaction ==
'close' && $permissiontoadd) {
241 $objecttmp =
new $objectclass($db);
246 foreach ($toselect as $toselectid) {
247 $result = $objecttmp->fetch($toselectid);
249 $result = $objecttmp->close($user);
279 if (!$error && $massaction ==
'reopen' && $permissiontoadd) {
280 $objecttmp =
new $objectclass($db);
285 foreach ($toselect as $toselectid) {
286 $result = $objecttmp->fetch($toselectid);
288 if ($objecttmp->status == Ticket::STATUS_CLOSED || $objecttmp->status == Ticket::STATUS_CANCELED) {
289 $result = $objecttmp->setStatut(Ticket::STATUS_ASSIGNED);
298 $langs->load(
"errors");
299 setEventMessages($langs->trans(
"ErrorObjectMustHaveStatusClosedToBeReOpened", $objecttmp->ref),
null,
'errors');
331$form =
new Form($db);
336$user_temp =
new User($db);
340$title = $langs->trans(
'Tickets');
348$sql .= $object->getFieldList(
't');
350if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
351 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
352 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
356$parameters = array();
357$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
358$sql .= $hookmanager->resPrint;
359$sql = preg_replace(
'/,\s*$/',
'', $sql);
363$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
364if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
365 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
368$parameters = array();
369$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
370$sql .= $hookmanager->resPrint;
371$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON (t.fk_soc = s.rowid)";
372$sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
374 $sql .=
" AND t.fk_soc = ".((int) $socid);
377foreach ($search as $key => $val) {
378 if ($key ==
'fk_statut' && !empty($search[
'fk_statut'])) {
379 $newarrayofstatus = array();
380 foreach ($search[
'fk_statut'] as $key2 => $val2) {
381 if (in_array($val2, array(
'openall',
'closeall'))) {
384 $newarrayofstatus[] = $val2;
386 if ($search[
'fk_statut'] ==
'openall' || in_array(
'openall', $search[
'fk_statut'])) {
388 $newarrayofstatus[] = Ticket::STATUS_READ;
389 $newarrayofstatus[] = Ticket::STATUS_ASSIGNED;
390 $newarrayofstatus[] = Ticket::STATUS_IN_PROGRESS;
391 $newarrayofstatus[] = Ticket::STATUS_NEED_MORE_INFO;
392 $newarrayofstatus[] = Ticket::STATUS_WAITING;
394 if ($search[
'fk_statut'] ==
'closeall' || in_array(
'closeall', $search[
'fk_statut'])) {
395 $newarrayofstatus[] = Ticket::STATUS_CLOSED;
396 $newarrayofstatus[] = Ticket::STATUS_CANCELED;
398 if (count($newarrayofstatus)) {
402 } elseif ($key ==
'fk_user_assign' || $key ==
'fk_user_create' || $key ==
'fk_project') {
403 if ($search[$key] > 0) {
407 } elseif ($key ==
'type_code') {
408 $newarrayoftypecodes = is_array($search[$key]) ? $search[$key] : (!empty($search[$key]) ? explode(
',', $search[$key]) : array());
409 if (count($newarrayoftypecodes)) {
415 $mode_search = ((!empty($object->fields[$key]) && ($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))) ? 1 : 0);
417 if ((is_array($search[$key]) && !empty($search[$key])) || (!is_array($search[$key]) && $search[$key] !=
'')) {
422 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
424if ($search_societe) {
427if ($search_fk_project > 0) {
430if ($search_date_start) {
431 $sql .=
" AND t.datec >= '".$db->idate($search_date_start).
"'";
433if ($search_date_end) {
434 $sql .=
" AND t.datec <= '".$db->idate($search_date_end).
"'";
436if ($search_dateread_start) {
437 $sql .=
" AND t.date_read >= '".$db->idate($search_dateread_start).
"'";
439if ($search_dateread_end) {
440 $sql .=
" AND t.date_read <= '".$db->idate($search_dateread_end).
"'";
442if ($search_dateclose_start) {
443 $sql .=
" AND t.date_close >= '".$db->idate($search_dateclose_start).
"'";
445if ($search_dateclose_end) {
446 $sql .=
" AND t.date_close <= '".$db->idate($search_dateclose_end).
"'";
449if (!$user->socid && ($mode ==
"mine" || (!$user->admin &&
getDolGlobalString(
'TICKET_LIMIT_VIEW_ASSIGNED_ONLY')))) {
450 $sql .=
" AND (t.fk_user_assign = ".((int) $user->id);
452 $sql .=
" OR t.fk_user_create = ".((int) $user->id);
458include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
460$parameters = array();
461$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
462$sql .= $hookmanager->resPrint;
465$nbtotalofrecords =
'';
468 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
469 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
470 $resql = $db->query($sqlforcount);
472 $objforcount = $db->fetch_object($resql);
473 $nbtotalofrecords = $objforcount->nbtotalofrecords;
478 if (($page * $limit) > $nbtotalofrecords) {
486$sql .= $db->order($sortfield, $sortorder);
488 $sql .= $db->plimit($limit + 1, $offset);
491$resql = $db->query($sql);
497$num = $db->num_rows($resql);
500if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
501 $obj = $db->fetch_object($resql);
503 header(
"Location: ".DOL_URL_ROOT.
'/ticket/card.php?id='.$id);
511llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist');
513if ($socid && !$projectid && !$project_ref && $user->hasRight(
'societe',
'lire')) {
515 $res = $socstat->fetch($socid);
517 $tmpobject = $object;
520 $object = $tmpobject;
522 print
dol_get_fiche_head($head,
'ticket', $langs->trans(
"ThirdParty"), -1,
'company');
524 dol_banner_tab($socstat,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom');
526 print
'<div class="fichecenter">';
528 print
'<div class="underbanner clearboth"></div>';
529 print
'<table class="border centpercent tableforfield">';
532 print
'<tr><td class="titlefield">'.$langs->trans(
'NatureOfThirdParty').
'</td><td>';
533 print $socstat->getTypeUrl(1);
537 if ($socstat->client && !empty($socstat->code_client)) {
538 print
'<tr><td class="titlefield">';
539 print $langs->trans(
'CustomerCode').
'</td><td>';
541 $tmpcheck = $socstat->check_codeclient();
542 if ($tmpcheck != 0 && $tmpcheck != -5) {
543 print
' <span class="error">('.$langs->trans(
"WrongCustomerCode").
')</span>';
549 if ($socstat->fournisseur && !empty($socstat->code_fournisseur)) {
550 print
'<tr><td class="titlefield">';
551 print $langs->trans(
'SupplierCode').
'</td><td>';
553 $tmpcheck = $socstat->check_codefournisseur();
554 if ($tmpcheck != 0 && $tmpcheck != -5) {
555 print
' <span class="error">('.$langs->trans(
"WrongSupplierCode").
')</span>';
567if ($projectid > 0 || $project_ref) {
568 $projectstat =
new Project($db);
569 if ($projectstat->fetch($projectid, $project_ref) > 0) {
570 $projectid = $projectstat->id;
571 $projectstat->fetch_thirdparty();
573 $savobject = $object;
574 $object = $projectstat;
578 $userWrite = $projectstat->restrictedProjectArea($user,
'write');
583 print
dol_get_fiche_head($head,
'ticket', $langs->trans(
"Project"), -1, ($projectstat->public ?
'projectpub' :
'project'));
587 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
589 $morehtmlref =
'<div class="refidno">';
591 $morehtmlref .= $object->title;
593 if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
594 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'project');
596 $morehtmlref .=
'</div>';
599 if (empty($user->rights->projet->all->lire)) {
600 $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
601 $object->next_prev_filter =
"rowid IN (".$db->sanitize(count($objectsListId) ? join(
',', array_keys($objectsListId)) :
'0').
")";
604 dol_banner_tab($object,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
606 print
'<div class="fichecenter">';
607 print
'<div class="underbanner clearboth"></div>';
609 print
'<table class="border tableforfield centpercent">';
612 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
613 if ($projectstat->public) {
614 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
615 print $langs->trans(
'SharedProject');
617 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
618 print $langs->trans(
'PrivateProject');
627 $object = $savobject;
629 print
"ErrorRecordNotFound";
633$arrayofselected = is_array($toselect) ? $toselect : array();
637 $param .=
'&mode='.urlencode($mode);
639if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
640 $param .=
'&contextpage='.urlencode($contextpage);
642if ($limit > 0 && $limit != $conf->liste_limit) {
643 $param .=
'&limit='.((int) $limit);
645foreach ($search as $key => $val) {
646 if (is_array($search[$key])) {
647 foreach ($search[$key] as $skey) {
649 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
652 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
653 $param .=
'&search_'.$key.
'month='.((int)
GETPOST(
'search_'.$key.
'month',
'int'));
654 $param .=
'&search_'.$key.
'day='.((int)
GETPOST(
'search_'.$key.
'day',
'int'));
655 $param .=
'&search_'.$key.
'year='.((int)
GETPOST(
'search_'.$key.
'year',
'int'));
656 } elseif ($search[$key] !=
'') {
657 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
660if ($optioncss !=
'') {
661 $param .=
'&optioncss='.urlencode($optioncss);
664include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
666$parameters = array();
667$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
668$param .= $hookmanager->resPrint;
670 $param .=
'&socid='.urlencode($socid);
672if ($search_societe) {
673 $param .=
'&search_societe='.urlencode($search_societe);
676 $param .=
'&projectid='.urlencode($projectid);
678if ($search_date_start) {
680 $param .=
'&search_date_startday='.urlencode($tmparray[
'mday']);
681 $param .=
'&search_date_startmonth='.urlencode($tmparray[
'mon']);
682 $param .=
'&search_date_startyear='.urlencode($tmparray[
'year']);
684if ($search_date_end) {
686 $param .=
'&search_date_endday='.urlencode($tmparray[
'mday']);
687 $param .=
'&search_date_endmonth='.urlencode($tmparray[
'mon']);
688 $param .=
'&search_date_endyear='.urlencode($tmparray[
'year']);
690if ($search_dateread_start) {
692 $param .=
'&search_dateread_startday='.urlencode($tmparray[
'mday']);
693 $param .=
'&search_dateread_startmonth='.urlencode($tmparray[
'mon']);
694 $param .=
'&search_dateread_startyear='.urlencode($tmparray[
'year']);
696if ($search_dateread_end) {
698 $param .=
'&search_dateread_endday='.urlencode($tmparray[
'mday']);
699 $param .=
'&search_dateread_endmonth='.urlencode($tmparray[
'mon']);
700 $param .=
'&search_dateread_endyear='.urlencode($tmparray[
'year']);
702if ($search_dateclose_start) {
704 $param .=
'&search_dateclose_startday='.urlencode($tmparray[
'mday']);
705 $param .=
'&search_dateclose_startmonth='.urlencode($tmparray[
'mon']);
706 $param .=
'&search_dateclose_startyear='.urlencode($tmparray[
'year']);
708if ($search_dateclose_end) {
710 $param .=
'&search_date_endday='.urlencode($tmparray[
'mday']);
711 $param .=
'&search_date_endmonth='.urlencode($tmparray[
'mon']);
712 $param .=
'&search_date_endyear='.urlencode($tmparray[
'year']);
715$arrayofmassactions = array(
719if ($permissiontoadd) {
720 $arrayofmassactions[
'presendonclose'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Close");
721 $arrayofmassactions[
'reopen'] =
img_picto(
'',
'folder-open',
'class="pictofixedwidth"').$langs->trans(
"ReOpen");
723if ($permissiontodelete) {
724 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
726if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
727 $arrayofmassactions = array();
729$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
731print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
732if ($optioncss !=
'') {
733 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
735print
'<input type="hidden" name="token" value="'.newToken().
'">';
736print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
737print
'<input type="hidden" name="action" value="list">';
738print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
739print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
740print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
741print
'<input type="hidden" name="mode" value="'.$mode.
'" >';
744 print
'<input type="hidden" name="socid" value="'.$socid.
'" >';
747 print
'<input type="hidden" name="projectid" value="'.$projectid.
'" >';
750$url = DOL_URL_ROOT.
'/ticket/card.php?action=create'.($socid ?
'&socid='.$socid :
'').($projectid ?
'&origin=projet_project&originid='.$projectid :
'');
752 $url .=
'&socid='.$socid;
755$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'));
756$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'));
757$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewTicket'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->ticket->write);
764print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
766if ($mode ==
'mine') {
767 print
'<div class="opacitymedium">'.$langs->trans(
'TicketAssignedToMeInfos').
'</div><br>';
770$topicmail =
"SendTicketRef";
771$modelmail =
"ticket";
772$objecttmp =
new Ticket($db);
773$trackid =
'tic'.$object->id;
774include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
777if ($massaction ==
'presendonclose') {
778 $hidden_form = array([
780 "name" =>
"massaction",
784 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassTicketClosingSendEmail"), $langs->trans(
"ConfirmMassTicketClosingSendEmailQuestion"),
'confirm_send_close', $hidden_form, $selectedchoice, 0, 200, 500, 1);
789 foreach ($fieldstosearchall as $key => $val) {
790 $fieldstosearchall[$key] = $langs->trans($val);
791 $setupstring .= $key.
"=".$val.
";";
793 print
'<!-- Search done like if TICKET_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
794 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>'.
"\n";
802$parameters = array();
803$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
804if (empty($reshook)) {
805 $moreforfilter .= $hookmanager->resPrint;
807 $moreforfilter = $hookmanager->resPrint;
810if (!empty($moreforfilter)) {
811 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
812 print $moreforfilter;
816$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
817$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
818$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
820print
'<div class="div-table-responsive">';
821print
'<div class="div-table-responsive-inside">';
822print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
827print
'<tr class="liste_titre_filter">';
830 print
'<td class="liste_titre maxwidthsearch center">';
831 $searchpicto = $form->showFilterButtons(
'left');
835foreach ($object->fields as $key => $val) {
836 $searchkey = empty($search[$key]) ?
'' : $search[$key];
837 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
838 if ($key ==
'fk_statut') {
839 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
840 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
841 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
842 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
843 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
844 } 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'])) {
845 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
847 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
848 if ($key ==
'progress') {
849 print
'<td class="liste_titre right'.($cssforfield ?
' '.$cssforfield :
'').
'">';
850 print
'<input type="text" class="flat maxwidth50" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
852 } elseif ($key ==
'type_code') {
853 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
854 $formTicket->selectTypesTickets(empty($search[$key]) ?
'' : $search[$key],
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'), 1);
856 } elseif ($key ==
'category_code') {
857 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
858 $formTicket->selectGroupTickets(
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'));
860 } elseif ($key ==
'severity_code') {
861 print
'<td class="liste_titre center'.($cssforfield ?
' '.$cssforfield :
'').
'">';
862 $formTicket->selectSeveritiesTickets(
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'));
864 } elseif ($key ==
'fk_user_assign' || $key ==
'fk_user_create') {
865 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
866 print $form->select_dolusers((empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key, 1, null, 0,
'',
'',
'0', 0, 0,
'', 0,
'', (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth100'));
868 } elseif ($key ==
'fk_statut') {
869 $arrayofstatus = array();
870 $arrayofstatus[
'openall'] =
'-- '.$langs->trans(
'OpenAll').
' --';
871 foreach ($object->statuts_short as $key2 => $val2) {
872 if ($key2 == Ticket::STATUS_CLOSED) {
873 $arrayofstatus[
'closeall'] =
'-- '.$langs->trans(
'ClosedAll').
' --';
875 $arrayofstatus[$key2] = $val2;
877 print
'<td class="liste_titre center parentonrightofpage'.($cssforfield ?
' '.$cssforfield :
'').
'">';
881 $selectedarray =
null;
882 if (!empty($search[$key])) {
883 $selectedarray = array_values($search[$key]);
885 print
Form::multiselectarray(
'search_fk_statut', $arrayofstatus, $selectedarray, 0, 0,
'search_status width150 onrightofpage', 1, 0,
'',
'',
'');
887 } elseif ($key ==
"fk_soc") {
888 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'"><input type="text" class="flat maxwidth75" name="search_societe" value="'.
dol_escape_htmltag($search_societe).
'"></td>';
889 } elseif ($key ==
"datec" || $key ==
'date_read' || $key ==
'date_close') {
890 print
'<td class="liste_titre center">';
891 print
'<div class="nowrap">';
894 print $form->selectDate($search_date_start ?: -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
897 print $form->selectDate($search_dateread_start ?: -1,
'search_dateread_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
900 print $form->selectDate($search_dateclose_start ?: -1,
'search_dateclose_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
903 print
'<div class="nowrap">';
906 print $form->selectDate($search_date_end ?: -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
909 print $form->selectDate($search_dateread_end ?: -1,
'search_dateread_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
912 print $form->selectDate($search_dateclose_end ?: -1,
'search_dateclose_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
917 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
918 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
919 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], $search[$key], $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
920 } elseif (strpos($val[
'type'],
'integer:') === 0) {
921 print $object->showInputField($val, $key, $search[$key],
'',
'',
'search_',
'maxwidth150', 1);
922 } elseif (!preg_match(
'/^(date|timestamp)/', $val[
'type'])) {
923 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
930include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
933$parameters = array(
'arrayfields'=>$arrayfields);
934$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
935print $hookmanager->resPrint;
938 print
'<td class="liste_titre center maxwidthsearch">';
939 $searchpicto = $form->showFilterButtons();
945$totalarray = array();
946$totalarray[
'nbfield'] = 0;
950print
'<tr class="liste_titre">';
952 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
953 $totalarray[
'nbfield']++;
955foreach ($object->fields as $key => $val) {
956 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
957 if ($key ==
'fk_statut' || $key ==
'severity_code') {
958 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
959 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
960 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
961 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
962 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
963 } 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'])) {
964 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
966 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
967 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
968 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";
969 $totalarray[
'nbfield']++;
973include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
975$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
976$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
977print $hookmanager->resPrint;
979 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
980 $totalarray[
'nbfield']++;
986$needToFetchEachLine = 0;
987if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
988 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
989 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
990 $needToFetchEachLine++;
999$savnbfield = $totalarray[
'nbfield'];
1000$totalarray = array();
1001$totalarray[
'nbfield'] = 0;
1002$imaxinloop = ($limit ? min($num, $limit) : $num);
1003$cacheofoutputfield = array();
1004while ($i < $imaxinloop) {
1005 $obj = $db->fetch_object($resql);
1011 $object->setVarsFromFetchObj($obj);
1012 $object->type_code = $obj->type_code;
1013 $object->status = $object->fk_statut;
1015 if ($mode ==
'kanban') {
1017 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1018 print
'<div class="box-flex-container kanban">';
1023 $arraydata = array();
1024 if ($obj->fk_user_assign > 0) {
1025 $user_temp->fetch($obj->fk_user_assign);
1026 $arraydata[
'user_assignment'] = $user_temp->getNomUrl(-3);
1028 $arraydata[
'selected'] = in_array($object->id, $arrayofselected);
1031 print $object->getKanbanView(
'', $arraydata);
1032 if ($i == ($imaxinloop - 1)) {
1039 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
1042 print
'<td class="nowrap center">';
1043 if ($massactionbutton || $massaction) {
1045 if (in_array($object->id, $arrayofselected)) {
1048 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1052 $totalarray[
'nbfield']++;
1055 foreach ($object->fields as $key => $val) {
1056 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
1057 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
1058 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
1060 if (in_array($val[
'type'], array(
'timestamp'))) {
1061 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
1063 if (in_array($key, array(
'ref',
'fk_project'))) {
1064 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
1066 if ($key ==
'fk_statut' || $key ==
'severity_code') {
1067 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
1069 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
1071 if ($cssforfield || (array_key_exists(
'css', $val) && $val[
'css'])) {
1075 if ($cssforfield && array_key_exists(
'css', $val) && $val[
'css']) {
1078 if (array_key_exists(
'css', $val)) {
1081 if ($cssforfield || (array_key_exists(
'css', $val) && $val[
'css'])) {
1085 if ($key ==
'fk_statut') {
1086 print $object->getLibStatut(5);
1087 } elseif ($key ==
'subject') {
1089 print
'<span title="'.dol_escape_htmltag($s).
'">';
1092 } elseif ($key ==
'type_code') {
1093 $s = $langs->getLabelFromKey($db,
'TicketTypeShort'.$object->type_code,
'c_ticket_type',
'code',
'label', $object->type_code);
1094 print
'<span title="'.dol_escape_htmltag($s).
'">';
1097 } elseif ($key ==
'category_code') {
1098 $s = $langs->getLabelFromKey($db,
'TicketCategoryShort'.$object->category_code,
'c_ticket_category',
'code',
'label', $object->category_code);
1099 print
'<span title="'.dol_escape_htmltag($s).
'">';
1102 } elseif ($key ==
'severity_code') {
1103 $s = $langs->getLabelFromKey($db,
'TicketSeverityShort'.$object->severity_code,
'c_ticket_severity',
'code',
'label', $object->severity_code);
1104 print
'<span title="'.dol_escape_htmltag($s).
'">';
1107 } elseif ($key ==
'tms') {
1108 print
dol_print_date($db->jdate($obj->$key),
'dayhour',
'tzuser');
1109 } elseif ($key ==
'fk_user_create') {
1110 if ($object->fk_user_create > 0) {
1111 if (isset($conf->cache[
'user'][$object->fk_user_create])) {
1112 $user_temp = $conf->cache[
'user'][$object->fk_user_create];
1114 $user_temp =
new User($db);
1115 $user_temp->fetch($object->fk_user_create);
1116 $conf->cache[
'user'][$object->fk_user_create] = $user_temp;
1118 print $user_temp->getNomUrl(-1);
1120 } elseif ($key ==
'fk_user_assign') {
1121 if ($object->fk_user_assign > 0) {
1122 if (isset($conf->cache[
'user'][$object->fk_user_assign])) {
1123 $user_temp = $conf->cache[
'user'][$object->fk_user_assign];
1125 $user_temp =
new User($db);
1126 $user_temp->fetch($object->fk_user_assign);
1127 $conf->cache[
'user'][$object->fk_user_assign] = $user_temp;
1129 print $user_temp->getNomUrl(-1);
1131 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
1132 print $object->showOutputField($val, $key, $db->jdate($obj->$key),
'');
1133 } elseif ($key ==
'ref') {
1134 print $object->showOutputField($val, $key, $obj->$key,
'');
1137 $is_open = ($object->status != Ticket::STATUS_CLOSED && $object->status != Ticket::STATUS_CANCELED );
1139 if ($is_open && $should_show_warning) {
1140 $date_last_msg_sent = (int) $object->date_last_msg_sent;
1141 $hour_diff = ($now - $date_last_msg_sent) / 3600 ;
1143 if (
getDolGlobalString(
'TICKET_DELAY_BEFORE_FIRST_RESPONSE') && $date_last_msg_sent == 0) {
1144 $creation_date = $object->datec;
1145 $hour_diff_creation = ($now - $creation_date) / 3600 ;
1146 if ($hour_diff_creation >
getDolGlobalString(
'TICKET_DELAY_BEFORE_FIRST_RESPONSE')) {
1147 print
" " .
img_picto($langs->trans(
'Late') .
' : ' . $langs->trans(
'TicketsDelayForFirstResponseTooLong',
getDolGlobalString(
'TICKET_DELAY_BEFORE_FIRST_RESPONSE')),
'warning',
'style="color: red;"',
false, 0, 0,
'',
'');
1150 print
" " .
img_picto($langs->trans(
'Late') .
' : ' . $langs->trans(
'TicketsDelayFromLastResponseTooLong',
getDolGlobalString(
'TICKET_DELAY_SINCE_LAST_RESPONSE')),
'warning');
1154 $tmp = explode(
':', $val[
'type']);
1155 if ($tmp[0] ==
'integer' && !empty($tmp[1]) && class_exists($tmp[1])) {
1158 if ($key && $obj->$key && $val[
'type'] && array_key_exists($key.
'-'.$obj->$key.
'-'.$val[
'type'], $cacheofoutputfield)) {
1159 $result = $cacheofoutputfield[$key.
'-'.$obj->$key.
'-'.$val[
'type']];
1161 $result = $object->showOutputField($val, $key, $obj->$key,
'');
1162 $cacheofoutputfield[$key.
'-'.$obj->$key.
'-'.$val[
'type']] = $result;
1165 $result = $object->showOutputField($val, $key, $obj->$key,
'');
1172 $totalarray[
'nbfield']++;
1174 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
1176 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
1178 if (!isset($totalarray[
'val'])) {
1179 $totalarray[
'val'] = array();
1181 if (!isset($totalarray[
'val'][
't.'.$key])) {
1182 $totalarray[
'val'][
't.'.$key] = 0;
1184 $totalarray[
'val'][
't.'.$key] += $object->$key;
1189 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1191 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1192 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1193 print $hookmanager->resPrint;
1196 print
'<td class="nowrap center">';
1197 if ($massactionbutton || $massaction) {
1199 if (in_array($object->id, $arrayofselected)) {
1202 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1207 $totalarray[
'nbfield']++;
1217include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1223 foreach ($arrayfields as $key => $val) {
1224 if (!empty($val[
'checked'])) {
1228 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1234$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
1235$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
1236print $hookmanager->resPrint;
1238print
'</table>'.
"\n";
1242print
'</form>'.
"\n";
1246if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
1247 $hidegeneratedfilelistifempty = 1;
1248 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1249 $hidegeneratedfilelistifempty = 0;
1252 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
1256 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1257 $urlsource .= str_replace(
'&',
'&', $param);
1259 $filedir = $diroutputmassaction;
1260 $genallowed = $permissiontoread;
1261 $delallowed = $permissiontoadd;
1263 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 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.
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.