30require
'../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
37require_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');
64$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
65if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
69$offset = $limit * $page;
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');
97foreach ($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();
109foreach ($object->fields as $key => $val) {
110 if (!empty($val[
'searchall'])) {
111 $fieldstosearchall[
't.'.$key] = $val[
'label'];
116$arrayfields = array();
117foreach ($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'] :
''
131include 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');
143if (!isModEnabled(
'hrm')) {
162if (
GETPOST(
'cancel',
'alpha')) {
166if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
170$parameters = array();
171$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
176if (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';
210$form =
new Form($db);
216$title = $langs->trans(
'Evaluations');
224$sql .= $object->getFieldList(
't');
226if (!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";
237if (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;
244if ($object->ismultientitymanaged == 1) {
245 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
247 $sql .=
" WHERE 1 = 1";
249foreach ($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] !=
'') {
262 $sql .=
natural_search($key, $search[$key], (($key ==
'status') ? 2 : $mode_search));
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]) .
"'";
279 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
282if (empty($permissiontoreadall)) {
283 $sql.=
" AND t.fk_user IN(".$db->sanitize(implode(
", ", $user->getAllChildIds(1))).
") ";
288include 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) {
325if (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);
342if ($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);
353llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'');
370$arrayofselected = is_array($toselect) ? $toselect : array();
374 $param .=
'&mode='.urlencode($mode);
376if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
377 $param .=
'&contextpage='.urlencode($contextpage);
379if ($limit > 0 && $limit != $conf->liste_limit) {
380 $param .=
'&limit='.((int) $limit);
382foreach ($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]);
391if ($optioncss !=
'') {
392 $param .=
'&optioncss='.urlencode($optioncss);
395include 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(
408if ($permissiontodelete) {
409 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
411if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
412 $arrayofmassactions = array();
414$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
416print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
417if ($optioncss !=
'') {
418 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
420print
'<input type="hidden" name="token" value="'.newToken().
'">';
421print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
422print
'<input type="hidden" name="action" value="list">';
423print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
424print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
425print
'<input type="hidden" name="page" value="'.$page.
'">';
426print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
427print
'<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);
434print_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;
441include 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);
457if (empty($reshook)) {
458 $moreforfilter .= $hookmanager->resPrint;
460 $moreforfilter = $hookmanager->resPrint;
463if (!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 = ($mode !=
'kanban' ? $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
'')) :
'');
471$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
473print
'<div class="div-table-responsive">';
474print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
478print
'<tr class="liste_titre">';
481 print
'<td class="liste_titre maxwidthsearch">';
482 $searchpicto = $form->showFilterButtons();
486foreach ($object->fields as $key => $val) {
487 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
488 if ($key ==
'status') {
489 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
490 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
491 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
492 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
493 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
494 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
495 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
497 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
498 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
499 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
500 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
501 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
502 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_',
'maxwidth125', 1);
503 } elseif (!preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
504 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
505 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
506 print
'<div class="nowrap">';
507 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
509 print
'<div class="nowrap">';
510 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
517include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
520$parameters = array(
'arrayfields'=>$arrayfields);
521$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
522print $hookmanager->resPrint;
525 print
'<td class="liste_titre maxwidthsearch">';
526 $searchpicto = $form->showFilterButtons();
532$totalarray = array();
533$totalarray[
'nbfield'] = 0;
537print
'<tr class="liste_titre">';
540 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
541 $totalarray[
'nbfield']++;
543foreach ($object->fields as $key => $val) {
544 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
545 if ($key ==
'status') {
546 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
547 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
548 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
549 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
550 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
551 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
552 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
554 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
555 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
556 $totalarray[
'nbfield']++;
560include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
562$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
563$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
564print $hookmanager->resPrint;
567 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
568 $totalarray[
'nbfield']++;
574$needToFetchEachLine = 0;
575if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
576 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
577 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
578 $needToFetchEachLine++;
587$savnbfield = $totalarray[
'nbfield'];
588$totalarray = array();
589$totalarray[
'nbfield'] = 0;
590$imaxinloop = ($limit ? min($num, $limit) : $num);
591while ($i < $imaxinloop) {
592 $obj = $db->fetch_object($resql);
598 $object->setVarsFromFetchObj($obj);
600 if ($mode ==
'kanban') {
602 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
603 print
'<div class="box-flex-container kanban">';
606 $object->date_eval = $obj->date_eval;
610 $job->fetch($obj->fk_job);
613 $userstatic =
new User($db);
614 $userstatic->fetch($obj->fk_user);
616 if ($massactionbutton || $massaction) {
618 if (in_array($object->id, $arrayofselected)) {
622 print $object->getKanbanView(
'', array(
'user'=>$userstatic->getNomUrl(-1),
'job'=>$job->getNomUrl(1),
'selected' => $selected));
623 if ($i == ($imaxinloop - 1)) {
629 print
'<tr class="oddeven">';
632 print
'<td class="nowrap center">';
633 if ($massactionbutton || $massaction) {
635 if (in_array($object->id, $arrayofselected)) {
638 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
642 $totalarray[
'nbfield']++;
645 foreach ($object->fields as $key => $val) {
646 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
647 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
648 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
649 } elseif ($key ==
'status') {
650 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
653 if (in_array($val[
'type'], array(
'timestamp'))) {
654 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
655 } elseif ($key ==
'ref') {
656 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
659 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
660 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
664 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
665 print
'<td'.($cssforfield ?
' class="'.$cssforfield.
'"' :
'').
'>';
666 if ($key ==
'status') {
667 print $object->getLibStatut(5);
668 } elseif ($key ==
'rowid') {
669 print $object->showOutputField($val, $key, $object->id,
'');
671 print $object->showOutputField($val, $key, $object->$key,
'');
675 $totalarray[
'nbfield']++;
677 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
679 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
681 if (!isset($totalarray[
'val'])) {
682 $totalarray[
'val'] = array();
684 if (!isset($totalarray[
'val'][
't.'.$key])) {
685 $totalarray[
'val'][
't.'.$key] = 0;
687 $totalarray[
'val'][
't.'.$key] += $object->$key;
692 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
694 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
695 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
696 print $hookmanager->resPrint;
699 print
'<td class="nowrap center">';
700 if ($massactionbutton || $massaction) {
702 if (in_array($object->id, $arrayofselected)) {
705 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
709 $totalarray[
'nbfield']++;
719include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
724 foreach ($arrayfields as $key => $val) {
725 if (!empty($val[
'checked'])) {
729 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
735$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
736$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
737print $hookmanager->resPrint;
739print
'</table>'.
"\n";
744if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
745 $hidegeneratedfilelistifempty = 1;
746 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
747 $hidegeneratedfilelistifempty = 0;
750 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
754 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
755 $urlsource .= str_replace(
'&',
'&', $param);
757 $filedir = $diroutputmassaction;
758 $genallowed = $permissiontoread;
759 $delallowed = $permissiontoadd;
761 print $formfile->showdocuments(
'massfilesarea_hrm',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
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.
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.
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...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.