29 require
'../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/actions_ticket.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formticket.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
35 include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
36 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
37 include_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
40 $langs->loadLangs(array(
"ticket",
"companies",
"other",
"projects"));
43 $action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
44 $massaction =
GETPOST(
'massaction',
'alpha');
45 $show_files =
GETPOST(
'show_files',
'int');
46 $confirm =
GETPOST(
'confirm',
'alpha');
47 $cancel =
GETPOST(
'cancel',
'alpha');
48 $toselect =
GETPOST(
'toselect',
'array');
49 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'ticketlist';
50 $backtopage =
GETPOST(
'backtopage',
'alpha');
51 $optioncss =
GETPOST(
'optioncss',
'aZ');
54 $msg_id =
GETPOST(
'msg_id',
'int');
55 $socid =
GETPOST(
'socid',
'int');
56 $projectid =
GETPOST(
'projectid',
'int');
57 $project_ref =
GETPOST(
'project_ref',
'alpha');
58 $search_societe =
GETPOST(
'search_societe',
'alpha');
59 $search_fk_project =
GETPOST(
'search_fk_project',
'int') ?
GETPOST(
'search_fk_project',
'int') :
GETPOST(
'projectid',
'int');
60 $search_date_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_startmonth',
'int'),
GETPOST(
'search_date_startday',
'int'),
GETPOST(
'search_date_startyear',
'int'));
61 $search_date_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_endmonth',
'int'),
GETPOST(
'search_date_endday',
'int'),
GETPOST(
'search_date_endyear',
'int'));
62 $search_dateread_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_dateread_startmonth',
'int'),
GETPOST(
'search_dateread_startday',
'int'),
GETPOST(
'search_dateread_startyear',
'int'));
63 $search_dateread_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_dateread_endmonth',
'int'),
GETPOST(
'search_dateread_endday',
'int'),
GETPOST(
'search_dateread_endyear',
'int'));
64 $search_dateclose_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_dateclose_startmonth',
'int'),
GETPOST(
'search_dateclose_startday',
'int'),
GETPOST(
'search_dateclose_startyear',
'int'));
65 $search_dateclose_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_dateclose_endmonth',
'int'),
GETPOST(
'search_dateclose_endday',
'int'),
GETPOST(
'search_dateclose_endyear',
'int'));
68 $mode =
GETPOST(
'mode',
'alpha');
71 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
72 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
73 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
75 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
79 $offset = $limit * $page;
80 $pageprev = $page - 1;
81 $pagenext = $page + 1;
86 $diroutputmassaction = $conf->ticket->dir_output.
'/temp/massgeneration/'.$user->id;
88 $hookmanager->initHooks(array(
'thirdpartyticket'));
89 } elseif ($projectid > 0) {
90 $hookmanager->initHooks(array(
'projectticket'));
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";
106 if (
GETPOST(
'search_fk_status',
'alpha') ==
'non_closed') {
107 $_GET[
'search_fk_statut'][] =
'openall';
113 foreach ($object->fields as $key => $val) {
114 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
115 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
117 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
118 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
119 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
124 $fieldstosearchall = array();
125 foreach ($object->fields as $key => $val) {
126 if (!empty($val[
'searchall'])) {
127 $fieldstosearchall[
't.'.$key] = $val[
'label'];
130 $fieldstosearchall[
's.name_alias'] =
"AliasNameShort";
131 $fieldstosearchall[
's.zip'] =
"Zip";
132 $fieldstosearchall[
's.town'] =
"Town";
135 $arrayfields = array();
136 foreach ($object->fields as $key => $val) {
138 if (!empty($val[
'visible'])) {
139 $visible = (int)
dol_eval($val[
'visible'], 1, 1,
'1');
140 $arrayfields[
't.'.$key] = array(
141 'label'=>$val[
'label'],
142 'checked'=>(($visible < 0) ? 0 : 1),
143 'enabled'=>($visible != 3 &&
dol_eval($val[
'enabled'], 1)),
144 'position'=>$val[
'position'],
145 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
150 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
157 if (!$user->rights->ticket->read) {
161 if ($user->socid > 0) $socid = $user->socid;
164 $url_page_current = DOL_URL_ROOT.
'/ticket/list.php';
167 $tmpproject =
new Project($db);
168 $tmpproject->fetch(0, $project_ref);
169 $projectid = $tmpproject->id;
170 $search_fk_project = $projectid;
173 $permissiontoread = $user->rights->ticket->read;
174 $permissiontoadd = $user->rights->ticket->write;
175 $permissiontodelete = $user->rights->ticket->delete;
184 if (
GETPOST(
'cancel',
'alpha')) {
188 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend' && $massaction !=
'presendonclose' && $massaction !=
'close') {
192 $parameters = array();
194 $parameters[
'socid'] = $socid;
196 if ($projectid > 0) {
197 $parameters[
'projectid'] = $projectid;
199 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
204 if (empty($reshook)) {
206 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
209 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
210 foreach ($object->fields as $key => $val) {
212 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
213 $search[$key.
'_dtstart'] =
'';
214 $search[$key.
'_dtend'] =
'';
218 $search_array_options = array();
219 $search_date_start =
'';
220 $search_date_end =
'';
221 $search_dateread_start =
'';
222 $search_dateread_end =
'';
223 $search_dateclose_start =
'';
224 $search_dateclose_end =
'';
226 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
227 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
232 $objectclass =
'Ticket';
233 $objectlabel =
'Ticket';
234 $uploaddir = $conf->ticket->dir_output;
235 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
238 if (!$error && $massaction ==
'close' && $permissiontoadd) {
239 $objecttmp =
new $objectclass($db);
244 foreach ($toselect as $toselectid) {
245 $result = $objecttmp->fetch($toselectid);
247 $result = $objecttmp->close($user);
277 if (!$error && $massaction ==
'reopen' && $permissiontoadd) {
278 $objecttmp =
new $objectclass($db);
283 foreach ($toselect as $toselectid) {
284 $result = $objecttmp->fetch($toselectid);
286 if ($objecttmp->status == Ticket::STATUS_CLOSED || $objecttmp->status == Ticket::STATUS_CANCELED) {
287 $result = $objecttmp->setStatut(Ticket::STATUS_ASSIGNED);
296 $langs->load(
"errors");
297 setEventMessages($langs->trans(
"ErrorObjectMustHaveStatusClosedToBeReOpened", $objecttmp->ref),
null,
'errors');
332 $user_temp =
new User($db);
336 $title = $langs->trans(
'Tickets');
344 $sql .= $object->getFieldList(
't');
346 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
347 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
348 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
352 $parameters = array();
353 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
354 $sql .= preg_replace(
'/^,/',
'', $hookmanager->resPrint);
355 $sql = preg_replace(
'/,\s*$/',
'', $sql);
359 $sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
360 if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
361 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
364 $parameters = array();
365 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
366 $sql .= $hookmanager->resPrint;
367 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON (t.fk_soc = s.rowid)";
368 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
370 $sql .=
" AND t.fk_soc = ".((int) $socid);
373 foreach ($search as $key => $val) {
374 if ($key ==
'fk_statut' && !empty($search[
'fk_statut'])) {
375 $newarrayofstatus = array();
376 foreach ($search[
'fk_statut'] as $key2 => $val2) {
377 if (in_array($val2, array(
'openall',
'closeall'))) {
380 $newarrayofstatus[] = $val2;
382 if ($search[
'fk_statut'] ==
'openall' || in_array(
'openall', $search[
'fk_statut'])) {
384 $newarrayofstatus[] = Ticket::STATUS_READ;
385 $newarrayofstatus[] = Ticket::STATUS_ASSIGNED;
386 $newarrayofstatus[] = Ticket::STATUS_IN_PROGRESS;
387 $newarrayofstatus[] = Ticket::STATUS_NEED_MORE_INFO;
388 $newarrayofstatus[] = Ticket::STATUS_WAITING;
390 if ($search[
'fk_statut'] ==
'closeall' || in_array(
'closeall', $search[
'fk_statut'])) {
391 $newarrayofstatus[] = Ticket::STATUS_CLOSED;
392 $newarrayofstatus[] = Ticket::STATUS_CANCELED;
394 if (count($newarrayofstatus)) {
398 } elseif ($key ==
'fk_user_assign' || $key ==
'fk_user_create' || $key ==
'fk_project') {
399 if ($search[$key] > 0) {
403 } elseif ($key ==
'type_code') {
404 $newarrayoftypecodes = is_array($search[$key]) ? $search[$key] : (!empty($search[$key]) ? explode(
',', $search[$key]) : array());
405 if (count($newarrayoftypecodes)) {
411 $mode_search = ((!empty($object->fields[$key]) && ($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))) ? 1 : 0);
413 if ((is_array($search[$key]) && !empty($search[$key])) || (!is_array($search[$key]) && $search[$key] !=
'')) {
418 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
420 if ($search_societe) {
423 if ($search_fk_project > 0) {
426 if ($search_date_start) {
427 $sql .=
" AND t.datec >= '".$db->idate($search_date_start).
"'";
429 if ($search_date_end) {
430 $sql .=
" AND t.datec <= '".$db->idate($search_date_end).
"'";
432 if ($search_dateread_start) {
433 $sql .=
" AND t.date_read >= '".$db->idate($search_dateread_start).
"'";
435 if ($search_dateread_end) {
436 $sql .=
" AND t.date_read <= '".$db->idate($search_dateread_end).
"'";
438 if ($search_dateclose_start) {
439 $sql .=
" AND t.date_close >= '".$db->idate($search_dateclose_start).
"'";
441 if ($search_dateclose_end) {
442 $sql .=
" AND t.date_close <= '".$db->idate($search_dateclose_end).
"'";
445 if (!$user->socid && ($mode ==
"mine" || (!$user->admin && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY))) {
446 $sql .=
" AND (t.fk_user_assign = ".((int) $user->id);
447 if (empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) {
448 $sql .=
" OR t.fk_user_create = ".((int) $user->id);
454 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
456 $parameters = array();
457 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
458 $sql .= $hookmanager->resPrint;
462 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
464 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
465 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
466 $resql = $db->query($sqlforcount);
468 $objforcount = $db->fetch_object(
$resql);
482 $sql .= $db->order($sortfield, $sortorder);
484 $sql .= $db->plimit($limit + 1, $offset);
487 $resql = $db->query($sql);
493 $num = $db->num_rows(
$resql);
496 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
497 $obj = $db->fetch_object(
$resql);
499 header(
"Location: ".DOL_URL_ROOT.
'/ticket/card.php?id='.$id);
509 if ($socid && !$projectid && !$project_ref && $user->hasRight(
'societe',
'lire')) {
511 $res = $socstat->fetch($socid);
513 $tmpobject = $object;
516 $object = $tmpobject;
518 print
dol_get_fiche_head($head,
'ticket', $langs->trans(
"ThirdParty"), -1,
'company');
520 dol_banner_tab($socstat,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom');
522 print
'<div class="fichecenter">';
524 print
'<div class="underbanner clearboth"></div>';
525 print
'<table class="border centpercent tableforfield">';
528 print
'<tr><td class="titlefield">'.$langs->trans(
'NatureOfThirdParty').
'</td><td>';
529 print $socstat->getTypeUrl(1);
533 if ($socstat->client && !empty($socstat->code_client)) {
534 print
'<tr><td class="titlefield">';
535 print $langs->trans(
'CustomerCode').
'</td><td>';
537 $tmpcheck = $socstat->check_codeclient();
538 if ($tmpcheck != 0 && $tmpcheck != -5) {
539 print
' <span class="error">('.$langs->trans(
"WrongCustomerCode").
')</span>';
545 if ($socstat->fournisseur && !empty($socstat->code_fournisseur)) {
546 print
'<tr><td class="titlefield">';
547 print $langs->trans(
'SupplierCode').
'</td><td>';
549 $tmpcheck = $socstat->check_codefournisseur();
550 if ($tmpcheck != 0 && $tmpcheck != -5) {
551 print
' <span class="error">('.$langs->trans(
"WrongSupplierCode").
')</span>';
563 if ($projectid > 0 || $project_ref) {
564 $projectstat =
new Project($db);
565 if ($projectstat->fetch($projectid, $project_ref) > 0) {
566 $projectid = $projectstat->id;
567 $projectstat->fetch_thirdparty();
569 $savobject = $object;
570 $object = $projectstat;
574 $userWrite = $projectstat->restrictedProjectArea($user,
'write');
579 print
dol_get_fiche_head($head,
'ticket', $langs->trans(
"Project"), -1, ($projectstat->public ?
'projectpub' :
'project'));
583 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
585 $morehtmlref =
'<div class="refidno">';
587 $morehtmlref .= $object->title;
589 if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
590 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'project');
592 $morehtmlref .=
'</div>';
595 if (empty($user->rights->projet->all->lire)) {
596 $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
597 $object->next_prev_filter =
" rowid IN (".$db->sanitize(count($objectsListId) ? join(
',', array_keys($objectsListId)) :
'0').
")";
600 dol_banner_tab($object,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
602 print
'<div class="fichecenter">';
603 print
'<div class="underbanner clearboth"></div>';
605 print
'<table class="border tableforfield centpercent">';
608 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
609 if ($projectstat->public) {
610 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
611 print $langs->trans(
'SharedProject');
613 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
614 print $langs->trans(
'PrivateProject');
623 $object = $savobject;
625 print
"ErrorRecordNotFound";
629 $arrayofselected = is_array($toselect) ? $toselect : array();
632 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
633 $param .=
'&contextpage='.urlencode($contextpage);
635 if ($limit > 0 && $limit != $conf->liste_limit) {
636 $param .=
'&limit='.urlencode($limit);
638 foreach ($search as $key => $val) {
639 if (is_array($search[$key])) {
640 foreach ($search[$key] as $skey) {
642 $param .= (!empty($val)) ?
'&search_'.$key.
'[]='.urlencode($skey) :
"";
645 } elseif ($search[$key] !=
'') {
646 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
649 if ($optioncss !=
'') {
650 $param .=
'&optioncss='.urlencode($optioncss);
653 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
655 $parameters = array();
656 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
657 $param .= $hookmanager->resPrint;
659 $param .=
'&socid='.urlencode($socid);
661 if ($search_societe) {
662 $param .=
'&search_societe='.urlencode($search_societe);
664 if ($projectid > 0) {
665 $param .=
'&projectid='.urlencode($projectid);
667 if ($search_date_start) {
669 $param .=
'&search_date_startday='.urlencode($tmparray[
'mday']);
670 $param .=
'&search_date_startmonth='.urlencode($tmparray[
'mon']);
671 $param .=
'&search_date_startyear='.urlencode($tmparray[
'year']);
673 if ($search_date_end) {
675 $param .=
'&search_date_endday='.urlencode($tmparray[
'mday']);
676 $param .=
'&search_date_endmonth='.urlencode($tmparray[
'mon']);
677 $param .=
'&search_date_endyear='.urlencode($tmparray[
'year']);
679 if ($search_dateread_start) {
681 $param .=
'&search_dateread_startday='.urlencode($tmparray[
'mday']);
682 $param .=
'&search_dateread_startmonth='.urlencode($tmparray[
'mon']);
683 $param .=
'&search_dateread_startyear='.urlencode($tmparray[
'year']);
685 if ($search_dateread_end) {
687 $param .=
'&search_dateread_endday='.urlencode($tmparray[
'mday']);
688 $param .=
'&search_dateread_endmonth='.urlencode($tmparray[
'mon']);
689 $param .=
'&search_dateread_endyear='.urlencode($tmparray[
'year']);
691 if ($search_dateclose_start) {
693 $param .=
'&search_dateclose_startday='.urlencode($tmparray[
'mday']);
694 $param .=
'&search_dateclose_startmonth='.urlencode($tmparray[
'mon']);
695 $param .=
'&search_dateclose_startyear='.urlencode($tmparray[
'year']);
697 if ($search_dateclose_end) {
699 $param .=
'&search_date_endday='.urlencode($tmparray[
'mday']);
700 $param .=
'&search_date_endmonth='.urlencode($tmparray[
'mon']);
701 $param .=
'&search_date_endyear='.urlencode($tmparray[
'year']);
704 $arrayofmassactions = array(
708 if ($permissiontoadd) {
709 $arrayofmassactions[
'presendonclose'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Close");
710 $arrayofmassactions[
'reopen'] =
img_picto(
'',
'folder-open',
'class="pictofixedwidth"').$langs->trans(
"ReOpen");
712 if ($permissiontodelete) {
713 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
715 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
716 $arrayofmassactions = array();
718 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
720 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
721 if ($optioncss !=
'') {
722 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
724 print
'<input type="hidden" name="token" value="'.newToken().
'">';
725 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
726 print
'<input type="hidden" name="action" value="list">';
727 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
728 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
729 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
730 print
'<input type="hidden" name="mode" value="'.$mode.
'" >';
733 print
'<input type="hidden" name="socid" value="'.$socid.
'" >';
736 print
'<input type="hidden" name="projectid" value="'.$projectid.
'" >';
739 $url = DOL_URL_ROOT.
'/ticket/card.php?action=create'.($socid ?
'&socid='.$socid :
'').($projectid ?
'&origin=projet_project&originid='.$projectid :
'');
740 if (!empty($socid)) {
741 $url .=
'&socid='.$socid;
743 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewTicket'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->ticket->write);
750 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords, $picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
752 if ($mode ==
'mine') {
753 print
'<div class="opacitymedium">'.$langs->trans(
'TicketAssignedToMeInfos').
'</div><br>';
756 $topicmail =
"SendTicketRef";
757 $modelmail =
"ticket";
758 $objecttmp =
new Ticket($db);
759 $trackid =
'tic'.$object->id;
760 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
763 if ($massaction ==
'presendonclose') {
764 $hidden_form = array([
766 "name" =>
"massaction",
769 $selectedchoice = (!empty($conf->global->TICKET_NOTIFY_AT_CLOSING)) ?
"yes" :
"no";
770 print
$form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassTicketClosingSendEmail"), $langs->trans(
"ConfirmMassTicketClosingSendEmailQuestion"),
'confirm_send_close', $hidden_form, $selectedchoice, 0, 200, 500, 1);
775 foreach ($fieldstosearchall as $key => $val) {
776 $fieldstosearchall[$key] = $langs->trans($val);
777 $setupstring .= $key.
"=".$val.
";";
779 print
'<!-- Search done like if PRODUCT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
780 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>'.
"\n";
788 $parameters = array();
789 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
790 if (empty($reshook)) {
791 $moreforfilter .= $hookmanager->resPrint;
793 $moreforfilter = $hookmanager->resPrint;
796 if (!empty($moreforfilter)) {
797 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
798 print $moreforfilter;
802 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
803 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
804 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
806 print
'<div class="div-table-responsive">';
807 print
'<div class="div-table-responsive-inside">';
808 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
813 print
'<tr class="liste_titre">';
816 print
'<td class="liste_titre maxwidthsearch">';
817 $searchpicto =
$form->showFilterButtons(
'left');
821 foreach ($object->fields as $key => $val) {
822 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
823 if ($key ==
'fk_statut') {
824 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
825 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
826 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
827 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
828 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
829 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
830 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
832 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
833 if ($key ==
'progress') {
834 print
'<td class="liste_titre right'.($cssforfield ?
' '.$cssforfield :
'').
'">';
835 print
'<input type="text" class="flat maxwidth50" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
837 } elseif ($key ==
'type_code') {
838 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
839 $formTicket->selectTypesTickets(
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'), 1);
841 } elseif ($key ==
'category_code') {
842 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
843 $formTicket->selectGroupTickets(
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'));
845 } elseif ($key ==
'severity_code') {
846 print
'<td class="liste_titre center'.($cssforfield ?
' '.$cssforfield :
'').
'">';
847 $formTicket->selectSeveritiesTickets(
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'));
849 } elseif ($key ==
'fk_user_assign' || $key ==
'fk_user_create') {
850 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
851 print
$form->select_dolusers((empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key, 1,
null, 0,
'',
'',
'0', 0, 0,
'', 0,
'', (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth100'));
853 } elseif ($key ==
'fk_statut') {
854 $arrayofstatus = array();
855 $arrayofstatus[
'openall'] =
'-- '.$langs->trans(
'OpenAll').
' --';
856 foreach ($object->statuts_short as $key2 => $val2) {
857 if ($key2 == Ticket::STATUS_CLOSED) {
858 $arrayofstatus[
'closeall'] =
'-- '.$langs->trans(
'ClosedAll').
' --';
860 $arrayofstatus[$key2] = $val2;
862 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
866 $selectedarray =
null;
867 if (!empty($search[$key])) {
868 $selectedarray = array_values($search[$key]);
870 print
Form::multiselectarray(
'search_fk_statut', $arrayofstatus, $selectedarray, 0, 0,
'minwidth100imp maxwidth150', 1, 0,
'',
'',
'');
872 } elseif ($key ==
"fk_soc") {
873 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'"><input type="text" class="flat maxwidth75" name="search_societe" value="'.
dol_escape_htmltag($search_societe).
'"></td>';
874 } elseif ($key ==
"datec" || $key ==
'date_read' || $key ==
'date_close') {
875 print
'<td class="liste_titre center">';
876 print
'<div class="nowrap">';
879 print
$form->selectDate($search_date_start ?: -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
882 print
$form->selectDate($search_dateread_start ?: -1,
'search_dateread_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
885 print
$form->selectDate($search_dateclose_start ?: -1,
'search_dateclose_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
888 print
'<div class="nowrap">';
891 print
$form->selectDate($search_date_end ?: -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
894 print
$form->selectDate($search_dateread_end ?: -1,
'search_dateread_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
897 print
$form->selectDate($search_dateclose_end ?: -1,
'search_dateclose_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
902 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
903 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
904 print
$form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], $search[$key], $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
905 } elseif (strpos($val[
'type'],
'integer:') === 0) {
906 print $object->showInputField($val, $key, $search[$key],
'',
'',
'search_',
'maxwidth150', 1);
907 } elseif (!preg_match(
'/^(date|timestamp)/', $val[
'type'])) {
908 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
915 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
918 $parameters = array(
'arrayfields'=>$arrayfields);
919 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
920 print $hookmanager->resPrint;
923 print
'<td class="liste_titre maxwidthsearch">';
924 $searchpicto =
$form->showFilterButtons();
933 print
'<tr class="liste_titre">';
935 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
937 foreach ($object->fields as $key => $val) {
938 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
939 if ($key ==
'fk_statut' || $key ==
'severity_code') {
940 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
941 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
942 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
943 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
944 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
945 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
946 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
948 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
949 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
956 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
959 'arrayfields' => $arrayfields,
961 'sortfield' => $sortfield,
962 'sortorder' => $sortorder,
963 'totalarray' => &$totalarray,
965 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
966 print $hookmanager->resPrint;
968 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
974 $needToFetchEachLine = 0;
975 if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
976 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
977 if (preg_match(
'/\$object/', $val)) {
978 $needToFetchEachLine++;
987 $totalarray = array();
988 $totalarray[
'nbfield'] = 0;
991 $cacheofoutputfield = array();
992 while ($i < ($limit ? min($num, $limit) : $num)) {
993 $obj = $db->fetch_object(
$resql);
999 $object->setVarsFromFetchObj($obj);
1000 $object->status = $object->fk_statut;
1003 print
'<tr class="oddeven">';
1006 print
'<td class="nowrap center">';
1007 if ($massactionbutton || $massaction) {
1009 if (in_array($obj->rowid, $arrayofselected)) {
1012 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1016 foreach ($object->fields as $key => $val) {
1017 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
1018 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
1019 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
1021 if (in_array($val[
'type'], array(
'timestamp'))) {
1022 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
1024 if (in_array($key, array(
'ref',
'fk_project'))) {
1025 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
1027 if ($key ==
'fk_statut' || $key ==
'severity_code') {
1028 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
1030 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
1032 if ($cssforfield || (array_key_exists(
'css', $val) && $val[
'css'])) {
1036 if ($cssforfield && array_key_exists(
'css', $val) && $val[
'css']) {
1039 if (array_key_exists(
'css', $val)) {
1042 if ($cssforfield || (array_key_exists(
'css', $val) && $val[
'css'])) {
1046 if ($key ==
'fk_statut') {
1047 print $object->getLibStatut(5);
1048 } elseif ($key ==
'subject') {
1050 print
'<span title="'.dol_escape_htmltag($s).
'">';
1053 } elseif ($key ==
'type_code') {
1054 $s = $langs->getLabelFromKey($db,
'TicketTypeShort'.$object->type_code,
'c_ticket_type',
'code',
'label', $object->type_code);
1055 print
'<span title="'.dol_escape_htmltag($s).
'">';
1058 } elseif ($key ==
'category_code') {
1059 $s = $langs->getLabelFromKey($db,
'TicketCategoryShort'.$object->category_code,
'c_ticket_category',
'code',
'label', $object->category_code);
1060 print
'<span title="'.dol_escape_htmltag($s).
'">';
1063 } elseif ($key ==
'severity_code') {
1064 $s = $langs->getLabelFromKey($db,
'TicketSeverityShort'.$object->severity_code,
'c_ticket_severity',
'code',
'label', $object->severity_code);
1065 print
'<span title="'.dol_escape_htmltag($s).
'">';
1068 } elseif ($key ==
'tms') {
1069 print
dol_print_date($db->jdate($obj->$key),
'dayhour',
'tzuser');
1070 } elseif ($key ==
'fk_user_create') {
1071 if ($object->fk_user_create > 0) {
1072 if (isset($conf->cache[
'user'][$object->fk_user_create])) {
1073 $user_temp = $conf->cache[
'user'][$object->fk_user_create];
1075 $user_temp =
new User($db);
1076 $user_temp->fetch($object->fk_user_create);
1077 $conf->cache[
'user'][$object->fk_user_create] = $user_temp;
1079 print $user_temp->getNomUrl(-1);
1081 } elseif ($key ==
'fk_user_assign') {
1082 if ($object->fk_user_assign > 0) {
1083 if (isset($conf->cache[
'user'][$object->fk_user_assign])) {
1084 $user_temp = $conf->cache[
'user'][$object->fk_user_assign];
1086 $user_temp =
new User($db);
1087 $user_temp->fetch($object->fk_user_assign);
1088 $conf->cache[
'user'][$object->fk_user_assign] = $user_temp;
1090 print $user_temp->getNomUrl(-1);
1092 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
1093 print $object->showOutputField($val, $key, $db->jdate($obj->$key),
'');
1094 } elseif ($key ==
'ref') {
1095 print $object->showOutputField($val, $key, $obj->$key,
'');
1098 $is_open = ($object->status != Ticket::STATUS_CLOSED && $object->status != Ticket::STATUS_CANCELED );
1099 $should_show_warning = (!empty($conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE) || !empty($conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE));
1100 if ($is_open && $should_show_warning) {
1101 $date_last_msg_sent = (int) $object->date_last_msg_sent;
1102 $hour_diff = ($now - $date_last_msg_sent) / 3600 ;
1104 if (!empty($conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE && $date_last_msg_sent == 0)) {
1105 $creation_date = $object->datec;
1106 $hour_diff_creation = ($now - $creation_date) / 3600 ;
1107 if ($hour_diff_creation > $conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE) {
1108 print
" " .
img_picto($langs->trans(
'Late') .
' : ' . $langs->trans(
'TicketsDelayForFirstResponseTooLong', $conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE),
'warning',
'style="color: red;"',
false, 0, 0,
'',
'');
1110 } elseif (!empty($conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE) && $hour_diff > $conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE) {
1111 print
" " .
img_picto($langs->trans(
'Late') .
' : ' . $langs->trans(
'TicketsDelayFromLastResponseTooLong', $conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE),
'warning');
1115 $tmp = explode(
':', $val[
'type']);
1116 if ($tmp[0] ==
'integer' && !empty($tmp[1]) && class_exists($tmp[1])) {
1119 if ($key && $obj->$key && $val[
'type'] && array_key_exists($key.
'-'.$obj->$key.
'-'.$val[
'type'], $cacheofoutputfield)) {
1120 $result = $cacheofoutputfield[$key.
'-'.$obj->$key.
'-'.$val[
'type']];
1122 $result = $object->showOutputField($val, $key, $obj->$key,
'');
1123 $cacheofoutputfield[$key.
'-'.$obj->$key.
'-'.$val[
'type']] = $result;
1126 $result = $object->showOutputField($val, $key, $obj->$key,
'');
1133 $totalarray[
'nbfield']++;
1135 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
1137 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
1139 if (!isset($totalarray[
'val'])) {
1140 $totalarray[
'val'] = array();
1142 if (!isset($totalarray[
'val'][
't.'.$key])) {
1143 $totalarray[
'val'][
't.'.$key] = 0;
1145 $totalarray[
'val'][
't.'.$key] += $object->$key;
1150 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1152 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1153 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
1154 print $hookmanager->resPrint;
1157 print
'<td class="nowrap center">';
1158 if ($massactionbutton || $massaction) {
1160 if (in_array($obj->rowid, $arrayofselected)) {
1163 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1168 $totalarray[
'nbfield']++;
1177 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1183 foreach ($arrayfields as $key => $val) {
1184 if (!empty($val[
'checked'])) {
1188 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1194 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
1195 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
1196 print $hookmanager->resPrint;
1198 print
'</table>'.
"\n";
1199 print
'</div>'.
"\n";
1200 print
'</div>'.
"\n";
1202 print
'</form>'.
"\n";
1207 $hidegeneratedfilelistifempty = 1;
1208 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1209 $hidegeneratedfilelistifempty = 0;
1212 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
1216 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1217 $urlsource .= str_replace(
'&',
'&', $param);
1219 $filedir = $diroutputmassaction;
1220 $genallowed = $permissiontoread;
1221 $delallowed = $permissiontoadd;
1223 print $formfile->showdocuments(
'massfilesarea_ticket',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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...
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
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.
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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
Class to generate the form for creating a new ticket.
$nbtotalofrecords
Count total nb of records.
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.