27require
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/asset/class/asset.class.php';
34$langs->loadLangs(array(
"assets",
"other"));
37$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
38$massaction =
GETPOST(
'massaction',
'alpha');
40$confirm =
GETPOST(
'confirm',
'alpha');
41$cancel =
GETPOST(
'cancel',
'alpha');
42$toselect =
GETPOST(
'toselect',
'array');
43$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'assetlist';
44$backtopage =
GETPOST(
'backtopage',
'alpha');
45$optioncss =
GETPOST(
'optioncss',
'aZ');
46$mode =
GETPOST(
'mode',
'alpha');
51$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
52$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
54if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
57$offset = $limit * $page;
64$diroutputmassaction = $conf->asset->dir_output.
'/temp/massgeneration/'.$user->id;
65$hookmanager->initHooks(array(
'assetlist'));
68$extrafields->fetch_name_optionals_label(
$object->table_element);
71$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
76 $sortfield =
"t.".key(
$object->fields);
83$search_all =
GETPOST(
'search_all',
'alphanohtml');
85foreach (
$object->fields as $key => $val) {
86 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
87 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
89 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
96$fieldstosearchall = array();
97foreach (
$object->fields as $key => $val) {
98 if (!empty($val[
'searchall'])) {
99 $fieldstosearchall[
't.'.$key] = $val[
'label'];
104$arrayfields = array();
105foreach (
$object->fields as $key => $val) {
107 if (!empty($val[
'visible'])) {
108 $visible = (int)
dol_eval($val[
'visible'], 1);
109 $arrayfields[
't.'.$key] = array(
110 'label'=>$val[
'label'],
111 'checked'=>(($visible < 0) ? 0 : 1),
112 'enabled'=>(abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
113 'position'=>$val[
'position'],
114 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
119include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
124$permissiontoread = $user->hasRight(
'asset',
'read');
125$permissiontoadd = $user->hasRight(
'asset',
'write');
126$permissiontodelete = $user->hasRight(
'asset',
'delete');
129if (!isModEnabled(
'asset')) {
134if ($user->socid > 0) {
137$socid = 0;
if ($user->socid > 0) {
138 $socid = $user->socid;
140$isdraft = ((
$object->status == $object::STATUS_DRAFT) ? 1 : 0);
142if (!isModEnabled(
'asset')) {
145if (!$permissiontoread) {
155if (
GETPOST(
'cancel',
'alpha')) {
159if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
163$parameters = array();
164$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
169if (empty($reshook)) {
171 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
174 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
175 foreach (
$object->fields as $key => $val) {
177 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
178 $search[$key.
'_dtstart'] =
'';
179 $search[$key.
'_dtend'] =
'';
183 $search_array_options = array();
185 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
186 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
191 $objectclass =
'Asset';
192 $objectlabel =
'Asset';
193 $uploaddir = $conf->asset->dir_output;
194 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
203$form =
new Form($db);
208$title = $langs->trans(
'ListOf', $langs->transnoentitiesnoconv(
"Assets"));
216$sql .=
$object->getFieldList(
't');
218if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
219 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
220 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
224$parameters = array();
225$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
226$sql .= $hookmanager->resPrint;
227$sql = preg_replace(
'/,\s*$/',
'', $sql);
231$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
232if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
233 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
236$parameters = array();
237$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
238$sql .= $hookmanager->resPrint;
239if (
$object->ismultientitymanaged == 1) {
240 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element).
")";
242 $sql .=
" WHERE 1 = 1";
244foreach ($search as $key => $val) {
245 if (array_key_exists($key,
$object->fields)) {
246 if ($key ==
'status' && $search[$key] == -1) {
250 if ((strpos(
$object->fields[$key][
'type'],
'integer:') === 0) || (strpos(
$object->fields[$key][
'type'],
'sellist:') === 0) || !empty(
$object->fields[$key][
'arrayofkeyval'])) {
251 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty(
$object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0',
$object->fields[$key][
'arrayofkeyval'])))) {
256 if ($search[$key] !=
'') {
257 $sql .=
natural_search($key, $search[$key], (($key ==
'status') ? 2 : $mode_search));
260 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
261 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
262 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
263 if (preg_match(
'/_dtstart$/', $key)) {
264 $sql .=
" AND t.".$columnName.
" >= '".$db->idate($search[$key]).
"'";
266 if (preg_match(
'/_dtend$/', $key)) {
267 $sql .=
" AND t." . $columnName .
" <= '" . $db->idate($search[$key]) .
"'";
274 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
278include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
280$parameters = array();
281$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
282$sql .= $hookmanager->resPrint;
310$nbtotalofrecords =
'';
313 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
314 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
315 $resql = $db->query($sqlforcount);
317 $objforcount = $db->fetch_object($resql);
318 $nbtotalofrecords = $objforcount->nbtotalofrecords;
323 if (($page * $limit) > $nbtotalofrecords) {
331$sql .= $db->order($sortfield, $sortorder);
333 $sql .= $db->plimit($limit + 1, $offset);
336$resql = $db->query($sql);
342$num = $db->num_rows($resql);
346if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
347 $obj = $db->fetch_object($resql);
349 header(
"Location: ".DOL_URL_ROOT.
'/asset/card.php?id='.$id);
357llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist mod-asset page-list');
359$arrayofselected = is_array($toselect) ? $toselect : array();
362if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
363 $param .=
'&contextpage='.urlencode($contextpage);
365if ($limit > 0 && $limit != $conf->liste_limit) {
366 $param .=
'&limit='.((int) $limit);
368foreach ($search as $key => $val) {
369 if (is_array($search[$key]) && count($search[$key])) {
370 foreach ($search[$key] as $skey) {
372 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
375 } elseif ($search[$key] !=
'') {
376 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
379if ($optioncss !=
'') {
380 $param .=
'&optioncss='.urlencode($optioncss);
383include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
385$parameters = array(
'param' => &$param);
386$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
387$param .= $hookmanager->resPrint;
390$arrayofmassactions = array(
396if ($permissiontodelete) {
397 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
399if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
400 $arrayofmassactions = array();
402$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
404print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
405if ($optioncss !=
'') {
406 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
408print
'<input type="hidden" name="token" value="'.newToken().
'">';
409print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
410print
'<input type="hidden" name="action" value="list">';
411print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
412print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
413print
'<input type="hidden" name="page" value="'.$page.
'">';
414print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
417$newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/asset/card.php?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
419print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
422$topicmail =
"SendAssetRef";
424$objecttmp =
new Asset($db);
425$trackid =
'asset'.$object->id;
426include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
429 foreach ($fieldstosearchall as $key => $val) {
430 $fieldstosearchall[$key] = $langs->trans($val);
432 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
440$parameters = array();
441$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
442if (empty($reshook)) {
443 $moreforfilter .= $hookmanager->resPrint;
445 $moreforfilter = $hookmanager->resPrint;
448if (!empty($moreforfilter)) {
449 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
450 print $moreforfilter;
454$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
455$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
456$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
458print
'<div class="div-table-responsive">';
459print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
464print
'<tr class="liste_titre">';
465foreach (
$object->fields as $key => $val) {
466 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
467 if ($key ==
'status') {
468 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
469 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
470 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
471 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
472 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
473 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
474 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
476 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
477 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
478 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
479 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
480 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
481 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_',
'maxwidth125', 1);
482 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
483 print
'<div class="nowrap">';
484 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
486 print
'<div class="nowrap">';
487 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
489 } elseif ($key ==
'lang') {
490 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
492 print $formadmin->select_language($search[$key],
'search_lang', 0,
null, 1, 0, 0,
'minwidth100imp maxwidth125', 2);
494 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
500include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
503$parameters = array(
'arrayfields'=>$arrayfields);
504$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
505print $hookmanager->resPrint;
507print
'<td class="liste_titre maxwidthsearch">';
508$searchpicto = $form->showFilterButtons();
516print
'<tr class="liste_titre">';
517foreach (
$object->fields as $key => $val) {
518 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
519 if ($key ==
'status') {
520 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
521 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
522 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
523 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
524 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
525 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
526 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
528 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
529 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
533include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
535$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
536$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
537print $hookmanager->resPrint;
539print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
544$needToFetchEachLine = 0;
545if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
546 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
547 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
548 $needToFetchEachLine++;
557$totalarray = array();
558$totalarray[
'nbfield'] = 0;
559while ($i < ($limit ? min($num, $limit) : $num)) {
560 $obj = $db->fetch_object($resql);
566 $object->setVarsFromFetchObj($obj);
569 print
'<tr class="oddeven">';
570 foreach (
$object->fields as $key => $val) {
571 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
572 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
573 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
574 } elseif ($key ==
'status') {
575 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
578 if (in_array($val[
'type'], array(
'timestamp'))) {
579 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
580 } elseif ($key ==
'ref') {
581 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
584 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
585 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
589 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
590 print
'<td'.($cssforfield ?
' class="'.$cssforfield.
'"' :
'').
'>';
591 if ($key ==
'status') {
592 print
$object->getLibStatut(5);
593 } elseif ($key ==
'rowid') {
600 $totalarray[
'nbfield']++;
602 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
604 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
606 if (!isset($totalarray[
'val'])) {
607 $totalarray[
'val'] = array();
609 if (!isset($totalarray[
'val'][
't.'.$key])) {
610 $totalarray[
'val'][
't.'.$key] = 0;
612 $totalarray[
'val'][
't.'.$key] +=
$object->$key;
617 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
619 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
620 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
621 print $hookmanager->resPrint;
623 print
'<td class="nowrap center">';
624 if ($massactionbutton || $massaction) {
626 if (in_array(
$object->id, $arrayofselected)) {
629 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
633 $totalarray[
'nbfield']++;
642include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
647 foreach ($arrayfields as $key => $val) {
648 if (!empty($val[
'checked'])) {
652 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
658$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
659$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
660print $hookmanager->resPrint;
662print
'</table>'.
"\n";
667if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
668 $hidegeneratedfilelistifempty = 1;
669 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
670 $hidegeneratedfilelistifempty = 0;
673 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
677 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
678 $urlsource .= str_replace(
'&',
'&', $param);
680 $filedir = $diroutputmassaction;
681 $genallowed = $permissiontoread;
682 $delallowed = $permissiontoadd;
684 print $formfile->showdocuments(
'massfilesarea_asset',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
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...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
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.
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_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_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.
print_barre_liste($title, $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.
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.
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 dolibarr global constant string value.
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...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.