31require
'../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
38require_once __DIR__.
'/class/evaluation.class.php';
49$langs->loadLangs(array(
'hrm',
'other'));
52$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
53$massaction =
GETPOST(
'massaction',
'alpha');
55$confirm =
GETPOST(
'confirm',
'alpha');
56$cancel =
GETPOST(
'cancel',
'alpha');
57$toselect =
GETPOST(
'toselect',
'array');
58$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'evaluationlist';
59$backtopage =
GETPOST(
'backtopage',
'alpha');
60$optioncss =
GETPOST(
'optioncss',
'aZ');
61$mode =
GETPOST(
'mode',
'alpha');
68$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
69$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
71if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
75$offset = $limit * $page;
82$diroutputmassaction =
$conf->hrm->dir_output.
'/temp/massgeneration/'.$user->id;
83$hookmanager->initHooks(array(
'evaluationlist'));
86$extrafields->fetch_name_optionals_label(
$object->table_element);
89$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
94 $sortfield =
"t.".key(
$object->fields);
101$search_all =
GETPOST(
'search_all',
'alphanohtml');
103foreach (
$object->fields as $key => $val) {
104 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
105 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
107 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
114$fieldstosearchall = array();
115foreach (
$object->fields as $key => $val) {
116 if (!empty($val[
'searchall'])) {
117 $fieldstosearchall[
't.'.$key] = $val[
'label'];
122$arrayfields = array();
123foreach (
$object->fields as $key => $val) {
125 if (!empty($val[
'visible'])) {
126 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
127 $arrayfields[
't.'.$key] = array(
128 'label' => $val[
'label'],
129 'checked' => (($visible < 0) ? 0 : 1),
130 'enabled' => (abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
131 'position' => $val[
'position'],
132 'help' => isset($val[
'help']) ? $val[
'help'] :
''
137include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
143$permissiontoread = $user->hasRight(
'hrm',
'evaluation',
'read');
144$permissiontoreadall = $user->hasRight(
'hrm',
'evaluation',
'readall');
145$permissiontoadd = $user->hasRight(
'hrm',
'evaluation',
'write');
146$permissiontodelete = $user->hasRight(
'hrm',
'evaluation',
'delete');
149if (!isModEnabled(
'hrm')) {
154if ($user->socid > 0) {
162if (!$permissiontoread) {
172if (
GETPOST(
'cancel',
'alpha')) {
176if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
180$parameters = array();
181$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
186if (empty($reshook)) {
188 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
191 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
192 foreach (
$object->fields as $key => $val) {
194 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
195 $search[$key.
'_dtstart'] =
'';
196 $search[$key.
'_dtend'] =
'';
200 $search_array_options = array();
202 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
203 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
208 $objectclass =
'Evaluation';
209 $objectlabel =
'Evaluation';
210 $uploaddir =
$conf->hrm->dir_output;
211 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
220$form =
new Form($db);
226$title = $langs->trans(
'Evaluations');
234$sql .=
$object->getFieldList(
't');
236if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
237 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
238 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
242$parameters = array();
243$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
244$sql .= $hookmanager->resPrint;
245$sql = preg_replace(
'/,\s*$/',
'', $sql);
250$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
251if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
252 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
255$parameters = array();
256$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
257$sql .= $hookmanager->resPrint;
258if (
$object->ismultientitymanaged == 1) {
259 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element).
")";
261 $sql .=
" WHERE 1 = 1";
263foreach ($search as $key => $val) {
264 if (array_key_exists($key,
$object->fields)) {
265 if ($key ==
'status' && $search[$key] == -1) {
269 if ((strpos(
$object->fields[$key][
'type'],
'integer:') === 0) || (strpos(
$object->fields[$key][
'type'],
'sellist:') === 0) || !empty(
$object->fields[$key][
'arrayofkeyval'])) {
270 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty(
$object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0',
$object->fields[$key][
'arrayofkeyval'])))) {
275 if ($search[$key] !=
'') {
276 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
279 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
280 $columnName=preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
281 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
282 if (preg_match(
'/_dtstart$/', $key)) {
283 $sql .=
" AND t.".$db->escape($columnName).
" >= '".$db->idate($search[$key]).
"'";
285 if (preg_match(
'/_dtend$/', $key)) {
286 $sql .=
" AND t.".$db->escape($columnName).
" <= '".$db->idate($search[$key]).
"'";
293 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
296if (empty($permissiontoreadall)) {
297 $sql.=
" AND t.fk_user IN(".$db->sanitize(implode(
", ", $user->getAllChildIds(1))).
") ";
302include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
304$parameters = array();
305$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
306$sql .= $hookmanager->resPrint;
327$nbtotalofrecords =
'';
330 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
331 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
332 $resql = $db->query($sqlforcount);
334 $objforcount = $db->fetch_object($resql);
335 $nbtotalofrecords = $objforcount->nbtotalofrecords;
340 if (($page * $limit) > $nbtotalofrecords) {
348$sql .= $db->order($sortfield, $sortorder);
350 $sql .= $db->plimit($limit + 1, $offset);
353$resql = $db->query($sql);
359$num = $db->num_rows($resql);
363if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
364 $obj = $db->fetch_object($resql);
366 header(
"Location: ".
dol_buildpath(
'/hrm/evaluation_card.php', 1).
'?id='.$id);
374llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'');
391$arrayofselected = is_array($toselect) ? $toselect : array();
395 $param .=
'&mode='.urlencode($mode);
397if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
398 $param .=
'&contextpage='.urlencode($contextpage);
400if ($limit > 0 && $limit !=
$conf->liste_limit) {
401 $param .=
'&limit='.((int) $limit);
403foreach ($search as $key => $val) {
404 if (is_array($search[$key])) {
405 foreach ($search[$key] as $skey) {
407 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
410 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
411 $param .=
'&search_'.$key.
'month='.(
GETPOSTINT(
'search_'.$key.
'month'));
412 $param .=
'&search_'.$key.
'day='.(
GETPOSTINT(
'search_'.$key.
'day'));
413 $param .=
'&search_'.$key.
'year='.(
GETPOSTINT(
'search_'.$key.
'year'));
414 } elseif ($search[$key] !=
'') {
415 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
418if ($optioncss !=
'') {
419 $param .=
'&optioncss='.urlencode($optioncss);
422include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
424$parameters = array(
'param' => &$param);
425$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
426$param .= $hookmanager->resPrint;
429$arrayofmassactions = array(
435if (!empty($permissiontodelete)) {
436 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
438if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
439 $arrayofmassactions = array();
441$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
443print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
444if ($optioncss !=
'') {
445 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
447print
'<input type="hidden" name="token" value="'.newToken().
'">';
448print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
449print
'<input type="hidden" name="action" value="list">';
450print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
451print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
452print
'<input type="hidden" name="page" value="'.$page.
'">';
453print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
454print
'<input type="hidden" name="mode" value="'.$mode.
'">';
457$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'));
458$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'));
460$newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/hrm/evaluation_card.php', 1).
'?action=create',
'', $permissiontoadd);
462print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
465$topicmail =
"SendEvaluationRef";
466$modelmail =
"evaluation";
468$trackid =
'xxxx'.$object->id;
469include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
473 foreach ($fieldstosearchall as $key => $val) {
474 $fieldstosearchall[$key] = $langs->trans($val);
475 $setupstring .= $key.
"=".$val.
";";
477 print
'<!-- Search done like if HRM_EVALUATION_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
478 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
486$parameters = array();
487$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
488if (empty($reshook)) {
489 $moreforfilter .= $hookmanager->resPrint;
491 $moreforfilter = $hookmanager->resPrint;
494if (!empty($moreforfilter)) {
495 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
496 print $moreforfilter;
500$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
501$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
502$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
503$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
505print
'<div class="div-table-responsive">';
506print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
510print
'<tr class="liste_titre_filter">';
513 print
'<td class="liste_titre maxwidthsearch center">';
514 $searchpicto = $form->showFilterButtons(
'left');
518foreach (
$object->fields as $key => $val) {
519 $searchkey = empty($search[$key]) ?
'' : $search[$key];
520 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
521 if ($key ==
'status') {
522 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
523 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
524 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
525 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
526 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
527 } 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'])) {
528 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
530 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
531 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
532 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
533 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);
534 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
535 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
536 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
537 print
'<div class="nowrap">';
538 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
540 print
'<div class="nowrap">';
541 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
543 } elseif ($key ==
'lang') {
544 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
546 print $formadmin->select_language($search[$key],
'search_lang', 0,
null, 1, 0, 0,
'minwidth100imp maxwidth125', 2);
548 print
'<input type="text" class="flat maxwidth'.($val[
'type'] ==
'integer' ?
'50' :
'75').
'" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
554include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
557$parameters = array(
'arrayfields'=>$arrayfields);
558$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
559print $hookmanager->resPrint;
562 print
'<td class="liste_titre maxwidthsearch">';
563 $searchpicto = $form->showFilterButtons();
569$totalarray = array();
570$totalarray[
'nbfield'] = 0;
574print
'<tr class="liste_titre">';
577 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
578 $totalarray[
'nbfield']++;
580foreach (
$object->fields as $key => $val) {
581 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
582 if ($key ==
'status') {
583 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
584 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
585 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
586 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
587 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
588 } 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'])) {
589 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
591 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
592 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
593 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";
594 $totalarray[
'nbfield']++;
598include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
600$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
601$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
602print $hookmanager->resPrint;
605 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
606 $totalarray[
'nbfield']++;
612$needToFetchEachLine = 0;
613if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
614 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
615 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
616 $needToFetchEachLine++;
625$savnbfield = $totalarray[
'nbfield'];
626$totalarray = array();
627$totalarray[
'nbfield'] = 0;
628$imaxinloop = ($limit ? min($num, $limit) : $num);
629while ($i < $imaxinloop) {
630 $obj = $db->fetch_object($resql);
636 $object->setVarsFromFetchObj($obj);
638 if ($mode ==
'kanban') {
640 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
641 print
'<div class="box-flex-container kanban">';
644 $object->date_eval = $obj->date_eval;
648 $job->fetch($obj->fk_job);
651 $userstatic =
new User($db);
652 $userstatic->fetch($obj->fk_user);
655 if ($massactionbutton || $massaction) {
657 if (in_array(
$object->id, $arrayofselected)) {
661 print
$object->getKanbanView(
'', array(
'user'=>$userstatic->getNomUrl(-1),
'job'=>$job->getNomUrl(1),
'selected' => $selected));
662 if ($i == ($imaxinloop - 1)) {
668 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
671 print
'<td class="nowrap center">';
672 if ($massactionbutton || $massaction) {
674 if (in_array(
$object->id, $arrayofselected)) {
677 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
681 $totalarray[
'nbfield']++;
684 foreach (
$object->fields as $key => $val) {
685 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
686 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
687 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
688 } elseif ($key ==
'status') {
689 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
692 if (in_array($val[
'type'], array(
'timestamp'))) {
693 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
694 } elseif ($key ==
'ref') {
695 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
698 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
699 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
703 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
704 print
'<td'.($cssforfield ?
' class="'.$cssforfield.(preg_match(
'/tdoverflow/', $cssforfield) ?
' classfortooltip' :
'').
'"' :
'');
705 if (preg_match(
'/tdoverflow/', $cssforfield) && !is_numeric(
$object->$key)) {
706 print
' title="'.dol_escape_htmltag(
$object->$key).
'"';
709 if ($key ==
'status') {
710 print
$object->getLibStatut(5);
711 } elseif ($key ==
'rowid') {
713 } elseif ($key ==
'label') {
720 $totalarray[
'nbfield']++;
722 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
724 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
726 if (!isset($totalarray[
'val'])) {
727 $totalarray[
'val'] = array();
729 if (!isset($totalarray[
'val'][
't.'.$key])) {
730 $totalarray[
'val'][
't.'.$key] = 0;
732 $totalarray[
'val'][
't.'.$key] +=
$object->$key;
737 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
739 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
740 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
741 print $hookmanager->resPrint;
744 print
'<td class="nowrap center">';
745 if ($massactionbutton || $massaction) {
747 if (in_array(
$object->id, $arrayofselected)) {
750 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
754 $totalarray[
'nbfield']++;
764include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
769 foreach ($arrayfields as $key => $val) {
770 if (!empty($val[
'checked'])) {
774 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
780$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
781$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
782print $hookmanager->resPrint;
784print
'</table>'.
"\n";
789if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
790 $hidegeneratedfilelistifempty = 1;
791 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
792 $hidegeneratedfilelistifempty = 0;
795 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
799 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
800 $urlsource .= str_replace(
'&',
'&', $param);
802 $filedir = $diroutputmassaction;
803 $genallowed = $permissiontoread;
804 $delallowed = $permissiontoadd;
806 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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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 a 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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.