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');
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');
62$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
63$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
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_');
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'])) {
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);
121 $arrayfields[
't.'.$key] = array(
122 'label' => $val[
'label'],
123 'checked' => (($visible < 0) ? 0 : 1),
124 'enabled' => (abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 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')) {
148if ($user->socid > 0) {
156if (!$permissiontoread) {
166if (
GETPOST(
'cancel',
'alpha')) {
170if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
174$parameters = array();
175$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
180if (empty($reshook)) {
182 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
185 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
186 foreach (
$object->fields as $key => $val) {
188 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
189 $search[$key.
'_dtstart'] =
'';
190 $search[$key.
'_dtend'] =
'';
194 $search_array_options = array();
196 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
197 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
202 $objectclass =
'Evaluation';
203 $objectlabel =
'Evaluation';
204 $uploaddir = $conf->hrm->dir_output;
205 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
214$form =
new Form($db);
220$title = $langs->trans(
'Evaluations');
228$sql .=
$object->getFieldList(
't');
230if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
231 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
232 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
236$parameters = array();
237$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
238$sql .= $hookmanager->resPrint;
239$sql = preg_replace(
'/,\s*$/',
'', $sql);
244$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
245if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
246 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
249$parameters = array();
250$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
251$sql .= $hookmanager->resPrint;
252if (
$object->ismultientitymanaged == 1) {
253 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element).
")";
255 $sql .=
" WHERE 1 = 1";
257foreach ($search as $key => $val) {
258 if (array_key_exists($key,
$object->fields)) {
259 if ($key ==
'status' && $search[$key] == -1) {
263 if ((strpos(
$object->fields[$key][
'type'],
'integer:') === 0) || (strpos(
$object->fields[$key][
'type'],
'sellist:') === 0) || !empty(
$object->fields[$key][
'arrayofkeyval'])) {
264 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty(
$object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0',
$object->fields[$key][
'arrayofkeyval'])))) {
269 if ($search[$key] !=
'') {
270 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
273 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
274 $columnName=preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
275 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
276 if (preg_match(
'/_dtstart$/', $key)) {
277 $sql .=
" AND t.".$db->escape($columnName).
" >= '".$db->idate($search[$key]).
"'";
279 if (preg_match(
'/_dtend$/', $key)) {
280 $sql .=
" AND t.".$db->escape($columnName).
" <= '".$db->idate($search[$key]).
"'";
287 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
290if (empty($permissiontoreadall)) {
291 $sql.=
" AND t.fk_user IN(".$db->sanitize(implode(
", ", $user->getAllChildIds(1))).
") ";
296include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
298$parameters = array();
299$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
300$sql .= $hookmanager->resPrint;
321$nbtotalofrecords =
'';
324 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
325 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
326 $resql = $db->query($sqlforcount);
328 $objforcount = $db->fetch_object($resql);
329 $nbtotalofrecords = $objforcount->nbtotalofrecords;
334 if (($page * $limit) > $nbtotalofrecords) {
342$sql .= $db->order($sortfield, $sortorder);
344 $sql .= $db->plimit($limit + 1, $offset);
347$resql = $db->query($sql);
353$num = $db->num_rows($resql);
357if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
358 $obj = $db->fetch_object($resql);
360 header(
"Location: ".
dol_buildpath(
'/hrm/evaluation_card.php', 1).
'?id='.$id);
368llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'');
385$arrayofselected = is_array($toselect) ? $toselect : array();
389 $param .=
'&mode='.urlencode($mode);
391if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
392 $param .=
'&contextpage='.urlencode($contextpage);
394if ($limit > 0 && $limit != $conf->liste_limit) {
395 $param .=
'&limit='.((int) $limit);
397foreach ($search as $key => $val) {
398 if (is_array($search[$key])) {
399 foreach ($search[$key] as $skey) {
401 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
404 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
405 $param .=
'&search_'.$key.
'month='.(
GETPOSTINT(
'search_'.$key.
'month'));
406 $param .=
'&search_'.$key.
'day='.(
GETPOSTINT(
'search_'.$key.
'day'));
407 $param .=
'&search_'.$key.
'year='.(
GETPOSTINT(
'search_'.$key.
'year'));
408 } elseif ($search[$key] !=
'') {
409 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
412if ($optioncss !=
'') {
413 $param .=
'&optioncss='.urlencode($optioncss);
416include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
418$parameters = array(
'param' => &$param);
419$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
420$param .= $hookmanager->resPrint;
423$arrayofmassactions = array(
429if (!empty($permissiontodelete)) {
430 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
432if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
433 $arrayofmassactions = array();
435$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
437print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
438if ($optioncss !=
'') {
439 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
441print
'<input type="hidden" name="token" value="'.newToken().
'">';
442print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
443print
'<input type="hidden" name="action" value="list">';
444print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
445print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
446print
'<input type="hidden" name="page" value="'.$page.
'">';
447print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
448print
'<input type="hidden" name="mode" value="'.$mode.
'">';
451$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'));
452$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'));
454$newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/hrm/evaluation_card.php', 1).
'?action=create',
'', $permissiontoadd);
456print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
459$topicmail =
"SendEvaluationRef";
460$modelmail =
"evaluation";
462$trackid =
'xxxx'.$object->id;
463include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
467 foreach ($fieldstosearchall as $key => $val) {
468 $fieldstosearchall[$key] = $langs->trans($val);
469 $setupstring .= $key.
"=".$val.
";";
471 print
'<!-- Search done like if HRM_EVALUATION_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
472 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
480$parameters = array();
481$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
482if (empty($reshook)) {
483 $moreforfilter .= $hookmanager->resPrint;
485 $moreforfilter = $hookmanager->resPrint;
488if (!empty($moreforfilter)) {
489 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
490 print $moreforfilter;
494$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
495$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
496$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
497$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
499print
'<div class="div-table-responsive">';
500print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
504print
'<tr class="liste_titre_filter">';
507 print
'<td class="liste_titre maxwidthsearch center">';
508 $searchpicto = $form->showFilterButtons(
'left');
512foreach (
$object->fields as $key => $val) {
513 $searchkey = empty($search[$key]) ?
'' : $search[$key];
514 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
515 if ($key ==
'status') {
516 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
517 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
518 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
519 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
520 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
521 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'id',
'rowid',
'ref',
'status')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
522 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
524 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
525 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
526 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
527 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100'.($key ==
'status' ?
' search_status width100 onrightofpage' :
''), 1);
528 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
529 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
530 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
531 print
'<div class="nowrap">';
532 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
534 print
'<div class="nowrap">';
535 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
537 } elseif ($key ==
'lang') {
538 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
540 print $formadmin->select_language($search[$key],
'search_lang', 0,
null, 1, 0, 0,
'minwidth100imp maxwidth125', 2);
542 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
548include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
551$parameters = array(
'arrayfields'=>$arrayfields);
552$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
553print $hookmanager->resPrint;
556 print
'<td class="liste_titre maxwidthsearch">';
557 $searchpicto = $form->showFilterButtons();
563$totalarray = array();
564$totalarray[
'nbfield'] = 0;
568print
'<tr class="liste_titre">';
571 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
572 $totalarray[
'nbfield']++;
574foreach (
$object->fields as $key => $val) {
575 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
576 if ($key ==
'status') {
577 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
578 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
579 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
580 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
581 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
582 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'id',
'rowid',
'ref',
'status')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
583 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
585 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
586 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
587 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
''), 0, (empty($val[
'helplist']) ?
'' : $val[
'helplist'])).
"\n";
588 $totalarray[
'nbfield']++;
592include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
594$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
595$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
596print $hookmanager->resPrint;
599 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
600 $totalarray[
'nbfield']++;
606$needToFetchEachLine = 0;
607if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
608 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
609 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
610 $needToFetchEachLine++;
619$savnbfield = $totalarray[
'nbfield'];
620$totalarray = array();
621$totalarray[
'nbfield'] = 0;
622$imaxinloop = ($limit ? min($num, $limit) : $num);
623while ($i < $imaxinloop) {
624 $obj = $db->fetch_object($resql);
630 $object->setVarsFromFetchObj($obj);
632 if ($mode ==
'kanban') {
634 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
635 print
'<div class="box-flex-container kanban">';
638 $object->date_eval = $obj->date_eval;
642 $job->fetch($obj->fk_job);
645 $userstatic =
new User($db);
646 $userstatic->fetch($obj->fk_user);
649 if ($massactionbutton || $massaction) {
651 if (in_array(
$object->id, $arrayofselected)) {
655 print
$object->getKanbanView(
'', array(
'user'=>$userstatic->getNomUrl(-1),
'job'=>$job->getNomUrl(1),
'selected' => $selected));
656 if ($i == ($imaxinloop - 1)) {
662 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
665 print
'<td class="nowrap center">';
666 if ($massactionbutton || $massaction) {
668 if (in_array(
$object->id, $arrayofselected)) {
671 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
675 $totalarray[
'nbfield']++;
678 foreach (
$object->fields as $key => $val) {
679 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
680 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
681 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
682 } elseif ($key ==
'status') {
683 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
686 if (in_array($val[
'type'], array(
'timestamp'))) {
687 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
688 } elseif ($key ==
'ref') {
689 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
692 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
693 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
697 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
698 print
'<td'.($cssforfield ?
' class="'.$cssforfield.(preg_match(
'/tdoverflow/', $cssforfield) ?
' classfortooltip' :
'').
'"' :
'');
699 if (preg_match(
'/tdoverflow/', $cssforfield) && !is_numeric(
$object->$key)) {
700 print
' title="'.dol_escape_htmltag(
$object->$key).
'"';
703 if ($key ==
'status') {
704 print
$object->getLibStatut(5);
705 } elseif ($key ==
'rowid') {
707 } elseif ($key ==
'label') {
714 $totalarray[
'nbfield']++;
716 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
718 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
720 if (!isset($totalarray[
'val'])) {
721 $totalarray[
'val'] = array();
723 if (!isset($totalarray[
'val'][
't.'.$key])) {
724 $totalarray[
'val'][
't.'.$key] = 0;
726 $totalarray[
'val'][
't.'.$key] +=
$object->$key;
731 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
733 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
734 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
735 print $hookmanager->resPrint;
738 print
'<td class="nowrap center">';
739 if ($massactionbutton || $massaction) {
741 if (in_array(
$object->id, $arrayofselected)) {
744 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
748 $totalarray[
'nbfield']++;
758include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
763 foreach ($arrayfields as $key => $val) {
764 if (!empty($val[
'checked'])) {
768 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
774$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
775$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
776print $hookmanager->resPrint;
778print
'</table>'.
"\n";
783if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
784 $hidegeneratedfilelistifempty = 1;
785 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
786 $hidegeneratedfilelistifempty = 0;
789 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
793 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
794 $urlsource .= str_replace(
'&',
'&', $param);
796 $filedir = $diroutputmassaction;
797 $genallowed = $permissiontoread;
798 $delallowed = $permissiontoadd;
800 print $formfile->showdocuments(
'massfilesarea_hrm',
'', $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.
Class to manage Dolibarr users.
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.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
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_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.