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);
121 $arrayfields[
't.'.$key] = array(
122 'label'=>$val[
'label'],
123 'checked'=>(($visible < 0) ? 0 : 1),
124 'enabled'=>(abs($visible) != 3 &&
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) {
262 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
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='.((int)
GETPOST(
'search_'.$key.
'month',
'int'));
406 $param .=
'&search_'.$key.
'day='.((int)
GETPOST(
'search_'.$key.
'day',
'int'));
407 $param .=
'&search_'.$key.
'year='.((int)
GETPOST(
'search_'.$key.
'year',
'int'));
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 (
GETPOST(
'nomassaction',
'int') || 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).join(
', ', $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;
491 $parameters = array(
'type'=>$type);
492 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
493 print $hookmanager->resPrint;
497$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
498$selectedfields = ($mode !=
'kanban' ? $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
'')) :
'');
499$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
501print
'<div class="div-table-responsive">';
502print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
506print
'<tr class="liste_titre_filter">';
509 print
'<td class="liste_titre maxwidthsearch center">';
510 $searchpicto = $form->showFilterButtons(
'left');
514foreach ($object->fields as $key => $val) {
515 $searchkey = empty($search[$key]) ?
'' : $search[$key];
516 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
517 if ($key ==
'status') {
518 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
519 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
520 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
521 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
522 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
523 } 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'])) {
524 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
526 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
527 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
528 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
529 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);
530 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
531 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
532 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
533 print
'<div class="nowrap">';
534 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
536 print
'<div class="nowrap">';
537 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
539 } elseif ($key ==
'lang') {
540 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
542 print $formadmin->select_language($search[$key],
'search_lang', 0,
null, 1, 0, 0,
'minwidth150 maxwidth200', 2);
544 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
550include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
553$parameters = array(
'arrayfields'=>$arrayfields);
554$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
555print $hookmanager->resPrint;
558 print
'<td class="liste_titre maxwidthsearch">';
559 $searchpicto = $form->showFilterButtons();
565$totalarray = array();
566$totalarray[
'nbfield'] = 0;
570print
'<tr class="liste_titre">';
573 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
574 $totalarray[
'nbfield']++;
576foreach ($object->fields as $key => $val) {
577 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
578 if ($key ==
'status') {
579 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
580 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
581 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
582 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
583 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
584 } 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'])) {
585 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
587 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
588 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
589 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";
590 $totalarray[
'nbfield']++;
594include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
596$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
597$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
598print $hookmanager->resPrint;
601 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
602 $totalarray[
'nbfield']++;
608$needToFetchEachLine = 0;
609if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
610 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
611 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
612 $needToFetchEachLine++;
621$savnbfield = $totalarray[
'nbfield'];
622$totalarray = array();
623$totalarray[
'nbfield'] = 0;
624$imaxinloop = ($limit ? min($num, $limit) : $num);
625while ($i < $imaxinloop) {
626 $obj = $db->fetch_object($resql);
632 $object->setVarsFromFetchObj($obj);
634 if ($mode ==
'kanban') {
636 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
637 print
'<div class="box-flex-container kanban">';
640 $object->date_eval = $obj->date_eval;
644 $job->fetch($obj->fk_job);
647 $userstatic =
new User($db);
648 $userstatic->fetch($obj->fk_user);
651 if ($massactionbutton || $massaction) {
653 if (in_array($object->id, $arrayofselected)) {
657 print $object->getKanbanView(
'', array(
'user'=>$userstatic->getNomUrl(-1),
'job'=>$job->getNomUrl(1),
'selected' => $selected));
658 if ($i == ($imaxinloop - 1)) {
664 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
667 print
'<td class="nowrap center">';
668 if ($massactionbutton || $massaction) {
670 if (in_array($object->id, $arrayofselected)) {
673 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
677 $totalarray[
'nbfield']++;
680 foreach ($object->fields as $key => $val) {
681 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
682 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
683 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
684 } elseif ($key ==
'status') {
685 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
688 if (in_array($val[
'type'], array(
'timestamp'))) {
689 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
690 } elseif ($key ==
'ref') {
691 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
694 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
695 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
699 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
700 print
'<td'.($cssforfield ?
' class="'.$cssforfield.(preg_match(
'/tdoverflow/', $cssforfield) ?
' classfortooltip' :
'').
'"' :
'');
701 if (preg_match(
'/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
702 print
' title="'.dol_escape_htmltag($object->$key).
'"';
705 if ($key ==
'status') {
706 print $object->getLibStatut(5);
707 } elseif ($key ==
'rowid') {
708 print $object->showOutputField($val, $key, $object->id,
'');
709 } elseif ($key ==
'label') {
710 print $object->getNomUrl(1);
712 print $object->showOutputField($val, $key, $object->$key,
'');
716 $totalarray[
'nbfield']++;
718 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
720 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
722 if (!isset($totalarray[
'val'])) {
723 $totalarray[
'val'] = array();
725 if (!isset($totalarray[
'val'][
't.'.$key])) {
726 $totalarray[
'val'][
't.'.$key] = 0;
728 $totalarray[
'val'][
't.'.$key] += $object->$key;
733 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
735 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
736 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
737 print $hookmanager->resPrint;
740 print
'<td class="nowrap center">';
741 if ($massactionbutton || $massaction) {
743 if (in_array($object->id, $arrayofselected)) {
746 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
750 $totalarray[
'nbfield']++;
760include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
765 foreach ($arrayfields as $key => $val) {
766 if (!empty($val[
'checked'])) {
770 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
776$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
777$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
778print $hookmanager->resPrint;
780print
'</table>'.
"\n";
785if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
786 $hidegeneratedfilelistifempty = 1;
787 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
788 $hidegeneratedfilelistifempty = 0;
791 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
795 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
796 $urlsource .= str_replace(
'&',
'&', $param);
798 $filedir = $diroutputmassaction;
799 $genallowed = $permissiontoread;
800 $delallowed = $permissiontoadd;
802 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 a 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.
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.
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.