25 require_once
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/recruitment/lib/recruitment_recruitmentjobposition.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/recruitment/class/recruitmentjobposition.class.php';
33 $langs->loadLangs(array(
"recruitment",
"other"));
35 $action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
36 $massaction =
GETPOST(
'massaction',
'alpha');
37 $show_files =
GETPOST(
'show_files',
'int');
38 $confirm =
GETPOST(
'confirm',
'alpha');
39 $cancel =
GETPOST(
'cancel',
'alpha');
40 $toselect =
GETPOST(
'toselect',
'array');
41 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'recruitmentjobpositionlist';
42 $backtopage =
GETPOST(
'backtopage',
'alpha');
43 $optioncss =
GETPOST(
'optioncss',
'aZ');
49 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
50 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
51 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
53 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
57 $offset = $limit * $page;
58 $pageprev = $page - 1;
59 $pagenext = $page + 1;
64 $diroutputmassaction = $conf->recruitment->dir_output.
'/temp/massgeneration/'.$user->id;
65 $hookmanager->initHooks(array(
'recruitmentjobpositionlist'));
68 $extrafields->fetch_name_optionals_label($object->table_element);
71 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
82 $search_all =
GETPOST(
'search_all',
'alphanohtml');
84 foreach ($object->fields as $key => $val) {
85 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
86 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
88 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
89 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
90 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
95 $fieldstosearchall = array();
96 foreach ($object->fields as $key => $val) {
97 if (!empty($val[
'searchall'])) {
98 $fieldstosearchall[
't.'.$key] = $val[
'label'];
103 $arrayfields = array();
104 foreach ($object->fields as $key => $val) {
106 if (!empty($val[
'visible'])) {
107 $visible = (int)
dol_eval($val[
'visible'], 1, 1,
'1');
108 $arrayfields[
't.'.$key] = array(
109 'label'=>$val[
'label'],
110 'checked'=>(($visible < 0) ? 0 : 1),
111 'enabled'=>($visible != 3 &&
dol_eval($val[
'enabled'], 1, 1,
'1')),
112 'position'=>$val[
'position'],
113 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
118 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
121 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
124 $arrayfields[
'nbapplications'] = array(
'type'=>
'integer',
'label'=>
'Applications',
'checked'=>1,
'enabled'=>1,
'position'=>90,
'csslist'=>
'right');
127 $permissiontoread = $user->rights->recruitment->recruitmentjobposition->read;
128 $permissiontoadd = $user->rights->recruitment->recruitmentjobposition->write;
129 $permissiontodelete = $user->rights->recruitment->recruitmentjobposition->delete;
135 restrictedArea($user,
'recruitment', 0,
'recruitment_recruitmentjobposition',
'recruitmentjobposition');
143 if (
GETPOST(
'cancel',
'alpha')) {
147 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
151 $parameters = array();
152 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
157 if (empty($reshook)) {
159 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
162 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
163 foreach ($object->fields as $key => $val) {
165 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
166 $search[$key.
'_dtstart'] =
'';
167 $search[$key.
'_dtend'] =
'';
171 $search_array_options = array();
173 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
174 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
179 $objectclass =
'RecruitmentJobPosition';
180 $objectlabel =
'RecruitmentJobPosition';
181 $uploaddir = $conf->recruitment->dir_output;
182 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
197 $title = $langs->trans(
'PositionsToBeFilled');
205 $sql .= $object->getFieldList(
't');
208 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
209 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
210 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
214 $parameters = array();
215 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
216 $sql .= preg_replace(
'/^,/',
'', $hookmanager->resPrint);
217 $sql = preg_replace(
'/,\s*$/',
'', $sql);
218 $sql .=
", COUNT(rc.rowid) as nbapplications";
219 $sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
220 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"recruitment_recruitmentcandidature as rc ON rc.fk_recruitmentjobposition = t.rowid";
221 if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
222 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
225 $parameters = array();
226 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
227 $sql .= $hookmanager->resPrint;
228 if ($object->ismultientitymanaged == 1) {
229 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
231 $sql .=
" WHERE 1 = 1";
233 foreach ($search as $key => $val) {
234 if (array_key_exists($key, $object->fields)) {
235 if ($key ==
'status' && $search[$key] == -1) {
238 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
239 if ((strpos($object->fields[$key][
'type'],
'integer:') === 0) || (strpos($object->fields[$key][
'type'],
'sellist:') === 0) || !empty($object->fields[$key][
'arrayofkeyval'])) {
240 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0', $object->fields[$key][
'arrayofkeyval'])))) {
245 if ($search[$key] !=
'') {
246 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
249 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
250 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
251 if (preg_match(
'/^(date|timestamp|datetime)/', $object->fields[$columnName][
'type'])) {
252 if (preg_match(
'/_dtstart$/', $key)) {
253 $sql .=
" AND t.".$db->escape($columnName).
" >= '".$db->idate($search[$key]).
"'";
255 if (preg_match(
'/_dtend$/', $key)) {
256 $sql .=
" AND t.".$db->escape($columnName).
" <= '" . $db->idate($search[$key]).
"'";
263 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
267 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
269 $parameters = array();
270 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
271 $sql .= $hookmanager->resPrint;
274 $sql .=
" GROUP BY ";
275 foreach ($object->fields as $key => $val) {
276 $sql .=
"t.".$db->escape($key).
", ";
279 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
280 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
281 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
"ef.".$key.
', ' :
'');
285 $parameters = array();
286 $reshook = $hookmanager->executeHooks(
'printFieldListGroupBy', $parameters, $object);
287 $sql .= $hookmanager->resPrint;
288 $sql = preg_replace(
'/,\s*$/',
'', $sql);
292 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
294 $resql = $db->query($sql);
318 $sql .= $db->order($sortfield, $sortorder);
320 $sql .= $db->plimit($limit + 1, $offset);
323 $resql = $db->query($sql);
329 $num = $db->num_rows(
$resql);
333 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
334 $obj = $db->fetch_object(
$resql);
336 header(
"Location: ".DOL_URL_ROOT.
'/recruitment/recruitmentjobposition_card.php?id='.$id);
346 $arrayofselected = is_array($toselect) ? $toselect : array();
350 $param .=
'&mode='.urlencode($mode);
352 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
353 $param .=
'&contextpage='.urlencode($contextpage);
355 if ($limit > 0 && $limit != $conf->liste_limit) {
356 $param .=
'&limit='.urlencode($limit);
358 foreach ($search as $key => $val) {
359 if (is_array($search[$key]) && count($search[$key])) {
360 foreach ($search[$key] as $skey) {
362 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
365 } elseif ($search[$key] !=
'') {
366 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
369 if ($optioncss !=
'') {
370 $param .=
'&optioncss='.urlencode($optioncss);
373 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
375 $parameters = array();
376 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
377 $param .= $hookmanager->resPrint;
380 $arrayofmassactions = array(
386 if ($permissiontodelete) {
387 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
389 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
390 $arrayofmassactions = array();
392 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
394 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
395 if ($optioncss !=
'') {
396 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
398 print
'<input type="hidden" name="token" value="'.newToken().
'">';
399 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
400 print
'<input type="hidden" name="action" value="list">';
401 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
402 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
404 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
405 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
408 $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'));
409 $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'));
411 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/recruitment/recruitmentjobposition_card.php', 1).
'?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
413 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'object_'.$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
416 $topicmail =
"SendRecruitmentJobPositionRef";
417 $modelmail =
"recruitmentjobposition";
419 $trackid =
'recruitmentjobposition'.$object->id;
420 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
423 foreach ($fieldstosearchall as $key => $val) {
424 $fieldstosearchall[$key] = $langs->trans($val);
426 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
434 $parameters = array();
435 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
436 if (empty($reshook)) {
437 $moreforfilter .= $hookmanager->resPrint;
439 $moreforfilter = $hookmanager->resPrint;
442 if (!empty($moreforfilter)) {
443 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
444 print $moreforfilter;
448 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
449 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
450 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
452 print
'<div class="div-table-responsive">';
453 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
458 print
'<tr class="liste_titre">';
461 print
'<td class="liste_titre maxwidthsearch">';
462 $searchpicto =
$form->showFilterButtons(
'left');
466 foreach ($object->fields as $key => $val) {
467 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
468 if ($key ==
'status') {
469 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
470 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
471 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
472 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
473 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
474 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
475 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
477 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
478 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
479 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
480 print
$form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
481 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
482 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_',
'maxwidth125', 1);
483 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
484 print
'<div class="nowrap">';
485 print
$form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
487 print
'<div class="nowrap">';
488 print
$form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
490 } elseif ($key ==
'lang') {
491 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
493 print $formadmin->select_language($search[$key],
'search_lang', 0,
null, 1, 0, 0,
'minwidth150 maxwidth200', 2);
495 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
501 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
504 $parameters = array(
'arrayfields'=>$arrayfields);
505 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
506 print $hookmanager->resPrint;
507 if (!empty($arrayfields[
'nbapplications'][
'checked'])) {
508 print
'<td class="liste_titre"></td>';
512 print
'<td class="liste_titre maxwidthsearch">';
513 $searchpicto =
$form->showFilterButtons();
519 $totalarray = array();
520 $totalarray[
'nbfield'] = 0;
524 print
'<tr class="liste_titre">';
527 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
529 foreach ($object->fields as $key => $val) {
530 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
531 if ($key ==
'status') {
532 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
533 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
534 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
535 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
536 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
537 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
538 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
540 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
541 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
542 $totalarray[
'nbfield']++;
546 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
548 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
549 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
550 print $hookmanager->resPrint;
551 if (!empty($arrayfields[
'nbapplications'][
'checked'])) {
552 print
'<th class="liste_titre right">'.$langs->trans(
"RecruitmentCandidatures").
'</th>';
553 $totalarray[
'nbfield']++;
557 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
559 $totalarray[
'nbfield']++;
564 $needToFetchEachLine = 0;
565 if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
566 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
567 if (preg_match(
'/\$object/', $val)) {
568 $needToFetchEachLine++;
577 $savnbfield = $totalarray[
'nbfield'];
578 $totalarray[
'nbfield'] = 0;
579 $imaxinloop = ($limit ? min($num, $limit) : $num);
580 while ($i < $imaxinloop) {
581 $obj = $db->fetch_object(
$resql);
587 $object->setVarsFromFetchObj($obj);
589 if ($mode ==
'kanban') {
591 print
'<tr><td colspan="'.$savnbfield.
'">';
592 print
'<div class="box-flex-container">';
595 print $object->getKanbanView(
'');
596 if ($i == ($imaxinloop - 1)) {
603 print
'<tr class="oddeven">';
606 print
'<td class="nowrap center">';
607 if ($massactionbutton || $massaction) {
609 if (in_array($object->id, $arrayofselected)) {
612 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
616 foreach ($object->fields as $key => $val) {
617 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
618 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
619 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
620 } elseif ($key ==
'status') {
621 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
624 if (in_array($val[
'type'], array(
'timestamp'))) {
625 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
626 } elseif ($key ==
'ref') {
627 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
630 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
631 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
635 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
636 print
'<td'.($cssforfield ?
' class="'.$cssforfield.
'"' :
'').
'>';
637 if ($key ==
'status') {
638 print $object->getLibStatut(5);
639 } elseif ($key ==
'rowid') {
640 print $object->showOutputField($val, $key, $object->id,
'');
642 print $object->showOutputField($val, $key, $object->$key,
'');
646 $totalarray[
'nbfield']++;
648 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
650 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
652 if (!isset($totalarray[
'val'])) {
653 $totalarray[
'val'] = array();
655 if (!isset($totalarray[
'val'][
't.'.$key])) {
656 $totalarray[
'val'][
't.'.$key] = 0;
658 $totalarray[
'val'][
't.'.$key] += $object->$key;
663 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
665 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
666 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
667 print $hookmanager->resPrint;
668 if (!empty($arrayfields[
'nbapplications'][
'checked'])) {
669 print
'<td class="right">'.$obj->nbapplications.
'</td>';
673 print
'<td class="nowrap center">';
674 if ($massactionbutton || $massaction) {
676 if (in_array($object->id, $arrayofselected)) {
679 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
684 $totalarray[
'nbfield']++;
694 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
699 foreach ($arrayfields as $key => $val) {
700 if (!empty($val[
'checked'])) {
704 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
710 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
711 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
712 print $hookmanager->resPrint;
714 print
'</table>'.
"\n";
717 print
'</form>'.
"\n";
720 $hidegeneratedfilelistifempty = 1;
721 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
722 $hidegeneratedfilelistifempty = 0;
725 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
729 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
730 $urlsource .= str_replace(
'&',
'&', $param);
732 $filedir = $diroutputmassaction;
733 $genallowed = $permissiontoread;
734 $delallowed = $permissiontoadd;
736 print $formfile->showdocuments(
'massfilesarea_recruitment',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class for RecruitmentJobPosition.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_now($mode='auto')
Return date for now.
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.
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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
$nbtotalofrecords
Count total nb of records.
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.