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/evaluation.class.php';
43 $langs->loadLangs(array(
'hrm',
'other'));
46 $action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
47 $massaction =
GETPOST(
'massaction',
'alpha');
48 $show_files =
GETPOST(
'show_files',
'int');
49 $confirm =
GETPOST(
'confirm',
'alpha');
50 $cancel =
GETPOST(
'cancel',
'alpha');
51 $toselect =
GETPOST(
'toselect',
'array');
52 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'evaluationlist';
53 $backtopage =
GETPOST(
'backtopage',
'alpha');
54 $optioncss =
GETPOST(
'optioncss',
'aZ');
55 $mode =
GETPOST(
'mode',
'alpha');
61 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
62 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
63 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
65 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
69 $offset = $limit * $page;
70 $pageprev = $page - 1;
71 $pagenext = $page + 1;
76 $diroutputmassaction = $conf->hrm->dir_output.
'/temp/massgeneration/'.$user->id;
77 $hookmanager->initHooks(array(
'evaluationlist'));
80 $extrafields->fetch_name_optionals_label($object->table_element);
83 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
87 reset($object->fields);
88 $sortfield =
"t.".key($object->fields);
95 $search_all =
GETPOST(
'search_all',
'alphanohtml') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml');
97 foreach ($object->fields as $key => $val) {
98 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
99 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
101 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
102 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
103 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
108 $fieldstosearchall = array();
109 foreach ($object->fields as $key => $val) {
110 if (!empty($val[
'searchall'])) {
111 $fieldstosearchall[
't.'.$key] = $val[
'label'];
116 $arrayfields = array();
117 foreach ($object->fields as $key => $val) {
119 if (!empty($val[
'visible'])) {
120 $visible = (int)
dol_eval($val[
'visible'], 1, 1,
'1');
121 $arrayfields[
't.'.$key] = array(
122 'label'=>$val[
'label'],
123 'checked'=>(($visible < 0) ? 0 : 1),
124 'enabled'=>($visible != 3 &&
dol_eval($val[
'enabled'], 1, 1,
'1')),
125 'position'=>$val[
'position'],
126 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
131 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
137 $permissiontoread = $user->hasRight(
'hrm',
'evaluation',
'read');
138 $permissiontoreadall = $user->hasRight(
'hrm',
'evaluation',
'readall');
139 $permissiontoadd = $user->hasRight(
'hrm',
'evaluation',
'write');
140 $permissiontodelete = $user->hasRight(
'hrm',
'evaluation',
'delete');
162 if (
GETPOST(
'cancel',
'alpha')) {
166 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
170 $parameters = array();
171 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
176 if (empty($reshook)) {
178 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
181 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
182 foreach ($object->fields as $key => $val) {
184 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
185 $search[$key.
'_dtstart'] =
'';
186 $search[$key.
'_dtend'] =
'';
190 $search_array_options = array();
192 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
193 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
198 $objectclass =
'Evaluation';
199 $objectlabel =
'Evaluation';
200 $uploaddir = $conf->hrm->dir_output;
201 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
216 $title = $langs->trans(
'Evaluations');
224 $sql .= $object->getFieldList(
't');
226 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
227 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
228 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
232 $parameters = array();
233 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
234 $sql .= $hookmanager->resPrint;
235 $sql = preg_replace(
'/,\s*$/',
'',
$sql);
236 $sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
237 if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
238 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
241 $parameters = array();
242 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
243 $sql .= $hookmanager->resPrint;
244 if ($object->ismultientitymanaged == 1) {
245 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
247 $sql .=
" WHERE 1 = 1";
249 foreach ($search as $key => $val) {
250 if (array_key_exists($key, $object->fields)) {
251 if ($key ==
'status' && $search[$key] == -1) {
254 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
255 if ((strpos($object->fields[$key][
'type'],
'integer:') === 0) || (strpos($object->fields[$key][
'type'],
'sellist:') === 0) || !empty($object->fields[$key][
'arrayofkeyval'])) {
256 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0', $object->fields[$key][
'arrayofkeyval'])))) {
261 if ($search[$key] !=
'') {
265 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
266 $columnName=preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
267 if (preg_match(
'/^(date|timestamp|datetime)/', $object->fields[$columnName][
'type'])) {
268 if (preg_match(
'/_dtstart$/', $key)) {
269 $sql .=
" AND t." . $columnName .
" >= '" . $db->idate($search[$key]) .
"'";
271 if (preg_match(
'/_dtend$/', $key)) {
272 $sql .=
" AND t." . $columnName .
" <= '" . $db->idate($search[$key]) .
"'";
282 if (empty($permissiontoreadall)) {
283 $sql.=
" AND t.fk_user IN(".$db->sanitize(implode(
", ", $user->getAllChildIds(1))).
") ";
288 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
290 $parameters = array();
291 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
292 $sql .= $hookmanager->resPrint;
312 $sql .= $db->order($sortfield, $sortorder);
315 $nbtotalofrecords =
'';
317 $resql = $db->query(
$sql);
318 $nbtotalofrecords = $db->num_rows($resql);
319 if (($page * $limit) > $nbtotalofrecords) {
325 if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) {
326 $num = $nbtotalofrecords;
329 $sql .= $db->plimit($limit + 1, $offset);
332 $resql = $db->query(
$sql);
338 $num = $db->num_rows($resql);
342 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
343 $obj = $db->fetch_object($resql);
345 header(
"Location: ".
dol_buildpath(
'/hrm/evaluation_card.php', 1).
'?id='.$id);
370 $arrayofselected = is_array($toselect) ? $toselect : array();
374 $param .=
'&mode='.urlencode($mode);
376 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
377 $param .=
'&contextpage='.urlencode($contextpage);
379 if ($limit > 0 && $limit != $conf->liste_limit) {
380 $param .=
'&limit='.((int) $limit);
382 foreach ($search as $key => $val) {
383 if (is_array($search[$key]) && count($search[$key])) {
384 foreach ($search[$key] as $skey) {
385 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
388 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
391 if ($optioncss !=
'') {
392 $param .=
'&optioncss='.urlencode($optioncss);
395 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
397 $parameters = array();
398 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
399 $param .= $hookmanager->resPrint;
402 $arrayofmassactions = array(
408 if ($permissiontodelete) {
409 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
411 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
412 $arrayofmassactions = array();
414 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
416 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
417 if ($optioncss !=
'') {
418 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
420 print
'<input type="hidden" name="token" value="'.newToken().
'">';
421 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
422 print
'<input type="hidden" name="action" value="list">';
423 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
424 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
425 print
'<input type="hidden" name="page" value="'.$page.
'">';
426 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
427 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
430 $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'));
431 $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'));
432 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/hrm/evaluation_card.php', 1).
'?action=create',
'', $permissiontoadd);
434 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
437 $topicmail =
"SendEvaluationRef";
438 $modelmail =
"evaluation";
440 $trackid =
'xxxx'.$object->id;
441 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
444 foreach ($fieldstosearchall as $key => $val) {
445 $fieldstosearchall[$key] = $langs->trans($val);
447 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
455 $parameters = array();
456 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
457 if (empty($reshook)) {
458 $moreforfilter .= $hookmanager->resPrint;
460 $moreforfilter = $hookmanager->resPrint;
463 if (!empty($moreforfilter)) {
464 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
465 print $moreforfilter;
469 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
470 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
471 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
473 print
'<div class="div-table-responsive">';
474 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
479 print
'<tr class="liste_titre">';
480 foreach ($object->fields as $key => $val) {
481 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
482 if ($key ==
'status') {
483 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
484 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
485 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
486 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
487 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
488 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
489 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
491 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
492 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
493 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
494 print
$form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
495 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
496 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_',
'maxwidth125', 1);
497 } elseif (!preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
498 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
499 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
500 print
'<div class="nowrap">';
501 print
$form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
503 print
'<div class="nowrap">';
504 print
$form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
511 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
514 $parameters = array(
'arrayfields'=>$arrayfields);
515 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
516 print $hookmanager->resPrint;
518 print
'<td class="liste_titre maxwidthsearch">';
519 $searchpicto =
$form->showFilterButtons();
524 $totalarray = array();
525 $totalarray[
'nbfield'] = 0;
529 print
'<tr class="liste_titre">';
530 foreach ($object->fields as $key => $val) {
531 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
532 if ($key ==
'status') {
533 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
534 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
535 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
536 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
537 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
538 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
539 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
541 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
542 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
543 $totalarray[
'nbfield']++;
547 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
549 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
550 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
551 print $hookmanager->resPrint;
553 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
554 $totalarray[
'nbfield']++;
559 $needToFetchEachLine = 0;
560 if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
561 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
562 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
563 $needToFetchEachLine++;
572 $savnbfield = $totalarray[
'nbfield'];
573 $totalarray = array();
574 $totalarray[
'nbfield'] = 0;
575 $imaxinloop = ($limit ? min($num, $limit) : $num);
576 while ($i < $imaxinloop) {
577 $obj = $db->fetch_object($resql);
583 $object->setVarsFromFetchObj($obj);
585 if ($mode ==
'kanban') {
587 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
588 print
'<div class="box-flex-container kanban">';
591 $object->date_eval = $obj->date_eval;
595 $job->fetch($obj->fk_job);
598 $userstatic =
new User($db);
599 $userstatic->fetch($obj->fk_user);
601 if ($massactionbutton || $massaction) {
603 if (in_array($object->id, $arrayofselected)) {
606 print $object->getKanbanView(
'', array(
'user'=>$userstatic->getNomUrl(1),
'job'=>$job->getNomUrl(1),
'selected' => in_array($object->id, $arrayofselected)));
608 if ($i == ($imaxinloop - 1)) {
614 print
'<tr class="oddeven">';
615 foreach ($object->fields as $key => $val) {
616 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
617 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
618 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
619 } elseif ($key ==
'status') {
620 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
623 if (in_array($val[
'type'], array(
'timestamp'))) {
624 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
625 } elseif ($key ==
'ref') {
626 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
629 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
630 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
634 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
635 print
'<td'.($cssforfield ?
' class="'.$cssforfield.
'"' :
'').
'>';
636 if ($key ==
'status') {
637 print $object->getLibStatut(5);
638 } elseif ($key ==
'rowid') {
639 print $object->showOutputField($val, $key, $object->id,
'');
641 print $object->showOutputField($val, $key, $object->$key,
'');
645 $totalarray[
'nbfield']++;
647 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
649 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
651 if (!isset($totalarray[
'val'])) {
652 $totalarray[
'val'] = array();
654 if (!isset($totalarray[
'val'][
't.'.$key])) {
655 $totalarray[
'val'][
't.'.$key] = 0;
657 $totalarray[
'val'][
't.'.$key] += $object->$key;
662 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
664 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
665 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
666 print $hookmanager->resPrint;
668 print
'<td class="nowrap center">';
669 if ($massactionbutton || $massaction) {
671 if (in_array($object->id, $arrayofselected)) {
674 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
678 $totalarray[
'nbfield']++;
688 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
693 foreach ($arrayfields as $key => $val) {
694 if (!empty($val[
'checked'])) {
698 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
704 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>
$sql);
705 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
706 print $hookmanager->resPrint;
708 print
'</table>'.
"\n";
711 print
'</form>'.
"\n";
713 if (in_array(
'builddoc', $arrayofmassactions) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
714 $hidegeneratedfilelistifempty = 1;
715 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
716 $hidegeneratedfilelistifempty = 0;
719 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
723 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
724 $urlsource .= str_replace(
'&',
'&', $param);
726 $filedir = $diroutputmassaction;
727 $genallowed = $permissiontoread;
728 $delallowed = $permissiontoadd;
730 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.
Class to manage Dolibarr users.
if(isModEnabled('facture') && $user->hasRight('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') && $user->hasRight('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)) $sql
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_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...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
dol_eval($s, $returnvalue=0, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
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.
isModEnabled($module)
Is Dolibarr module enabled.
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...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.