30 require
'../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
37 require_once __DIR__.
'/class/skill.class.php';
43 $langs->loadLangs(array(
'hrm',
'other'));
48 $action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
49 $massaction =
GETPOST(
'massaction',
'alpha');
50 $show_files =
GETPOST(
'show_files',
'int');
51 $confirm =
GETPOST(
'confirm',
'alpha');
52 $cancel =
GETPOST(
'cancel',
'alpha');
53 $toselect =
GETPOST(
'toselect',
'array');
54 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'skilllist';
55 $backtopage =
GETPOST(
'backtopage',
'alpha');
56 $optioncss =
GETPOST(
'optioncss',
'aZ');
59 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
60 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
61 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
63 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
67 $offset = $limit * $page;
68 $pageprev = $page - 1;
69 $pagenext = $page + 1;
72 $object =
new Skill($db);
74 $diroutputmassaction = $conf->hrm->dir_output.
'/temp/massgeneration/'.$user->id;
75 $hookmanager->initHooks(array(
'skilllist'));
78 $extrafields->fetch_name_optionals_label($object->table_element);
81 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
85 reset($object->fields);
86 $sortfield =
"t.".key($object->fields);
93 $search_all =
GETPOST(
'search_all',
'alphanohtml') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml');
95 foreach ($object->fields as $key => $val) {
96 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
97 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
99 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
100 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
101 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
106 $fieldstosearchall = array();
107 foreach ($object->fields as $key => $val) {
108 if (!empty($val[
'searchall'])) {
109 $fieldstosearchall[
't.'.$key] = $val[
'label'];
114 $arrayfields = array();
115 foreach ($object->fields as $key => $val) {
117 if (!empty($val[
'visible'])) {
118 $visible = (int)
dol_eval($val[
'visible'], 1, 1,
'1');
119 $arrayfields[
't.'.$key] = array(
120 'label'=>$val[
'label'],
121 'checked'=>(($visible < 0) ? 0 : 1),
122 'enabled'=>($visible != 3 &&
dol_eval($val[
'enabled'], 1, 1,
'1')),
123 'position'=>$val[
'position'],
124 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
129 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
135 $permissiontoread = $user->rights->hrm->all->read;
136 $permissiontoadd = $user->rights->hrm->all->write;
137 $permissiontodelete = $user->rights->hrm->all->delete;
140 if (empty($conf->hrm->enabled)) {
159 if (
GETPOST(
'cancel',
'alpha')) {
163 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
167 $parameters = array();
168 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
173 if (empty($reshook)) {
175 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
178 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
179 foreach ($object->fields as $key => $val) {
181 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
182 $search[$key.
'_dtstart'] =
'';
183 $search[$key.
'_dtend'] =
'';
187 $search_array_options = array();
189 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
190 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
195 $objectclass =
'Skill';
196 $objectlabel =
'Skill';
197 $uploaddir = $conf->hrm->dir_output;
198 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
213 $title = $langs->trans(
"Skills");
221 $sql .= $object->getFieldList(
't');
223 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
224 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
225 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
229 $parameters = array();
230 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
231 $sql .= preg_replace(
'/^,/',
'', $hookmanager->resPrint);
232 $sql = preg_replace(
'/,\s*$/',
'', $sql);
233 $sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
234 if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
235 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
238 $parameters = array();
239 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
240 $sql .= $hookmanager->resPrint;
241 if ($object->ismultientitymanaged == 1) {
242 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
244 $sql .=
" WHERE 1 = 1";
246 foreach ($search as $key => $val) {
247 if (array_key_exists($key, $object->fields)) {
248 if ($key ==
'status' && $search[$key] == -1) {
251 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
252 if ((strpos($object->fields[$key][
'type'],
'integer:') === 0) || (strpos($object->fields[$key][
'type'],
'sellist:') === 0) || !empty($object->fields[$key][
'arrayofkeyval'])) {
253 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0', $object->fields[$key][
'arrayofkeyval'])))) {
258 if ($search[$key] !=
'') {
259 $sql .=
natural_search($key, $search[$key], (($key ==
'status') ? 2 : $mode_search));
262 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
263 $columnName=preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
264 if (preg_match(
'/^(date|timestamp|datetime)/', $object->fields[$columnName][
'type'])) {
265 if (preg_match(
'/_dtstart$/', $key)) {
266 $sql .=
" AND t." . $columnName .
" >= '" . $db->idate($search[$key]) .
"'";
268 if (preg_match(
'/_dtend$/', $key)) {
269 $sql .=
" AND t." . $columnName .
" <= '" . $db->idate($search[$key]) .
"'";
276 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
280 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
282 $parameters = array();
283 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
284 $sql .= $hookmanager->resPrint;
304 $sql .= $db->order($sortfield, $sortorder);
308 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
309 $resql = $db->query($sql);
321 $sql .= $db->plimit($limit + 1, $offset);
324 $resql = $db->query($sql);
330 $num = $db->num_rows(
$resql);
334 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
335 $obj = $db->fetch_object(
$resql);
337 header(
"Location: ".
dol_buildpath(
'/hrm/skill_card.php', 1).
'?id='.$id);
347 $arrayofselected = is_array($toselect) ? $toselect : array();
350 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
351 $param .=
'&contextpage='.urlencode($contextpage);
353 if ($limit > 0 && $limit != $conf->liste_limit) {
354 $param .=
'&limit='.urlencode($limit);
356 foreach ($search as $key => $val) {
357 if (is_array($search[$key]) && count($search[$key])) {
358 foreach ($search[$key] as $skey) {
359 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
362 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
365 if ($optioncss !=
'') {
366 $param .=
'&optioncss='.urlencode($optioncss);
369 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
371 $parameters = array();
372 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
373 $param .= $hookmanager->resPrint;
376 $arrayofmassactions = array(
382 if ($permissiontodelete) {
383 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
385 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
386 $arrayofmassactions = array();
388 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
390 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
391 if ($optioncss !=
'') {
392 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
394 print
'<input type="hidden" name="token" value="'.newToken().
'">';
395 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
396 print
'<input type="hidden" name="action" value="list">';
397 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
398 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
399 print
'<input type="hidden" name="page" value="'.$page.
'">';
400 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
402 $newcardbutton =
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/hrm/skill_card.php?action=create',
'', $permissiontoadd);
404 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'object_'.$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
407 $topicmail =
"SendSkillRef";
408 $modelmail =
"skill";
409 $objecttmp =
new Skill($db);
410 $trackid =
'xxxx'.$object->id;
411 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
414 foreach ($fieldstosearchall as $key => $val) {
415 $fieldstosearchall[$key] = $langs->trans($val);
417 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
425 $parameters = array();
426 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
427 if (empty($reshook)) {
428 $moreforfilter .= $hookmanager->resPrint;
430 $moreforfilter = $hookmanager->resPrint;
433 if (!empty($moreforfilter)) {
434 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
435 print $moreforfilter;
439 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
440 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
441 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
443 print
'<div class="div-table-responsive">';
444 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
449 print
'<tr class="liste_titre">';
450 foreach ($object->fields as $key => $val) {
451 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
452 if ($key ==
'status') {
453 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
454 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
455 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
456 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
457 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
458 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
459 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
461 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
462 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
463 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
464 print
$form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
465 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
466 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_',
'maxwidth125', 1);
467 } elseif (!preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
468 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
469 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
470 print
'<div class="nowrap">';
471 print
$form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
473 print
'<div class="nowrap">';
474 print
$form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
481 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
484 $parameters = array(
'arrayfields'=>$arrayfields);
485 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
486 print $hookmanager->resPrint;
488 print
'<td class="liste_titre maxwidthsearch">';
489 $searchpicto =
$form->showFilterButtons();
497 print
'<tr class="liste_titre">';
498 foreach ($object->fields as $key => $val) {
499 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
500 if ($key ==
'status') {
501 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
502 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
503 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
504 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
505 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
506 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
507 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
509 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
510 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
514 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
516 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
517 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
518 print $hookmanager->resPrint;
520 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
525 $needToFetchEachLine = 0;
526 if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
527 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
528 if (preg_match(
'/\$object/', $val)) {
529 $needToFetchEachLine++;
538 $totalarray = array();
539 $totalarray[
'nbfield'] = 0;
540 while ($i < ($limit ? min($num, $limit) : $num)) {
541 $obj = $db->fetch_object(
$resql);
547 $object->setVarsFromFetchObj($obj);
550 print
'<tr class="oddeven">';
551 foreach ($object->fields as $key => $val) {
552 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
553 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
554 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
555 } elseif ($key ==
'status') {
556 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
559 if (in_array($val[
'type'], array(
'timestamp'))) {
560 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
561 } elseif ($key ==
'ref') {
562 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
565 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
566 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
570 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
571 print
'<td'.($cssforfield ?
' class="'.$cssforfield.
'"' :
'').
'>';
572 if ($key ==
'status') {
573 print $object->getLibStatut(5);
574 } elseif ($key ==
'rowid') {
575 print $object->showOutputField($val, $key, $object->id,
'');
576 } elseif ($key ==
'label') {
577 print $object->getNomUrl(1);
579 print $object->showOutputField($val, $key, $object->$key,
'');
583 $totalarray[
'nbfield']++;
585 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
587 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
589 if (!isset($totalarray[
'val'])) {
590 $totalarray[
'val'] = array();
592 if (!isset($totalarray[
'val'][
't.'.$key])) {
593 $totalarray[
'val'][
't.'.$key] = 0;
595 $totalarray[
'val'][
't.'.$key] += $object->$key;
600 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
602 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
603 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
604 print $hookmanager->resPrint;
606 print
'<td class="nowrap center">';
607 if ($massactionbutton || $massaction) {
609 if (in_array($object->id, $arrayofselected)) {
612 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
616 $totalarray[
'nbfield']++;
625 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
630 foreach ($arrayfields as $key => $val) {
631 if (!empty($val[
'checked'])) {
635 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
641 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
642 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
643 print $hookmanager->resPrint;
645 print
'</table>'.
"\n";
648 print
'</form>'.
"\n";
651 $hidegeneratedfilelistifempty = 1;
652 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
653 $hidegeneratedfilelistifempty = 0;
656 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
660 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
661 $urlsource .= str_replace(
'&',
'&', $param);
663 $filedir = $diroutputmassaction;
664 $genallowed = $permissiontoread;
665 $delallowed = $permissiontoadd;
667 print $formfile->showdocuments(
'massfilesarea_hrm',
'', $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.
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_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_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.
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_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.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
$nbtotalofrecords
Count total nb of records.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.