26require_once
'../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.
'/recruitment/lib/recruitment_recruitmentjobposition.lib.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/recruitment/class/recruitmentjobposition.class.php';
34$langs->loadLangs(array(
"recruitment",
"other"));
36$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
37$massaction =
GETPOST(
'massaction',
'alpha');
39$confirm =
GETPOST(
'confirm',
'alpha');
40$cancel =
GETPOST(
'cancel',
'alpha');
41$toselect =
GETPOST(
'toselect',
'array');
42$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'recruitmentjobpositionlist';
43$backtopage =
GETPOST(
'backtopage',
'alpha');
44$optioncss =
GETPOST(
'optioncss',
'aZ');
51$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
52$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
54if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
58$offset = $limit * $page;
65$diroutputmassaction = $conf->recruitment->dir_output.
'/temp/massgeneration/'.$user->id;
66$hookmanager->initHooks(array(
'recruitmentjobpositionlist'));
69$extrafields->fetch_name_optionals_label(
$object->table_element);
72$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
83$search_all =
GETPOST(
'search_all',
'alphanohtml');
85foreach (
$object->fields as $key => $val) {
86 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
87 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
89 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
96$fieldstosearchall = array();
97foreach (
$object->fields as $key => $val) {
98 if (!empty($val[
'searchall'])) {
99 $fieldstosearchall[
't.'.$key] = $val[
'label'];
104$arrayfields = array();
105foreach (
$object->fields as $key => $val) {
107 if (!empty($val[
'visible'])) {
108 $visible = (int)
dol_eval((
string) $val[
'visible'], 1, 1,
'1');
109 $arrayfields[
't.'.$key] = array(
110 'label'=>$val[
'label'],
111 'checked'=>(($visible < 0) ? 0 : 1),
112 'enabled'=>(abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
113 'position'=>$val[
'position'],
114 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
119include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
122include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
125$arrayfields[
'nbapplications'] = array(
'type'=>
'integer',
'label'=>
'Applications',
'checked'=>1,
'enabled'=>1,
'position'=>90,
'csslist'=>
'right');
128$permissiontoread = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'read');
129$permissiontoadd = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'write');
130$permissiontodelete = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'delete');
136restrictedArea($user,
'recruitment', 0,
'recruitment_recruitmentjobposition',
'recruitmentjobposition');
144if (
GETPOST(
'cancel',
'alpha')) {
148if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
152$parameters = array();
153$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
158if (empty($reshook)) {
160 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
163 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
164 foreach (
$object->fields as $key => $val) {
166 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
167 $search[$key.
'_dtstart'] =
'';
168 $search[$key.
'_dtend'] =
'';
172 $search_array_options = array();
174 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
175 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
180 $objectclass =
'RecruitmentJobPosition';
181 $objectlabel =
'RecruitmentJobPosition';
182 $uploaddir = $conf->recruitment->dir_output;
183 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
192$form =
new Form($db);
198$title = $langs->trans(
'PositionsToBeFilled');
206$sql .=
$object->getFieldList(
't');
209if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
210 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
211 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
215$parameters = array();
216$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
217$sql .= $hookmanager->resPrint;
218$sql = preg_replace(
'/,\s*$/',
'', $sql);
219$sql .=
", COUNT(rc.rowid) as nbapplications";
220$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
221$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"recruitment_recruitmentcandidature as rc ON rc.fk_recruitmentjobposition = t.rowid";
222if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
223 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
226$parameters = array();
227$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
228$sql .= $hookmanager->resPrint;
229if (
$object->ismultientitymanaged == 1) {
230 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element).
")";
232 $sql .=
" WHERE 1 = 1";
234foreach ($search as $key => $val) {
235 if (array_key_exists($key,
$object->fields)) {
236 if ($key ==
'status' && $search[$key] == -1) {
240 if ((strpos(
$object->fields[$key][
'type'],
'integer:') === 0) || (strpos(
$object->fields[$key][
'type'],
'sellist:') === 0) || !empty(
$object->fields[$key][
'arrayofkeyval'])) {
241 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty(
$object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0',
$object->fields[$key][
'arrayofkeyval'])))) {
246 if ($search[$key] !=
'') {
247 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
250 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
251 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
252 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
253 if (preg_match(
'/_dtstart$/', $key)) {
254 $sql .=
" AND t.".$db->escape($columnName).
" >= '".$db->idate($search[$key]).
"'";
256 if (preg_match(
'/_dtend$/', $key)) {
257 $sql .=
" AND t.".$db->escape($columnName).
" <= '" . $db->idate($search[$key]).
"'";
264 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
268include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
270$parameters = array();
271$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
272$sql .= $hookmanager->resPrint;
276foreach (
$object->fields as $key => $val) {
277 $sql .=
"t.".$db->escape($key).
", ";
280if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
281 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
282 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
"ef.".$key.
', ' :
'');
286$parameters = array();
287$reshook = $hookmanager->executeHooks(
'printFieldListGroupBy', $parameters, $object);
288$sql .= $hookmanager->resPrint;
289$sql = preg_replace(
'/,\s*$/',
'', $sql);
292$nbtotalofrecords =
'';
295 $resql = $db->query($sql);
296 $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_URL_ROOT.
'/recruitment/recruitmentjobposition_card.php?id='.$id);
345llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist');
347$arrayofselected = is_array($toselect) ? $toselect : array();
351 $param .=
'&mode='.urlencode($mode);
353if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
354 $param .=
'&contextpage='.urlencode($contextpage);
356if ($limit > 0 && $limit != $conf->liste_limit) {
357 $param .=
'&limit='.((int) $limit);
359foreach ($search as $key => $val) {
360 if (is_array($search[$key]) && count($search[$key])) {
361 foreach ($search[$key] as $skey) {
363 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
366 } elseif ($search[$key] !=
'') {
367 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
370if ($optioncss !=
'') {
371 $param .=
'&optioncss='.urlencode($optioncss);
374include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
376$parameters = array(
'param' => &$param);
377$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
378$param .= $hookmanager->resPrint;
381$arrayofmassactions = array(
387if ($permissiontodelete) {
388 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
390if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
391 $arrayofmassactions = array();
393$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
395print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
396if ($optioncss !=
'') {
397 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
399print
'<input type="hidden" name="token" value="'.newToken().
'">';
400print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
401print
'<input type="hidden" name="action" value="list">';
402print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
403print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
405print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
406print
'<input type="hidden" name="mode" value="'.$mode.
'">';
409$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'));
410$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'));
412$newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/recruitment/recruitmentjobposition_card.php', 1).
'?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
414print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
417$topicmail =
"SendRecruitmentJobPositionRef";
418$modelmail =
"recruitmentjobposition";
420$trackid =
'recruitmentjobposition'.$object->id;
421include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
424 foreach ($fieldstosearchall as $key => $val) {
425 $fieldstosearchall[$key] = $langs->trans($val);
427 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
435$parameters = array();
436$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
437if (empty($reshook)) {
438 $moreforfilter .= $hookmanager->resPrint;
440 $moreforfilter = $hookmanager->resPrint;
443if (!empty($moreforfilter)) {
444 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
445 print $moreforfilter;
449$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
450$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
451$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
453print
'<div class="div-table-responsive">';
454print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
459print
'<tr class="liste_titre">';
462 print
'<td class="liste_titre maxwidthsearch">';
463 $searchpicto = $form->showFilterButtons(
'left');
467foreach (
$object->fields as $key => $val) {
468 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
469 if ($key ==
'status') {
470 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
471 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
472 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
473 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
474 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
475 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
476 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
478 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
479 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
480 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
481 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
482 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
483 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_',
'maxwidth125', 1);
484 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
485 print
'<div class="nowrap">';
486 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
488 print
'<div class="nowrap">';
489 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
491 } elseif ($key ==
'lang') {
492 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
494 print $formadmin->select_language($search[$key],
'search_lang', 0,
null, 1, 0, 0,
'minwidth100imp maxwidth125', 2);
496 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
502include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
505$parameters = array(
'arrayfields'=>$arrayfields);
506$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
507print $hookmanager->resPrint;
508if (!empty($arrayfields[
'nbapplications'][
'checked'])) {
509 print
'<td class="liste_titre"></td>';
513 print
'<td class="liste_titre maxwidthsearch">';
514 $searchpicto = $form->showFilterButtons();
520$totalarray = array();
521$totalarray[
'nbfield'] = 0;
525print
'<tr class="liste_titre">';
528 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
529 $totalarray[
'nbfield']++;
531foreach (
$object->fields as $key => $val) {
532 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
533 if ($key ==
'status') {
534 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
535 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
536 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
537 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
538 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
539 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
540 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
542 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
543 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
544 $totalarray[
'nbfield']++;
548include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
550$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
551$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
552print $hookmanager->resPrint;
553if (!empty($arrayfields[
'nbapplications'][
'checked'])) {
554 print
'<th class="liste_titre right">'.$langs->trans(
"RecruitmentCandidatures").
'</th>';
555 $totalarray[
'nbfield']++;
559 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
560 $totalarray[
'nbfield']++;
566$needToFetchEachLine = 0;
567if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
568 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
569 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
570 $needToFetchEachLine++;
579$savnbfield = $totalarray[
'nbfield'];
580$totalarray[
'nbfield'] = 0;
581$imaxinloop = ($limit ? min($num, $limit) : $num);
582while ($i < $imaxinloop) {
583 $obj = $db->fetch_object($resql);
589 $object->setVarsFromFetchObj($obj);
590 $object->date_planned = $obj->date_planned;
592 if ($mode ==
'kanban') {
594 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
595 print
'<div class="box-flex-container kanban">';
597 if ($massactionbutton || $massaction) {
602 if ($massactionbutton || $massaction) {
604 if (in_array(
$object->id, $arrayofselected)) {
608 print
$object->getKanbanView(
'', array(
'nbapplications'=>$obj->nbapplications,
'selected' => $selected));
609 if ($i == ($imaxinloop - 1)) {
616 print
'<tr class="oddeven">';
619 print
'<td class="nowrap center">';
620 if ($massactionbutton || $massaction) {
622 if (in_array(
$object->id, $arrayofselected)) {
625 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
629 $totalarray[
'nbfield']++;
632 foreach (
$object->fields as $key => $val) {
633 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
634 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
635 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
636 } elseif ($key ==
'status') {
637 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
640 if (in_array($val[
'type'], array(
'timestamp'))) {
641 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
642 } elseif ($key ==
'ref') {
643 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
646 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
647 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
651 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
652 print
'<td'.($cssforfield ?
' class="'.$cssforfield.
'"' :
'').
'>';
653 if ($key ==
'status') {
654 print
$object->getLibStatut(5);
655 } elseif ($key ==
'rowid') {
662 $totalarray[
'nbfield']++;
664 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
666 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
668 if (!isset($totalarray[
'val'])) {
669 $totalarray[
'val'] = array();
671 if (!isset($totalarray[
'val'][
't.'.$key])) {
672 $totalarray[
'val'][
't.'.$key] = 0;
674 $totalarray[
'val'][
't.'.$key] +=
$object->$key;
679 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
681 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
682 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
683 print $hookmanager->resPrint;
684 if (!empty($arrayfields[
'nbapplications'][
'checked'])) {
685 print
'<td class="right">'.$obj->nbapplications.
'</td>';
687 $totalarray[
'nbfield']++;
692 print
'<td class="nowrap center">';
693 if ($massactionbutton || $massaction) {
695 if (in_array(
$object->id, $arrayofselected)) {
698 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
702 $totalarray[
'nbfield']++;
713include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
718 foreach ($arrayfields as $key => $val) {
719 if (!empty($val[
'checked'])) {
723 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
729$parameters = array(
'arrayfields' => $arrayfields,
'sql'=>$sql);
730$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
731print $hookmanager->resPrint;
733print
'</table>'.
"\n";
738if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
739 $hidegeneratedfilelistifempty = 1;
740 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
741 $hidegeneratedfilelistifempty = 0;
744 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
748 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
749 $urlsource .= str_replace(
'&',
'&', $param);
751 $filedir = $diroutputmassaction;
752 $genallowed = $permissiontoread;
753 $delallowed = $permissiontoadd;
755 print $formfile->showdocuments(
'massfilesarea_recruitment',
'', $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 for RecruitmentJobPosition.
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.