27require_once
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/recruitment/lib/recruitment_recruitmentjobposition.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/recruitment/class/recruitmentjobposition.class.php';
43$langs->loadLangs(array(
"recruitment",
"other"));
45$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
46$massaction =
GETPOST(
'massaction',
'alpha');
48$confirm =
GETPOST(
'confirm',
'alpha');
49$cancel =
GETPOST(
'cancel',
'alpha');
50$toselect =
GETPOST(
'toselect',
'array:int');
51$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'recruitmentjobpositionlist';
52$backtopage =
GETPOST(
'backtopage',
'alpha');
53$optioncss =
GETPOST(
'optioncss',
'aZ');
60$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
61$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
63if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
67$offset = $limit * $page;
74$diroutputmassaction =
$conf->recruitment->dir_output.
'/temp/massgeneration/'.$user->id;
75$hookmanager->initHooks(array(
'recruitmentjobpositionlist'));
78$extrafields->fetch_name_optionals_label(
$object->table_element);
81$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
92$search_all =
GETPOST(
'search_all',
'alphanohtml');
94foreach (
$object->fields as $key => $val) {
95 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
96 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
98 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
105$fieldstosearchall = array();
106foreach (
$object->fields as $key => $val) {
107 if (!empty($val[
'searchall'])) {
108 $fieldstosearchall[
't.'.$key] = $val[
'label'];
113$arrayfields = array();
114foreach (
$object->fields as $key => $val) {
116 if (!empty($val[
'visible'])) {
117 $visible = (int)
dol_eval((
string) $val[
'visible'], 1, 1,
'1');
118 $arrayfields[
't.'.$key] = array(
119 'label' => $val[
'label'],
120 'checked' => (($visible < 0) ?
'0' :
'1'),
121 'enabled' => (
string) (int) (abs($visible) != 3 && (bool)
dol_eval((
string) $val[
'enabled'], 1)),
122 'position' => $val[
'position'],
123 'help' => isset($val[
'help']) ? $val[
'help'] :
''
128include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
130$parameters = array(
'arrayfields' => &$arrayfields);
131$reshook = $hookmanager->executeHooks(
'completeArrayFields', $parameters, $object, $action);
134include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
137$arrayfields[
'nbapplications'] = array(
'type' =>
'integer',
'label' =>
'Applications',
'checked' => 1,
'enabled' => 1,
'position' => 90,
'csslist' =>
'right');
140$permissiontoread = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'read');
141$permissiontoadd = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'write');
142$permissiontodelete = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'delete');
148restrictedArea($user,
'recruitment', 0,
'recruitment_recruitmentjobposition',
'recruitmentjobposition');
156if (
GETPOST(
'cancel',
'alpha')) {
160if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
164$parameters = array();
165$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
170if (empty($reshook)) {
172 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
175 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
176 foreach (
$object->fields as $key => $val) {
178 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
179 $search[$key.
'_dtstart'] =
'';
180 $search[$key.
'_dtend'] =
'';
184 $search_array_options = array();
186 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
187 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
192 $objectclass =
'RecruitmentJobPosition';
193 $objectlabel =
'RecruitmentJobPosition';
194 $uploaddir =
$conf->recruitment->dir_output;
195 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
210$title = $langs->trans(
'PositionsToBeFilled');
218$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 .=
", COUNT(rc.rowid) as nbapplications";
232$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
233$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"recruitment_recruitmentcandidature as rc ON rc.fk_recruitmentjobposition = t.rowid";
234if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
235 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
238$parameters = array();
239$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
240$sql .= $hookmanager->resPrint;
241if (
$object->ismultientitymanaged == 1) {
242 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element).
")";
244 $sql .=
" WHERE 1 = 1";
246foreach ($search as $key => $val) {
247 if (array_key_exists($key,
$object->fields)) {
248 if ($key ==
'status' && $search[$key] == -1) {
252 if ((strpos(
$object->fields[$key][
'type'],
'integer:') === 0) || (strpos(
$object->fields[$key][
'type'],
'sellist:') === 0) || !empty(
$object->fields[$key][
'arrayofkeyval'])) {
253 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty(
$object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0',
$object->fields[$key][
'arrayofkeyval'])))) {
258 if ($search[$key] !=
'') {
259 $sql .=
natural_search(
"t.".
$db->sanitize($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
262 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
263 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
264 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
265 if (preg_match(
'/_dtstart$/', $key)) {
266 $sql .=
" AND t.".$db->sanitize($columnName).
" >= '".
$db->idate($search[$key]).
"'";
268 if (preg_match(
'/_dtend$/', $key)) {
269 $sql .=
" AND t.".$db->sanitize($columnName).
" <= '" .
$db->idate($search[$key]).
"'";
276 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
280include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
282$parameters = array();
283$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
284$sql .= $hookmanager->resPrint;
288foreach (
$object->fields as $key => $val) {
289 $sql .=
"t.".$db->sanitize($key).
", ";
292if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
293 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
294 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
"ef.".$key.
', ' :
'');
298$parameters = array();
299$reshook = $hookmanager->executeHooks(
'printFieldListGroupBy', $parameters, $object);
300$sql .= $hookmanager->resPrint;
301$sql = preg_replace(
'/,\s*$/',
'', $sql);
304$nbtotalofrecords =
'';
307 $resql =
$db->query($sql);
308 $nbtotalofrecords =
$db->num_rows($resql);
323 if (($page * $limit) > (
int) $nbtotalofrecords) {
331$sql .=
$db->order($sortfield, $sortorder);
333 $sql .=
$db->plimit($limit + 1, $offset);
336$resql =
$db->query($sql);
342$num =
$db->num_rows($resql);
346if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
347 $obj =
$db->fetch_object($resql);
349 header(
"Location: ".DOL_URL_ROOT.
'/recruitment/recruitmentjobposition_card.php?id='.$id);
357llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist');
359$arrayofselected = is_array($toselect) ? $toselect : array();
363 $param .=
'&mode='.urlencode($mode);
365if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
366 $param .=
'&contextpage='.urlencode($contextpage);
368if ($limit > 0 && $limit !=
$conf->liste_limit) {
369 $param .=
'&limit='.((int) $limit);
371foreach ($search as $key => $val) {
372 if (is_array($search[$key]) && count($search[$key])) {
373 foreach ($search[$key] as $skey) {
375 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
378 } elseif ($search[$key] !=
'') {
379 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
382if ($optioncss !=
'') {
383 $param .=
'&optioncss='.urlencode($optioncss);
386include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
388$parameters = array(
'param' => &$param);
389$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
390$param .= $hookmanager->resPrint;
393$arrayofmassactions = array(
399if ($permissiontodelete) {
400 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
402if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
403 $arrayofmassactions = array();
405$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
407print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
408if ($optioncss !=
'') {
409 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
411print
'<input type="hidden" name="token" value="'.newToken().
'">';
412print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
413print
'<input type="hidden" name="action" value="list">';
414print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
415print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
417print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
418print
'<input type="hidden" name="mode" value="'.$mode.
'">';
421$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'));
422$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'));
424$newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/recruitment/recruitmentjobposition_card.php', 1).
'?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
426print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
429$topicmail =
"SendRecruitmentJobPositionRef";
430$modelmail =
"recruitmentjobposition";
432$trackid =
'recruitmentjobposition'.$object->id;
433include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
436 foreach ($fieldstosearchall as $key => $val) {
437 $fieldstosearchall[$key] = $langs->trans($val);
439 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
447$parameters = array();
448$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
449if (empty($reshook)) {
450 $moreforfilter .= $hookmanager->resPrint;
452 $moreforfilter = $hookmanager->resPrint;
455if (!empty($moreforfilter)) {
456 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
457 print $moreforfilter;
461$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
462$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
463$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
465print
'<div class="div-table-responsive">';
466print
'<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
471print
'<tr class="liste_titre_filter">';
473if (
$conf->main_checkbox_left_column) {
474 print
'<td class="liste_titre maxwidthsearch">';
475 $searchpicto = $form->showFilterButtons(
'left');
479foreach (
$object->fields as $key => $val) {
480 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
481 if ($key ==
'status') {
482 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
483 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
484 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
485 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
486 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
487 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
488 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
490 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
491 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
492 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
493 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
494 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
495 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_',
'maxwidth125', 1);
496 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
497 print
'<div class="nowrap">';
498 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
500 print
'<div class="nowrap">';
501 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
503 } elseif ($key ==
'lang') {
504 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
506 print $formadmin->select_language($search[$key],
'search_lang', 0, array(), 1, 0, 0,
'minwidth100imp maxwidth125', 2);
508 print
'<input type="text" class="flat maxwidth'.($val[
'type'] ==
'integer' ?
'50' :
'75').
'" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
514include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
517$parameters = array(
'arrayfields' => $arrayfields);
518$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
519print $hookmanager->resPrint;
520if (!empty($arrayfields[
'nbapplications'][
'checked'])) {
521 print
'<td class="liste_titre"></td>';
524if (!
$conf->main_checkbox_left_column) {
525 print
'<td class="liste_titre maxwidthsearch">';
526 $searchpicto = $form->showFilterButtons();
537print
'<tr class="liste_titre">';
539if (
$conf->main_checkbox_left_column) {
540 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
543foreach (
$object->fields as $key => $val) {
544 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
545 if ($key ==
'status') {
546 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
547 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
548 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
549 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
550 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
551 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
552 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
554 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
555 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
560include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
562$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
563$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
564print $hookmanager->resPrint;
565if (!empty($arrayfields[
'nbapplications'][
'checked'])) {
566 print
'<th class="liste_titre right">'.$langs->trans(
"RecruitmentCandidatures").
'</th>';
570if (!
$conf->main_checkbox_left_column) {
571 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
578$needToFetchEachLine = 0;
579if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
580 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
581 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
582 $needToFetchEachLine++;
593$imaxinloop = ($limit ? min($num, $limit) : $num);
594while ($i < $imaxinloop) {
595 $obj =
$db->fetch_object($resql);
601 $object->setVarsFromFetchObj($obj);
602 $object->date_planned = $obj->date_planned;
604 if ($mode ==
'kanban') {
606 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
607 print
'<div class="box-flex-container kanban">';
609 if ($massactionbutton || $massaction) {
614 if ($massactionbutton || $massaction) {
616 if (in_array(
$object->id, $arrayofselected)) {
620 print
$object->getKanbanView(
'', array(
'nbapplications' => $obj->nbapplications,
'selected' => $selected));
621 if ($i == ($imaxinloop - 1)) {
628 print
'<tr class="oddeven">';
630 if (
$conf->main_checkbox_left_column) {
631 print
'<td class="nowrap center">';
632 if ($massactionbutton || $massaction) {
634 if (in_array(
$object->id, $arrayofselected)) {
637 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
644 foreach (
$object->fields as $key => $val) {
645 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
646 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
647 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
648 } elseif ($key ==
'status') {
649 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
652 if (in_array($val[
'type'], array(
'timestamp'))) {
653 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
654 } elseif ($key ==
'ref') {
655 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
658 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
659 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
663 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
664 print
'<td'.($cssforfield ?
' class="'.$cssforfield.
'"' :
'').
'>';
665 if ($key ==
'status') {
666 print
$object->getLibStatut(5);
667 } elseif ($key ==
'rowid') {
668 print
$object->showOutputField($val, $key, (
string)
$object->id,
'');
676 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
680 if (!isset($totalarray[
'val'])) {
683 if (!isset($totalarray[
'val'][
't.'.$key])) {
691 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
693 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
694 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
695 print $hookmanager->resPrint;
696 if (!empty($arrayfields[
'nbapplications'][
'checked'])) {
697 print
'<td class="right">'.$obj->nbapplications.
'</td>';
703 if (!
$conf->main_checkbox_left_column) {
704 print
'<td class="nowrap center">';
705 if ($massactionbutton || $massaction) {
707 if (in_array(
$object->id, $arrayofselected)) {
710 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
725include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
730 foreach ($arrayfields as $key => $val) {
731 if (!empty($val[
'checked'])) {
735 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
741$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
742$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
743print $hookmanager->resPrint;
745print
'</table>'.
"\n";
750if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
751 $hidegeneratedfilelistifempty = 1;
752 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
753 $hidegeneratedfilelistifempty = 0;
756 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
760 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
761 $urlsource .= str_replace(
'&',
'&', $param);
763 $filedir = $diroutputmassaction;
764 $genallowed = $permissiontoread;
765 $delallowed = $permissiontoadd;
767 print $formfile->showdocuments(
'massfilesarea_recruitment',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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_now($mode='gmt')
Return date for now.
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...
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
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...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
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.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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...
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
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.