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/job.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') :
'joblist';
53$backtopage =
GETPOST(
'backtopage',
'alpha');
54$optioncss =
GETPOST(
'optioncss',
'aZ');
55$mode =
GETPOST(
'mode',
'alpha');
60$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
61$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
62$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
63$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
64if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
68$offset = $limit * $page;
73$object =
new Job($db);
75$diroutputmassaction = $conf->hrm->dir_output.
'/temp/massgeneration/'.$user->id;
76$hookmanager->initHooks(array(
'joblist'));
79$extrafields->fetch_name_optionals_label($object->table_element);
82$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
86 reset($object->fields);
87 $sortfield =
"t.".key($object->fields);
94$search_all =
GETPOST(
'search_all',
'alphanohtml') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml');
96foreach ($object->fields as $key => $val) {
97 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
98 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
100 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
101 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
102 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
107$fieldstosearchall = array();
108foreach ($object->fields as $key => $val) {
109 if (!empty($val[
'searchall'])) {
110 $fieldstosearchall[
't.'.$key] = $val[
'label'];
115$arrayfields = array();
116foreach ($object->fields as $key => $val) {
118 if (!empty($val[
'visible'])) {
119 $visible = (int)
dol_eval($val[
'visible'], 1);
120 $arrayfields[
't.'.$key] = array(
121 'label'=>$val[
'label'],
122 'checked'=>(($visible < 0) ? 0 : 1),
123 'enabled'=>(abs($visible) != 3 &&
dol_eval($val[
'enabled'], 1)),
124 'position'=>$val[
'position'],
125 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
130include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
136$permissiontoread = $user->rights->hrm->all->read;
137$permissiontoadd = $user->rights->hrm->all->write;
138$permissiontodelete = $user->rights->hrm->all->delete;
146if (!isModEnabled(
'hrm')) {
157if (
GETPOST(
'cancel',
'alpha')) {
161if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
165$parameters = array();
166$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
171if (empty($reshook)) {
173 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
176 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
177 foreach ($object->fields as $key => $val) {
179 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
180 $search[$key.
'_dtstart'] =
'';
181 $search[$key.
'_dtend'] =
'';
185 $search_array_options = array();
187 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
188 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
193 $objectclass =
'Job';
194 $objectlabel =
'Job';
195 $uploaddir = $conf->hrm->dir_output;
196 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
205$form =
new Form($db);
211$title = $langs->trans(
"JobsProfiles");
219$sql .= $object->getFieldList(
't');
221if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
222 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
223 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
227$parameters = array();
228$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
229$sql .= $hookmanager->resPrint;
230$sql = preg_replace(
'/,\s*$/',
'', $sql);
231$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
232if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
233 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
236$parameters = array();
237$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
238$sql .= $hookmanager->resPrint;
239if ($object->ismultientitymanaged == 1) {
240 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
242 $sql .=
" WHERE 1 = 1";
244foreach ($search as $key => $val) {
245 if (array_key_exists($key, $object->fields)) {
246 if ($key ==
'status' && $search[$key] == -1) {
249 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
250 if ((strpos($object->fields[$key][
'type'],
'integer:') === 0) || (strpos($object->fields[$key][
'type'],
'sellist:') === 0) || !empty($object->fields[$key][
'arrayofkeyval'])) {
251 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0', $object->fields[$key][
'arrayofkeyval'])))) {
256 if ($search[$key] !=
'') {
257 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
260 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
261 $columnName=preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
262 if (preg_match(
'/^(date|timestamp|datetime)/', $object->fields[$columnName][
'type'])) {
263 if (preg_match(
'/_dtstart$/', $key)) {
264 $sql .=
" AND t.".$db->escape($columnName).
" >= '".$db->idate($search[$key]).
"'";
266 if (preg_match(
'/_dtend$/', $key)) {
267 $sql .=
" AND t.".$db->escape($columnName).
" <= '".$db->idate($search[$key]).
"'";
274 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
278include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
280$parameters = array();
281$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
282$sql .= $hookmanager->resPrint;
303$nbtotalofrecords =
'';
305 $resql = $db->query($sql);
306 $nbtotalofrecords = $db->num_rows($resql);
307 if (($page * $limit) > $nbtotalofrecords) {
315$sql .= $db->order($sortfield, $sortorder);
317 $sql .= $db->plimit($limit + 1, $offset);
320$resql = $db->query($sql);
326$num = $db->num_rows($resql);
330if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
331 $obj = $db->fetch_object($resql);
333 header(
"Location: ".
dol_buildpath(
'/hrm/job_card.php', 1).
'?id='.$id);
341llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'');
358$arrayofselected = is_array($toselect) ? $toselect : array();
362 $param .=
'&mode='.urlencode($mode);
364if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
365 $param .=
'&contextpage='.urlencode($contextpage);
367if ($limit > 0 && $limit != $conf->liste_limit) {
368 $param .=
'&limit='.((int) $limit);
370foreach ($search as $key => $val) {
371 if (is_array($search[$key])) {
372 foreach ($search[$key] as $skey) {
374 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
377 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
378 $param .=
'&search_'.$key.
'month='.((int)
GETPOST(
'search_'.$key.
'month',
'int'));
379 $param .=
'&search_'.$key.
'day='.((int)
GETPOST(
'search_'.$key.
'day',
'int'));
380 $param .=
'&search_'.$key.
'year='.((int)
GETPOST(
'search_'.$key.
'year',
'int'));
381 } elseif ($search[$key] !=
'') {
382 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
385if ($optioncss !=
'') {
386 $param .=
'&optioncss='.urlencode($optioncss);
389include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
391$parameters = array();
392$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
393$param .= $hookmanager->resPrint;
396$arrayofmassactions = array(
402if (!empty($permissiontodelete)) {
403 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
405if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
406 $arrayofmassactions = array();
408$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
410print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
411if ($optioncss !=
'') {
412 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
414print
'<input type="hidden" name="token" value="'.newToken().
'">';
415print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
416print
'<input type="hidden" name="action" value="list">';
417print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
418print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
419print
'<input type="hidden" name="page" value="'.$page.
'">';
420print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
421print
'<input type="hidden" name="mode" value="'.$mode.
'">';
425$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'));
426$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'));
427$newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/hrm/job_card.php', 1).
'?action=create',
'', $permissiontoadd);
429print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
432$topicmail =
"SendJobRef";
434$objecttmp =
new Job($db);
435$trackid =
'xxxx'.$object->id;
436include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
440 foreach ($fieldstosearchall as $key => $val) {
441 $fieldstosearchall[$key] = $langs->trans($val);
442 $setupstring .= $key.
"=".$val.
";";
444 print
'<!-- Search done like if JOBPOSITION_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
445 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
453$parameters = array();
454$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
455if (empty($reshook)) {
456 $moreforfilter .= $hookmanager->resPrint;
458 $moreforfilter = $hookmanager->resPrint;
461if (!empty($moreforfilter)) {
462 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
463 print $moreforfilter;
467$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
468$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
469$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
471print
'<div class="div-table-responsive">';
472print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
477print
'<tr class="liste_titre">';
479if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
480 print
'<td class="liste_titre maxwidthsearch">';
481 $searchpicto = $form->showFilterButtons(
'left');
485foreach ($object->fields as $key => $val) {
486 $searchkey = empty($search[$key]) ?
'' : $search[$key];
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')) && !in_array($key, array(
'id',
'rowid',
'ref',
'status')) && $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_', $cssforfield.
' maxwidth125', 1);
503 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
504 print
'<div class="nowrap">';
505 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
507 print
'<div class="nowrap">';
508 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
510 } elseif ($key ==
'lang') {
511 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
513 print $formadmin->select_language($search[$key],
'search_lang', 0,
null, 1, 0, 0,
'minwidth150 maxwidth200', 2);
515 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
521include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
524$parameters = array(
'arrayfields'=>$arrayfields);
525$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
526print $hookmanager->resPrint;
528if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
529 print
'<td class="liste_titre maxwidthsearch">';
530 $searchpicto = $form->showFilterButtons();
536$totalarray = array();
537$totalarray[
'nbfield'] = 0;
541print
'<tr class="liste_titre">';
542if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
543 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
545foreach ($object->fields as $key => $val) {
546 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
547 if ($key ==
'status') {
548 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
549 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
550 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
551 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
552 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
553 } 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'])) {
554 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
556 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
557 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
558 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
559 $totalarray[
'nbfield']++;
563include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
565$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
566$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
567print $hookmanager->resPrint;
569if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
570 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
572$totalarray[
'nbfield']++;
577$needToFetchEachLine = 0;
578if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
579 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
580 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
581 $needToFetchEachLine++;
590$savnbfield = $totalarray[
'nbfield'];
591$totalarray = array();
592$totalarray[
'nbfield'] = 0;
593$imaxinloop = ($limit ? min($num, $limit) : $num);
594while ($i < $imaxinloop) {
595 $obj = $db->fetch_object($resql);
601 $object->setVarsFromFetchObj($obj);
603 if ($mode ==
'kanban') {
604 $object->deplacement = $obj->deplacement;
605 $object->description = $obj->description;
608 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
609 print
'<div class="box-flex-container kanban">';
612 print $object->getKanbanView(
'', array(
'selected' => in_array($object->id, $arrayofselected)));
613 if ($i == ($imaxinloop - 1)) {
620 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
622 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
623 print
'<td class="nowrap center">';
624 if ($massactionbutton || $massaction) {
626 if (in_array($object->id, $arrayofselected)) {
629 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
633 foreach ($object->fields as $key => $val) {
634 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
635 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
636 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
637 } elseif ($key ==
'status') {
638 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
641 if (in_array($val[
'type'], array(
'timestamp'))) {
642 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
643 } elseif ($key ==
'ref') {
644 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
647 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
648 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
652 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
653 print
'<td'.($cssforfield ?
' class="'.$cssforfield.(preg_match(
'/tdoverflow/', $cssforfield) ?
' classfortooltip' :
'').
'"' :
'');
654 if (preg_match(
'/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
655 print
' title="'.dol_escape_htmltag($object->$key).
'"';
658 if ($key ==
'status') {
659 print $object->getLibStatut(5);
660 } elseif ($key ==
'rowid') {
661 print $object->showOutputField($val, $key, $object->id,
'');
662 } elseif ($key ==
'label') {
663 print $object->getNomUrl(1);
665 print $object->showOutputField($val, $key, $object->$key,
'');
669 $totalarray[
'nbfield']++;
671 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
673 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
675 if (!isset($totalarray[
'val'])) {
676 $totalarray[
'val'] = array();
678 if (!isset($totalarray[
'val'][
't.'.$key])) {
679 $totalarray[
'val'][
't.'.$key] = 0;
681 $totalarray[
'val'][
't.'.$key] += $object->$key;
686 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
688 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
689 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
690 print $hookmanager->resPrint;
692 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
693 print
'<td class="nowrap center">';
694 if ($massactionbutton || $massaction) {
696 if (in_array($object->id, $arrayofselected)) {
699 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
704 $totalarray[
'nbfield']++;
714include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
719 foreach ($arrayfields as $key => $val) {
720 if (!empty($val[
'checked'])) {
724 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
730$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
731$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
732print $hookmanager->resPrint;
734print
'</table>'.
"\n";
739if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
740 $hidegeneratedfilelistifempty = 1;
741 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
742 $hidegeneratedfilelistifempty = 0;
745 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
749 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
750 $urlsource .= str_replace(
'&',
'&', $param);
752 $filedir = $diroutputmassaction;
753 $genallowed = $permissiontoread;
754 $delallowed = $permissiontoadd;
756 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.
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.