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->hasRight(
'hrm',
'all',
'read');
137$permissiontoadd = $user->hasRight(
'hrm',
'all',
'write');
138$permissiontodelete = $user->hasRight(
'hrm',
'all',
'delete');
141if ($user->socid > 0) {
148if (!isModEnabled(
'hrm')) {
151if (!$permissiontoread) {
161if (
GETPOST(
'cancel',
'alpha')) {
165if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
169$parameters = array();
170$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
175if (empty($reshook)) {
177 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
180 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
181 foreach ($object->fields as $key => $val) {
183 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
184 $search[$key.
'_dtstart'] =
'';
185 $search[$key.
'_dtend'] =
'';
189 $search_array_options = array();
191 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
192 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
197 $objectclass =
'Job';
198 $objectlabel =
'Job';
199 $uploaddir = $conf->hrm->dir_output;
200 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
209$form =
new Form($db);
215$title = $langs->trans(
"JobsProfiles");
223$sql .= $object->getFieldList(
't');
225if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
226 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
227 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
231$parameters = array();
232$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
233$sql .= $hookmanager->resPrint;
234$sql = preg_replace(
'/,\s*$/',
'', $sql);
235$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
236if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
237 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
240$parameters = array();
241$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
242$sql .= $hookmanager->resPrint;
243if ($object->ismultientitymanaged == 1) {
244 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
246 $sql .=
" WHERE 1 = 1";
248foreach ($search as $key => $val) {
249 if (array_key_exists($key, $object->fields)) {
250 if ($key ==
'status' && $search[$key] == -1) {
253 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
254 if ((strpos($object->fields[$key][
'type'],
'integer:') === 0) || (strpos($object->fields[$key][
'type'],
'sellist:') === 0) || !empty($object->fields[$key][
'arrayofkeyval'])) {
255 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0', $object->fields[$key][
'arrayofkeyval'])))) {
260 if ($search[$key] !=
'') {
261 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
264 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
265 $columnName=preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
266 if (preg_match(
'/^(date|timestamp|datetime)/', $object->fields[$columnName][
'type'])) {
267 if (preg_match(
'/_dtstart$/', $key)) {
268 $sql .=
" AND t.".$db->escape($columnName).
" >= '".$db->idate($search[$key]).
"'";
270 if (preg_match(
'/_dtend$/', $key)) {
271 $sql .=
" AND t.".$db->escape($columnName).
" <= '".$db->idate($search[$key]).
"'";
278 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
282include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
284$parameters = array();
285$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
286$sql .= $hookmanager->resPrint;
307$nbtotalofrecords =
'';
309 $resql = $db->query($sql);
310 $nbtotalofrecords = $db->num_rows($resql);
311 if (($page * $limit) > $nbtotalofrecords) {
319$sql .= $db->order($sortfield, $sortorder);
321 $sql .= $db->plimit($limit + 1, $offset);
324$resql = $db->query($sql);
330$num = $db->num_rows($resql);
334if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
335 $obj = $db->fetch_object($resql);
337 header(
"Location: ".
dol_buildpath(
'/hrm/job_card.php', 1).
'?id='.$id);
345llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'');
362$arrayofselected = is_array($toselect) ? $toselect : array();
366 $param .=
'&mode='.urlencode($mode);
368if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
369 $param .=
'&contextpage='.urlencode($contextpage);
371if ($limit > 0 && $limit != $conf->liste_limit) {
372 $param .=
'&limit='.((int) $limit);
374foreach ($search as $key => $val) {
375 if (is_array($search[$key])) {
376 foreach ($search[$key] as $skey) {
378 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
381 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
382 $param .=
'&search_'.$key.
'month='.((int)
GETPOST(
'search_'.$key.
'month',
'int'));
383 $param .=
'&search_'.$key.
'day='.((int)
GETPOST(
'search_'.$key.
'day',
'int'));
384 $param .=
'&search_'.$key.
'year='.((int)
GETPOST(
'search_'.$key.
'year',
'int'));
385 } elseif ($search[$key] !=
'') {
386 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
389if ($optioncss !=
'') {
390 $param .=
'&optioncss='.urlencode($optioncss);
393include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
395$parameters = array(
'param' => &$param);
396$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
397$param .= $hookmanager->resPrint;
400$arrayofmassactions = array(
406if (!empty($permissiontodelete)) {
407 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
409if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
410 $arrayofmassactions = array();
412$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
414print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
415if ($optioncss !=
'') {
416 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
418print
'<input type="hidden" name="token" value="'.newToken().
'">';
419print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
420print
'<input type="hidden" name="action" value="list">';
421print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
422print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
423print
'<input type="hidden" name="page" value="'.$page.
'">';
424print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
425print
'<input type="hidden" name="mode" value="'.$mode.
'">';
429$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'));
430$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanban'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss'=>
'reposition'));
432$newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/hrm/job_card.php', 1).
'?action=create',
'', $permissiontoadd);
434print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
437$topicmail =
"SendJobRef";
439$objecttmp =
new Job($db);
440$trackid =
'xxxx'.$object->id;
441include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
445 foreach ($fieldstosearchall as $key => $val) {
446 $fieldstosearchall[$key] = $langs->trans($val);
447 $setupstring .= $key.
"=".$val.
";";
449 print
'<!-- Search done like if JOBPOSITION_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
450 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
458$parameters = array();
459$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
460if (empty($reshook)) {
461 $moreforfilter .= $hookmanager->resPrint;
463 $moreforfilter = $hookmanager->resPrint;
466if (!empty($moreforfilter)) {
467 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
468 print $moreforfilter;
472$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
473$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
474$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
476print
'<div class="div-table-responsive">';
477print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
482print
'<tr class="liste_titre">';
485 print
'<td class="liste_titre maxwidthsearch">';
486 $searchpicto = $form->showFilterButtons(
'left');
490foreach ($object->fields as $key => $val) {
491 $searchkey = empty($search[$key]) ?
'' : $search[$key];
492 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
493 if ($key ==
'status') {
494 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
495 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
496 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
497 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
498 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
499 } 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'])) {
500 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
502 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
503 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
504 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
505 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
506 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
507 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth125', 1);
508 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
509 print
'<div class="nowrap">';
510 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
512 print
'<div class="nowrap">';
513 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
515 } elseif ($key ==
'lang') {
516 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
518 print $formadmin->select_language($search[$key],
'search_lang', 0,
null, 1, 0, 0,
'minwidth150 maxwidth200', 2);
520 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
526include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
529$parameters = array(
'arrayfields'=>$arrayfields);
530$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
531print $hookmanager->resPrint;
534 print
'<td class="liste_titre maxwidthsearch">';
535 $searchpicto = $form->showFilterButtons();
541$totalarray = array();
542$totalarray[
'nbfield'] = 0;
546print
'<tr class="liste_titre">';
548 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
550foreach ($object->fields as $key => $val) {
551 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
552 if ($key ==
'status') {
553 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
554 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
555 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
556 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
557 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
558 } 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'])) {
559 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
561 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
562 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
563 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
564 $totalarray[
'nbfield']++;
568include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
570$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
571$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
572print $hookmanager->resPrint;
575 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
577$totalarray[
'nbfield']++;
582$needToFetchEachLine = 0;
583if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
584 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
585 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
586 $needToFetchEachLine++;
595$savnbfield = $totalarray[
'nbfield'];
596$totalarray = array();
597$totalarray[
'nbfield'] = 0;
598$imaxinloop = ($limit ? min($num, $limit) : $num);
599while ($i < $imaxinloop) {
600 $obj = $db->fetch_object($resql);
606 $object->setVarsFromFetchObj($obj);
608 if ($mode ==
'kanban') {
609 $object->deplacement = $obj->deplacement;
610 $object->description = $obj->description;
613 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
614 print
'<div class="box-flex-container kanban">';
618 if ($massactionbutton || $massaction) {
620 if (in_array($object->id, $arrayofselected)) {
624 print $object->getKanbanView(
'', array(
'selected' => $selected));
625 if ($i == ($imaxinloop - 1)) {
632 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
635 print
'<td class="nowrap center">';
636 if ($massactionbutton || $massaction) {
638 if (in_array($object->id, $arrayofselected)) {
641 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
645 foreach ($object->fields as $key => $val) {
646 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
647 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
648 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
649 } elseif ($key ==
'status') {
650 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
653 if (in_array($val[
'type'], array(
'timestamp'))) {
654 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
655 } elseif ($key ==
'ref') {
656 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
659 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
660 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
664 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
665 print
'<td'.($cssforfield ?
' class="'.$cssforfield.(preg_match(
'/tdoverflow/', $cssforfield) ?
' classfortooltip' :
'').
'"' :
'');
666 if (preg_match(
'/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
667 print
' title="'.dol_escape_htmltag($object->$key).
'"';
670 if ($key ==
'status') {
671 print $object->getLibStatut(5);
672 } elseif ($key ==
'rowid') {
673 print $object->showOutputField($val, $key, $object->id,
'');
674 } elseif ($key ==
'label') {
675 print $object->getNomUrl(1);
677 print $object->showOutputField($val, $key, $object->$key,
'');
681 $totalarray[
'nbfield']++;
683 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
685 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
687 if (!isset($totalarray[
'val'])) {
688 $totalarray[
'val'] = array();
690 if (!isset($totalarray[
'val'][
't.'.$key])) {
691 $totalarray[
'val'][
't.'.$key] = 0;
693 $totalarray[
'val'][
't.'.$key] += $object->$key;
698 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
700 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
701 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
702 print $hookmanager->resPrint;
705 print
'<td class="nowrap center">';
706 if ($massactionbutton || $massaction) {
708 if (in_array($object->id, $arrayofselected)) {
711 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
716 $totalarray[
'nbfield']++;
726include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
731 foreach ($arrayfields as $key => $val) {
732 if (!empty($val[
'checked'])) {
736 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
742$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
743$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
744print $hookmanager->resPrint;
746print
'</table>'.
"\n";
751if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
752 $hidegeneratedfilelistifempty = 1;
753 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
754 $hidegeneratedfilelistifempty = 0;
757 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
761 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
762 $urlsource .= str_replace(
'&',
'&', $param);
764 $filedir = $diroutputmassaction;
765 $genallowed = $permissiontoread;
766 $delallowed = $permissiontoadd;
768 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 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.