33require
'../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/ticket/class/actions_ticket.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formticket.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
39include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
40include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
41include_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
52$langs->loadLangs(array(
"ticket",
"companies",
"other",
"projects",
"contracts"));
55$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
56$massaction =
GETPOST(
'massaction',
'alpha');
58$confirm =
GETPOST(
'confirm',
'alpha');
59$cancel =
GETPOST(
'cancel',
'alpha');
60$toselect =
GETPOST(
'toselect',
'array');
61$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'ticketlist';
62$backtopage =
GETPOST(
'backtopage',
'alpha');
63$optioncss =
GETPOST(
'optioncss',
'aZ');
64$mode =
GETPOST(
'mode',
'alpha');
71$project_ref =
GETPOST(
'project_ref',
'alpha');
72$search_societe =
GETPOST(
'search_societe',
'alpha');
86$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
87$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
89if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
93$offset = $limit * $page;
100$diroutputmassaction =
$conf->ticket->dir_output.
'/temp/massgeneration/'.$user->id;
102 $hookmanager->initHooks(array(
'thirdpartyticket',
'globalcard'));
103} elseif ($projectid > 0) {
104 $hookmanager->initHooks(array(
'projectticket',
'globalcard'));
106 $hookmanager->initHooks(array(
'ticketlist'));
109$extrafields->fetch_name_optionals_label(
$object->table_element);
110$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
114 $sortfield =
"t.datec";
125$search_all = trim(
GETPOST(
"search_all",
'alphanohtml'));
127foreach (
$object->fields as $key => $val) {
128 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
129 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
133 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
140$fieldstosearchall = array();
141foreach (
$object->fields as $key => $val) {
142 if (!empty($val[
'searchall'])) {
143 $fieldstosearchall[
't.'.$key] = $val[
'label'];
146$fieldstosearchall[
's.name_alias'] =
"AliasNameShort";
147$fieldstosearchall[
's.zip'] =
"Zip";
148$fieldstosearchall[
's.town'] =
"Town";
151$arrayfields = array();
152foreach (
$object->fields as $key => $val) {
154 if (!empty($val[
'visible'])) {
155 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
156 $arrayfields[
't.'.$key] = array(
157 'label' => $val[
'label'],
158 'checked' => (($visible < 0) ? 0 : 1),
159 'enabled' => (abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
160 'position' => $val[
'position'],
161 'help' => isset($val[
'help']) ? $val[
'help'] :
''
166include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
173if (!$user->hasRight(
'ticket',
'read')) {
177if ($user->socid > 0) {
178 $socid = $user->socid;
182$url_page_current = DOL_URL_ROOT.
'/ticket/list.php';
185 $tmpproject =
new Project($db);
186 $tmpproject->fetch(0, $project_ref);
187 $projectid = $tmpproject->id;
188 $search_fk_project = $projectid;
191$permissiontoread = $user->hasRight(
'ticket',
'read');
192$permissiontoadd = $user->hasRight(
'ticket',
'write');
193$permissiontodelete = $user->hasRight(
'ticket',
'delete');
202if (
GETPOST(
'cancel',
'alpha')) {
206if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend' && $massaction !=
'presendonclose' && $massaction !=
'close') {
210$parameters = array(
'arrayfields' => &$arrayfields);
212 $parameters[
'socid'] = $socid;
215 $parameters[
'projectid'] = $projectid;
217$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
222if (empty($reshook)) {
224 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
227 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
228 foreach (
$object->fields as $key => $val) {
230 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
231 $search[$key.
'_dtstart'] =
'';
232 $search[$key.
'_dtend'] =
'';
236 $search_array_options = array();
237 $search_date_start =
'';
238 $search_date_end =
'';
239 $search_dateread_start =
'';
240 $search_dateread_end =
'';
241 $search_dateclose_start =
'';
242 $search_dateclose_end =
'';
244 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
245 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
250 $objectclass =
'Ticket';
251 $objectlabel =
'Ticket';
252 $uploaddir =
$conf->ticket->dir_output;
255 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
258 if (!$error && $massaction ==
'close' && $permissiontoadd) {
259 $objecttmp =
new Ticket($db);
263 foreach ($toselect as $toselectid) {
264 $result = $objecttmp->fetch($toselectid);
266 $result = $objecttmp->close($user);
291 if (!$error && $massaction ==
'reopen' && $permissiontoadd) {
292 $objecttmp =
new Ticket($db);
296 foreach ($toselect as $toselectid) {
297 $result = $objecttmp->fetch($toselectid);
299 if ($objecttmp->status == Ticket::STATUS_CLOSED || $objecttmp->status == Ticket::STATUS_CANCELED) {
300 $result = $objecttmp->setStatut(Ticket::STATUS_ASSIGNED);
309 $langs->load(
"errors");
310 setEventMessages($langs->trans(
"ErrorObjectMustHaveStatusClosedToBeReOpened", $objecttmp->ref),
null,
'errors');
337$form =
new Form($db);
342$user_temp =
new User($db);
349 $socstatic->fetch($socid);
350 $moretitle = $langs->trans(
"ThirdParty") .
' - ';
351 if (
getDolGlobalString(
'MAIN_HTML_TITLE') && preg_match(
'/thirdpartynameonly/',
$conf->global->MAIN_HTML_TITLE) && $socstatic->name) {
352 $moretitle = $socstatic->name .
' - ';
356$title = $moretitle . $langs->trans(
'Tickets');
364$sql .=
$object->getFieldList(
't');
366if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
367 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
368 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
372$parameters = array();
373$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
374$sql .= $hookmanager->resPrint;
375$sql = preg_replace(
'/,\s*$/',
'', $sql);
379$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
380if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
381 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
384$parameters = array();
385$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
386$sql .= $hookmanager->resPrint;
387$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON (t.fk_soc = s.rowid)";
388$sql .=
" WHERE t.entity IN (".getEntity(
$object->element).
")";
390 $sql .=
" AND t.fk_soc = ".((int) $socid);
393foreach ($search as $key => $val) {
394 $tmpkey =
't.' . $key;
395 if ($key ==
'fk_statut' && !empty($search[
'fk_statut'])) {
396 $newarrayofstatus = array();
397 if (is_array($search[
'fk_statut'])) {
398 foreach ($search[
'fk_statut'] as $key2 => $val2) {
399 if (in_array($val2, array(
'openall',
'closeall'))) {
402 $newarrayofstatus[] = $val2;
405 if ($search[
'fk_statut'] ==
'openall' || (is_array($search[
'fk_statut']) && in_array(
'openall', $search[
'fk_statut']))) {
407 $newarrayofstatus[] = Ticket::STATUS_READ;
408 $newarrayofstatus[] = Ticket::STATUS_ASSIGNED;
409 $newarrayofstatus[] = Ticket::STATUS_IN_PROGRESS;
410 $newarrayofstatus[] = Ticket::STATUS_NEED_MORE_INFO;
411 $newarrayofstatus[] = Ticket::STATUS_WAITING;
413 if ($search[
'fk_statut'] ==
'closeall' || (is_array($search[
'fk_statut']) && in_array(
'closeall', $search[
'fk_statut']))) {
414 $newarrayofstatus[] = Ticket::STATUS_CLOSED;
415 $newarrayofstatus[] = Ticket::STATUS_CANCELED;
417 if (count($newarrayofstatus)) {
418 $sql .=
natural_search($tmpkey, implode(
',', $newarrayofstatus), 2);
421 } elseif ($key ==
'fk_user_assign' || $key ==
'fk_user_create' || $key ==
'fk_project' || $key ==
'fk_contract') {
422 if ($search[$key] > 0) {
426 } elseif ($key ==
'type_code') {
427 $newarrayoftypecodes = is_array($search[$key]) ? $search[$key] : (!empty($search[$key]) ? explode(
',', $search[$key]) : array());
428 if (count($newarrayoftypecodes)) {
429 $sql .=
natural_search($tmpkey, implode(
',', $newarrayoftypecodes), 3);
436 if ((is_array($search[$key]) && !empty($search[$key])) || (!is_array($search[$key]) && $search[$key] !=
'')) {
441 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
443if ($search_societe) {
446if ($search_fk_project > 0) {
447 $sql .=
natural_search(
't.fk_project', (
string) $search_fk_project, 2);
449if ($search_fk_contract > 0) {
450 $sql .=
natural_search(
't.fk_contract', (
string) $search_fk_contract, 2);
452if ($search_date_start) {
453 $sql .=
" AND t.datec >= '".$db->idate($search_date_start).
"'";
455if ($search_date_end) {
456 $sql .=
" AND t.datec <= '".$db->idate($search_date_end).
"'";
458if ($search_dateread_start) {
459 $sql .=
" AND t.date_read >= '".$db->idate($search_dateread_start).
"'";
461if ($search_dateread_end) {
462 $sql .=
" AND t.date_read <= '".$db->idate($search_dateread_end).
"'";
464if ($search_dateclose_start) {
465 $sql .=
" AND t.date_close >= '".$db->idate($search_dateclose_start).
"'";
467if ($search_dateclose_end) {
468 $sql .=
" AND t.date_close <= '".$db->idate($search_dateclose_end).
"'";
471if (!$user->socid && ($mode ==
"mine" || (!$user->admin &&
getDolGlobalString(
'TICKET_LIMIT_VIEW_ASSIGNED_ONLY')))) {
472 $sql .=
" AND (t.fk_user_assign = ".((int) $user->id);
474 $sql .=
" OR t.fk_user_create = ".((int) $user->id);
480include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
482$parameters = array();
483$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
484$sql .= $hookmanager->resPrint;
487$nbtotalofrecords =
'';
490 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
491 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
492 $resql = $db->query($sqlforcount);
494 $objforcount = $db->fetch_object($resql);
495 $nbtotalofrecords = $objforcount->nbtotalofrecords;
500 if (($page * $limit) > $nbtotalofrecords) {
508$sql .= $db->order($sortfield, $sortorder);
510 $sql .= $db->plimit($limit + 1, $offset);
513$resql = $db->query($sql);
519$num = $db->num_rows($resql);
522if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
523 $obj = $db->fetch_object($resql);
525 header(
"Location: ".DOL_URL_ROOT.
'/ticket/card.php?id='.
$id);
533llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-ticket page-list bodyforlist');
535if ($socid && !$projectid && !$project_ref && $user->hasRight(
'societe',
'lire')) {
537 $res = $socstat->fetch($socid);
544 print
dol_get_fiche_head($head,
'ticket', $langs->trans(
"ThirdParty"), -1,
'company');
546 dol_banner_tab($socstat,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom');
548 print
'<div class="fichecenter">';
550 print
'<div class="underbanner clearboth"></div>';
551 print
'<table class="border centpercent tableforfield">';
554 print
'<tr><td class="titlefield">'.$langs->trans(
'NatureOfThirdParty').
'</td><td>';
555 print $socstat->getTypeUrl(1);
559 if ($socstat->client && !empty($socstat->code_client)) {
560 print
'<tr><td class="titlefield">';
561 print $langs->trans(
'CustomerCode').
'</td><td>';
563 $tmpcheck = $socstat->check_codeclient();
564 if ($tmpcheck != 0 && $tmpcheck != -5) {
565 print
' <span class="error">('.$langs->trans(
"WrongCustomerCode").
')</span>';
571 if ($socstat->fournisseur && !empty($socstat->code_fournisseur)) {
572 print
'<tr><td class="titlefield">';
573 print $langs->trans(
'SupplierCode').
'</td><td>';
575 $tmpcheck = $socstat->check_codefournisseur();
576 if ($tmpcheck != 0 && $tmpcheck != -5) {
577 print
' <span class="error">('.$langs->trans(
"WrongSupplierCode").
')</span>';
591if ($projectid > 0 || $project_ref) {
592 $projectstat =
new Project($db);
593 if ($projectstat->fetch($projectid, $project_ref) > 0) {
594 $projectid = $projectstat->id;
595 $projectstat->fetch_thirdparty();
602 $userWrite = $projectstat->restrictedProjectArea($user,
'write');
607 print
dol_get_fiche_head($head,
'ticket', $langs->trans(
"Project"), -1, ($projectstat->public ?
'projectpub' :
'project'));
611 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
613 $morehtmlref =
'<div class="refidno">';
615 $morehtmlref .=
$object->title;
617 if (!empty(
$object->thirdparty->id) &&
$object->thirdparty->id > 0) {
618 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'project');
620 $morehtmlref .=
'</div>';
623 if (!$user->hasRight(
'projet',
'all',
'lire')) {
624 $objectsListId =
$object->getProjectsAuthorizedForUser($user, 0, 0);
625 $object->next_prev_filter =
"rowid:IN:".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0');
628 dol_banner_tab($object,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
630 print
'<div class="fichecenter">';
631 print
'<div class="underbanner clearboth"></div>';
633 print
'<table class="border tableforfield centpercent">';
636 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
637 if ($projectstat->public) {
638 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
639 print $langs->trans(
'SharedProject');
641 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
642 print $langs->trans(
'PrivateProject');
655 print
"ErrorRecordNotFound";
659$arrayofselected = is_array($toselect) ? $toselect : array();
663 $param .=
'&mode='.urlencode($mode);
665if ( $contextpage != $_SERVER[
"PHP_SELF"]) {
666 $param .=
'&contextpage='.urlencode($contextpage);
668if ($limit > 0 && $limit !=
$conf->liste_limit) {
669 $param .=
'&limit='.((int) $limit);
671foreach ($search as $key => $val) {
672 if (is_array($search[$key])) {
673 foreach ($search[$key] as $skey) {
675 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
678 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
679 $param .=
'&search_'.$key.
'month='.(
GETPOSTINT(
'search_'.$key.
'month'));
680 $param .=
'&search_'.$key.
'day='.(
GETPOSTINT(
'search_'.$key.
'day'));
681 $param .=
'&search_'.$key.
'year='.(
GETPOSTINT(
'search_'.$key.
'year'));
682 } elseif ($search[$key] !=
'') {
683 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
686if ($optioncss !=
'') {
687 $param .=
'&optioncss='.urlencode($optioncss);
690include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
692$parameters = array(
'param' => &$param);
693$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
694$param .= $hookmanager->resPrint;
696 $param .=
'&socid='.urlencode((
string) ($socid));
698if ($search_societe) {
699 $param .=
'&search_societe='.urlencode($search_societe);
702 $param .=
'&projectid='.urlencode((
string) ($projectid));
704if ($contractid > 0) {
705 $param .=
'&contractid='.urlencode((
string) ($contractid));
707if ($search_date_start) {
709 $param .=
'&search_date_startday='.((int) $tmparray[
'mday']);
710 $param .=
'&search_date_startmonth='.((int) $tmparray[
'mon']);
711 $param .=
'&search_date_startyear='.((int) $tmparray[
'year']);
713if ($search_date_end) {
715 $param .=
'&search_date_endday='.((int) $tmparray[
'mday']);
716 $param .=
'&search_date_endmonth='.((int) $tmparray[
'mon']);
717 $param .=
'&search_date_endyear='.((int) $tmparray[
'year']);
719if ($search_dateread_start) {
721 $param .=
'&search_dateread_startday='.((int) $tmparray[
'mday']);
722 $param .=
'&search_dateread_startmonth='.((int) $tmparray[
'mon']);
723 $param .=
'&search_dateread_startyear='.((int) $tmparray[
'year']);
725if ($search_dateread_end) {
727 $param .=
'&search_dateread_endday='.((int) $tmparray[
'mday']);
728 $param .=
'&search_dateread_endmonth='.((int) $tmparray[
'mon']);
729 $param .=
'&search_dateread_endyear='.((int) $tmparray[
'year']);
731if ($search_dateclose_start) {
733 $param .=
'&search_dateclose_startday='.((int) $tmparray[
'mday']);
734 $param .=
'&search_dateclose_startmonth='.((int) $tmparray[
'mon']);
735 $param .=
'&search_dateclose_startyear='.((int) $tmparray[
'year']);
737if ($search_dateclose_end) {
739 $param .=
'&search_date_endday='.((int) $tmparray[
'mday']);
740 $param .=
'&search_date_endmonth='.((int) $tmparray[
'mon']);
741 $param .=
'&search_date_endyear='.((int) $tmparray[
'year']);
744$arrayofmassactions = array(
748if ($permissiontoadd) {
749 $arrayofmassactions[
'presendonclose'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Close");
750 $arrayofmassactions[
'reopen'] =
img_picto(
'',
'folder-open',
'class="pictofixedwidth"').$langs->trans(
"ReOpen");
752if ($permissiontodelete) {
753 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
755if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
756 $arrayofmassactions = array();
758$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
760print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
761if ($optioncss !=
'') {
762 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
764print
'<input type="hidden" name="token" value="'.newToken().
'">';
765print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
766print
'<input type="hidden" name="action" value="list">';
767print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
768print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
769print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
770print
'<input type="hidden" name="mode" value="'.$mode.
'" >';
773 print
'<input type="hidden" name="socid" value="'.$socid.
'" >';
776 print
'<input type="hidden" name="projectid" value="'.$projectid.
'" >';
779$url = DOL_URL_ROOT.
'/ticket/card.php?action=create'.($socid ?
'&socid='.$socid :
'').($projectid ?
'&origin=projet_project&originid='.$projectid :
'');
781 $url .=
'&socid='.$socid;
784$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'));
785$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'));
787$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewTicket'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'ticket',
'write'));
794print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
796if ($mode ==
'mine') {
797 print
'<div class="opacitymedium">'.$langs->trans(
'TicketAssignedToMeInfos').
'</div><br>';
800$topicmail =
"SendTicketRef";
801$modelmail =
"ticket";
802$objecttmp =
new Ticket($db);
803$trackid =
'tic'.$object->id;
804include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
807if ($massaction ==
'presendonclose') {
808 $hidden_form = array([
810 "name" =>
"massaction",
814 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassTicketClosingSendEmail"), $langs->trans(
"ConfirmMassTicketClosingSendEmailQuestion"),
'confirm_send_close', $hidden_form, $selectedchoice, 0, 200, 500, 1);
819 foreach ($fieldstosearchall as $key => $val) {
820 $fieldstosearchall[$key] = $langs->trans($val);
821 $setupstring .= $key.
"=".$val.
";";
823 print
'<!-- Search done like if TICKET_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
824 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
832$parameters = array();
833$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
834if (empty($reshook)) {
835 $moreforfilter .= $hookmanager->resPrint;
837 $moreforfilter = $hookmanager->resPrint;
840if (!empty($moreforfilter)) {
841 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
842 print $moreforfilter;
846$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
847$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
848$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
850print
'<div class="div-table-responsive">';
851print
'<div class="div-table-responsive-inside">';
852print
'<table class="tagtable noborder nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
857print
'<tr class="liste_titre_filter">';
860 print
'<td class="liste_titre maxwidthsearch center">';
861 $searchpicto = $form->showFilterButtons(
'left');
865foreach (
$object->fields as $key => $val) {
866 $searchkey = empty($search[$key]) ?
'' : $search[$key];
867 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
868 if ($key ==
'fk_statut') {
869 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
870 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
871 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
872 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
873 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
874 } 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'])) {
875 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
877 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
878 if ($key ==
'progress') {
879 print
'<td class="liste_titre right'.($cssforfield ?
' '.$cssforfield :
'').
'">';
880 print
'<input type="text" class="flat maxwidth50" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
882 } elseif ($key ==
'type_code') {
883 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
884 $formTicket->selectTypesTickets(empty($search[$key]) ?
'' : $search[$key],
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'), 1);
886 } elseif ($key ==
'category_code') {
887 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
888 $formTicket->selectGroupTickets(
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'));
890 } elseif ($key ==
'severity_code') {
891 print
'<td class="liste_titre center'.($cssforfield ?
' '.$cssforfield :
'').
'">';
892 $formTicket->selectSeveritiesTickets(
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key,
'', 2, 1, 1, 0, (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth150'));
894 } elseif ($key ==
'fk_user_assign' || $key ==
'fk_user_create') {
895 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
896 print $form->select_dolusers((empty($search[$key]) ?
'' : $search[$key]),
'search_'.$key, 1, null, 0,
'',
'',
'0', 0, 0,
'', 0,
'', (!empty($val[
'css']) ? $val[
'css'] :
'maxwidth100'));
898 } elseif ($key ==
'fk_statut') {
899 $arrayofstatus = array();
900 $arrayofstatus[
'openall'] =
'-- '.$langs->trans(
'OpenAll').
' --';
901 foreach (
$object->labelStatusShort as $key2 => $val2) {
902 if ($key2 == Ticket::STATUS_CLOSED) {
903 $arrayofstatus[
'closeall'] =
'-- '.$langs->trans(
'ClosedAll').
' --';
905 $arrayofstatus[$key2] = $val2;
907 print
'<td class="liste_titre center parentonrightofpage'.($cssforfield ?
' '.$cssforfield :
'').
'">';
911 $selectedarray =
null;
912 if (!empty($search[$key])) {
913 if (is_array($search[$key])) {
914 $selectedarray = array_values($search[$key]);
916 $selectedarray = array($search[$key]);
919 print
Form::multiselectarray(
'search_fk_statut', $arrayofstatus, $selectedarray, 0, 0,
'search_status width150 onrightofpage', 1, 0,
'',
'',
'');
921 } elseif ($key ==
"fk_soc") {
922 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'"><input type="text" class="flat maxwidth75" name="search_societe" value="'.
dol_escape_htmltag($search_societe).
'"></td>';
923 } elseif ($key ==
"datec" || $key ==
'date_read' || $key ==
'date_close') {
924 print
'<td class="liste_titre center">';
925 print
'<div class="nowrap">';
928 print $form->selectDate($search_date_start ?: -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
931 print $form->selectDate($search_dateread_start ?: -1,
'search_dateread_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
934 print $form->selectDate($search_dateclose_start ?: -1,
'search_dateclose_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
937 print
'<div class="nowrap">';
940 print $form->selectDate($search_date_end ?: -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
943 print $form->selectDate($search_dateread_end ?: -1,
'search_dateread_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
946 print $form->selectDate($search_dateclose_end ?: -1,
'search_dateclose_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
951 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
952 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
953 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], $search[$key], $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
954 } elseif (strpos($val[
'type'],
'integer:') === 0) {
955 print
$object->showInputField($val, $key, !empty($search[$key]) ? $search[$key] :
"",
'',
'',
'search_',
'maxwidth150', 1);
956 } elseif (!preg_match(
'/^(date|timestamp)/', $val[
'type'])) {
957 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
964include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
967$parameters = array(
'arrayfields' => $arrayfields);
968$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
969print $hookmanager->resPrint;
972 print
'<td class="liste_titre center maxwidthsearch">';
973 $searchpicto = $form->showFilterButtons();
979$totalarray = array();
980$totalarray[
'nbfield'] = 0;
984print
'<tr class="liste_titre">';
986 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
987 $totalarray[
'nbfield']++;
989foreach (
$object->fields as $key => $val) {
990 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
991 if ($key ==
'fk_statut' || $key ==
'severity_code') {
992 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
993 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
994 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
995 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
996 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
997 } 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'])) {
998 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
1000 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
1001 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
1002 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";
1003 $totalarray[
'nbfield']++;
1007include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1009$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1010$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1011print $hookmanager->resPrint;
1013 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1014 $totalarray[
'nbfield']++;
1020$needToFetchEachLine = 0;
1021if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
1022 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
1023 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
1024 $needToFetchEachLine++;
1033$savnbfield = $totalarray[
'nbfield'];
1034$totalarray = array();
1035$totalarray[
'nbfield'] = 0;
1036$imaxinloop = ($limit ? min($num, $limit) : $num);
1037$cacheofoutputfield = array();
1038while ($i < $imaxinloop) {
1039 $obj = $db->fetch_object($resql);
1045 $object->setVarsFromFetchObj($obj);
1046 $object->type_code = $obj->type_code;
1049 if ($mode ==
'kanban') {
1051 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1052 print
'<div class="box-flex-container kanban">';
1057 $arraydata = array();
1058 if ($obj->fk_user_assign > 0) {
1059 $user_temp->fetch($obj->fk_user_assign);
1060 $arraydata[
'user_assignment'] = $user_temp->getNomUrl(-3);
1062 $arraydata[
'selected'] = in_array(
$object->id, $arrayofselected);
1065 print
$object->getKanbanView(
'', $arraydata);
1066 if ($i == ($imaxinloop - 1)) {
1073 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
1077 print
'<td class="nowrap center">';
1078 if ($massactionbutton || $massaction) {
1080 if (in_array(
$object->id, $arrayofselected)) {
1083 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1087 $totalarray[
'nbfield']++;
1091 foreach (
$object->fields as $key => $val) {
1092 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
1093 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
1094 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
1097 if (in_array($val[
'type'], array(
'timestamp'))) {
1098 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
1100 if (in_array($key, array(
'ref',
'fk_project'))) {
1101 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
1104 if ($key ==
'fk_statut' || $key ==
'severity_code') {
1105 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
1107 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
1108 print
'<td'.($cssforfield ?
' class="'.$cssforfield.((preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) ?
' classfortooltip' :
'').
'"' :
'');
1109 if (preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) {
1110 print
' title="'.dol_escape_htmltag(
$object->$key).
'"';
1113 if ($key ==
'fk_statut') {
1114 print
$object->getLibStatut(5);
1115 } elseif ($key ==
'subject') {
1117 print
'<span title="'.dol_escape_htmltag($s).
'">';
1120 } elseif ($key ==
'type_code') {
1121 $s = $langs->getLabelFromKey($db,
'TicketTypeShort'.
$object->type_code,
'c_ticket_type',
'code',
'label',
$object->type_code);
1122 print
'<span title="'.dol_escape_htmltag($s).
'">';
1125 } elseif ($key ==
'category_code') {
1126 $s = $langs->getLabelFromKey($db,
'TicketCategoryShort'.
$object->category_code,
'c_ticket_category',
'code',
'label',
$object->category_code);
1127 print
'<span title="'.dol_escape_htmltag($s).
'">';
1130 } elseif ($key ==
'severity_code') {
1131 $s = $langs->getLabelFromKey($db,
'TicketSeverityShort'.
$object->severity_code,
'c_ticket_severity',
'code',
'label',
$object->severity_code);
1132 print
'<span title="'.dol_escape_htmltag($s).
'">';
1135 } elseif ($key ==
'tms') {
1136 print
dol_print_date($db->jdate($obj->$key),
'dayhour',
'tzuser');
1137 } elseif ($key ==
'fk_user_create') {
1138 if (
$object->fk_user_create > 0) {
1139 if (isset(
$conf->cache[
'user'][
$object->fk_user_create])) {
1140 $user_temp =
$conf->cache[
'user'][
$object->fk_user_create];
1142 $user_temp =
new User($db);
1143 $user_temp->fetch(
$object->fk_user_create);
1144 $conf->cache[
'user'][
$object->fk_user_create] = $user_temp;
1146 print $user_temp->getNomUrl(-1);
1148 } elseif ($key ==
'fk_user_assign') {
1149 if (
$object->fk_user_assign > 0) {
1150 if (isset(
$conf->cache[
'user'][
$object->fk_user_assign])) {
1151 $user_temp =
$conf->cache[
'user'][
$object->fk_user_assign];
1153 $user_temp =
new User($db);
1154 $user_temp->fetch(
$object->fk_user_assign);
1155 $conf->cache[
'user'][
$object->fk_user_assign] = $user_temp;
1157 print $user_temp->getNomUrl(-1);
1159 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
1160 print
$object->showOutputField($val, $key, $db->jdate($obj->$key),
'');
1161 } elseif ($key ==
'ref') {
1162 print
$object->showOutputField($val, $key, $obj->$key,
'');
1165 $is_open = (
$object->status != Ticket::STATUS_CLOSED &&
$object->status != Ticket::STATUS_CANCELED);
1167 if ($is_open && $should_show_warning) {
1168 $date_last_msg_sent = (int)
$object->date_last_msg_sent;
1169 $hour_diff = ($now - $date_last_msg_sent) / 3600 ;
1171 if (
getDolGlobalString(
'TICKET_DELAY_BEFORE_FIRST_RESPONSE') && $date_last_msg_sent == 0) {
1172 $creation_date =
$object->datec;
1173 $hour_diff_creation = ($now - $creation_date) / 3600 ;
1174 if ($hour_diff_creation >
getDolGlobalInt(
'TICKET_DELAY_BEFORE_FIRST_RESPONSE')) {
1175 print
" " .
img_picto($langs->trans(
'Late') .
' : ' . $langs->trans(
'TicketsDelayForFirstResponseTooLong',
getDolGlobalString(
'TICKET_DELAY_BEFORE_FIRST_RESPONSE')),
'warning',
'style="color: red;"', 0, 0, 0,
'',
'');
1178 print
" " .
img_picto($langs->trans(
'Late') .
' : ' . $langs->trans(
'TicketsDelayFromLastResponseTooLong',
getDolGlobalString(
'TICKET_DELAY_SINCE_LAST_RESPONSE')),
'warning');
1182 $tmp = explode(
':', $val[
'type']);
1183 if ($tmp[0] ==
'integer' && !empty($tmp[1]) && class_exists($tmp[1])) {
1186 if ($key && $obj->$key && $val[
'type'] && array_key_exists($key.
'-'.$obj->$key.
'-'.$val[
'type'], $cacheofoutputfield)) {
1187 $result = $cacheofoutputfield[$key.
'-'.$obj->$key.
'-'.$val[
'type']];
1189 $result =
$object->showOutputField($val, $key, $obj->$key,
'');
1190 $cacheofoutputfield[$key.
'-'.$obj->$key.
'-'.$val[
'type']] = $result;
1193 $result =
$object->showOutputField($val, $key, $obj->$key,
'');
1200 $totalarray[
'nbfield']++;
1202 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
1204 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
1206 if (!isset($totalarray[
'val'])) {
1207 $totalarray[
'val'] = array();
1209 if (!isset($totalarray[
'val'][
't.'.$key])) {
1210 $totalarray[
'val'][
't.'.$key] = 0;
1212 $totalarray[
'val'][
't.'.$key] +=
$object->$key;
1217 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1219 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
1220 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1221 print $hookmanager->resPrint;
1225 print
'<td class="nowrap center">';
1226 if ($massactionbutton || $massaction) {
1228 if (in_array(
$object->id, $arrayofselected)) {
1231 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1235 $totalarray[
'nbfield']++;
1246include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1252 foreach ($arrayfields as $key => $val) {
1253 if (!empty($val[
'checked'])) {
1257 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1263$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
1264$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
1265print $hookmanager->resPrint;
1267print
'</table>'.
"\n";
1271print
'</form>'.
"\n";
1275if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
1276 $hidegeneratedfilelistifempty = 1;
1277 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1278 $hidegeneratedfilelistifempty = 0;
1281 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
1285 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1286 $urlsource .= str_replace(
'&',
'&', $param);
1288 $filedir = $diroutputmassaction;
1289 $genallowed = $permissiontoread;
1290 $delallowed = $permissiontoadd;
1292 print $formfile->showdocuments(
'massfilesarea_ticket',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
const STATUS_NOT_READ
Status.
Class to manage Dolibarr users.
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
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.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
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_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a 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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.