26require_once
'../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.
'/recruitment/lib/recruitment.lib.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/recruitmentcandidature.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/recruitment/class/recruitmentjobposition.class.php';
36$langs->loadLangs(array(
"recruitment",
"other"));
41$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
42$massaction =
GETPOST(
'massaction',
'alpha');
44$confirm =
GETPOST(
'confirm',
'alpha');
45$cancel =
GETPOST(
'cancel',
'alpha');
46$toselect =
GETPOST(
'toselect',
'array');
47$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : ((empty(
$id) && empty($ref)) ?
'recruitmentcandidaturelist' :
'recruitmentjobposition_candidature');
48$backtopage =
GETPOST(
'backtopage',
'alpha');
49$optioncss =
GETPOST(
'optioncss',
'aZ');
55$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
56$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
58if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
62$offset = $limit * $page;
69$diroutputmassaction = $conf->recruitment->dir_output.
'/temp/massgeneration/'.$user->id;
70$hookmanager->initHooks(array($contextpage));
73$extrafields->fetch_name_optionals_label(
$object->table_element);
76$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
80 $sortfield =
"t.date_creation";
87$search_all =
GETPOST(
'search_all',
'alphanohtml');
89foreach (
$object->fields as $key => $val) {
90 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
91 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
93 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
100$fieldstosearchall = array();
101foreach (
$object->fields as $key => $val) {
102 if (!empty($val[
'searchall'])) {
103 $fieldstosearchall[
't.'.$key] = $val[
'label'];
115$arrayfields = array();
116foreach (
$object->fields as $key => $val) {
118 if (!empty($val[
'visible'])) {
119 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
120 $arrayfields[
't.'.$key] = array(
121 'label' => $val[
'label'],
122 'checked' => (($visible < 0) ? 0 : 1),
123 'enabled' => (abs($visible) != 3 && (bool)
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';
134if ($id > 0 || !empty($ref)) {
135 $jobposition->fetch($id, $ref);
136 $id = $jobposition->id;
142$permissiontoread = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'read');
143$permissiontoadd = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'write');
144$permissiontodelete = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'delete');
150if ($jobposition->id > 0) {
151 $isdraft = (($jobposition->status == $jobposition::STATUS_DRAFT) ? 1 : 0);
152 $result =
restrictedArea($user,
'recruitment', $jobposition->id,
'recruitment_recruitmentjobposition',
'recruitmentjobposition',
'',
'rowid', $isdraft);
154 $result =
restrictedArea($user,
'recruitment', 0,
'recruitment_recruitmentcandidature',
'recruitmentjobposition');
163if (
GETPOST(
'cancel',
'alpha')) {
167if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
171$parameters = array();
172$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
177if (empty($reshook)) {
179 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
182 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
183 foreach (
$object->fields as $key => $val) {
185 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
186 $search[$key.
'_dtstart'] =
'';
187 $search[$key.
'_dtend'] =
'';
191 $search_array_options = array();
193 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
194 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
199 $objectclass =
'RecruitmentCandidature';
200 $objectlabel =
'RecruitmentCandidature';
201 $uploaddir = $conf->recruitment->dir_output;
202 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
211$form =
new Form($db);
217$title = $langs->trans(
'RecruitmentCandidatures');
225$sql .=
$object->getFieldList(
't');
227if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
228 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
229 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
233$parameters = array();
234$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
235$sql .= $hookmanager->resPrint;
236$sql = preg_replace(
'/,\s*$/',
'', $sql);
240$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
241if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
242 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
245$parameters = array();
246$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
247$sql .= $hookmanager->resPrint;
248if (
$object->ismultientitymanaged == 1) {
249 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element).
")";
251 $sql .=
" WHERE 1 = 1";
253foreach ($search as $key => $val) {
254 if (array_key_exists($key,
$object->fields)) {
255 if ($key ==
'status' && $search[$key] == -1) {
259 if ((strpos(
$object->fields[$key][
'type'],
'integer:') === 0) || (strpos(
$object->fields[$key][
'type'],
'sellist:') === 0) || !empty(
$object->fields[$key][
'arrayofkeyval'])) {
260 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty(
$object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0',
$object->fields[$key][
'arrayofkeyval'])))) {
265 if ($search[$key] !=
'') {
266 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
269 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
270 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
271 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
272 if (preg_match(
'/_dtstart$/', $key)) {
273 $sql .=
" AND t.".$db->escape($columnName).
" >= '".$db->idate($search[$key]).
"'";
275 if (preg_match(
'/_dtend$/', $key)) {
276 $sql .=
" AND t.".$db->escape($columnName).
" <= '" . $db->idate($search[$key]).
"'";
283 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
286 $sql .=
" AND t.fk_recruitmentjobposition = ".((int) $id);
290include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
292$parameters = array();
293$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
294$sql .= $hookmanager->resPrint;
315$nbtotalofrecords =
'';
318 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
319 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
320 $resql = $db->query($sqlforcount);
322 $objforcount = $db->fetch_object($resql);
323 $nbtotalofrecords = $objforcount->nbtotalofrecords;
328 if (($page * $limit) > $nbtotalofrecords) {
336$sql .= $db->order($sortfield, $sortorder);
338 $sql .= $db->plimit($limit + 1, $offset);
341$resql = $db->query($sql);
347$num = $db->num_rows($resql);
351if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
352 $obj = $db->fetch_object($resql);
354 header(
"Location: ".DOL_URL_ROOT.
'/recruitment/recruitmentcandidature_card.php?id='.$id);
362llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist');
367if ($jobposition->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
372 $res =
$object->fetch_optionals();
380 if ($action ==
'delete') {
381 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'DeleteRecruitmentJobPosition'), $langs->trans(
'ConfirmDeleteObject'),
'confirm_delete',
'', 0, 1);
384 if ($action ==
'deleteline') {
385 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
388 if ($action ==
'clone') {
390 $formquestion = array();
391 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneAsk',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1);
395 if ($action ==
'xxx') {
396 $formquestion = array();
407 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'XXX'), $text,
'confirm_xxx', $formquestion, 0, 1, 220);
411 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
412 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
413 if (empty($reshook)) {
414 $formconfirm .= $hookmanager->resPrint;
415 } elseif ($reshook > 0) {
416 $formconfirm = $hookmanager->resPrint;
425 $linkback =
'<a href="'.dol_buildpath(
'/recruitment/recruitmentjobposition_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
427 $morehtmlref =
'<div class="refidno">';
436 if (isModEnabled(
'project')) {
437 $langs->load(
"projects");
438 $morehtmlref .= $langs->trans(
'Project').
' ';
439 if ($permissiontoadd) {
440 if ($action !=
'classify') {
441 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a>';
443 $morehtmlref .=
' : ';
444 if ($action ==
'classify') {
446 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
447 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
448 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
449 $morehtmlref .= $formproject->select_projects(0,
$object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
450 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
451 $morehtmlref .=
'</form>';
453 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, !empty(
$object->socid) ?
$object->socid : 0,
$object->fk_project,
'none', 0, 0, 0, 1,
'',
'maxwidth300');
456 if (!empty(
$object->fk_project)) {
458 $proj->fetch(
$object->fk_project);
459 $morehtmlref .=
': '.$proj->getNomUrl();
465 $morehtmlref .=
'</div>';
468 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
471 print
'<div class="fichecenter">';
472 print
'<div class="fichehalfleft">';
473 print
'<div class="underbanner clearboth"></div>';
474 print
'<table class="border centpercent tableforfield">'.
"\n";
477 $keyforbreak =
'description';
478 unset(
$object->fields[
'fk_project']);
480 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
483 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
489 print
'<div class="clearboth"></div>';
499$arrayofselected = is_array($toselect) ? $toselect : array();
503 $param .=
'&id='.urlencode((
string) ($id));
506 $param .=
'&mode='.urlencode($mode);
508if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
509 $param .=
'&contextpage='.urlencode($contextpage);
511if ($limit > 0 && $limit != $conf->liste_limit) {
512 $param .=
'&limit='.((int) $limit);
514foreach ($search as $key => $val) {
515 if (is_array($search[$key])) {
516 foreach ($search[$key] as $skey) {
518 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
521 } elseif ($search[$key] !=
'') {
522 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
525if ($optioncss !=
'') {
526 $param .=
'&optioncss='.urlencode($optioncss);
529include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
531$parameters = array(
'param' => &$param);
532$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
533$param .= $hookmanager->resPrint;
536$arrayofmassactions = array(
537 'validate' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
542if (!empty($permissiontodelete)) {
543 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
545if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
546 $arrayofmassactions = array();
548$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
550print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
551if ($optioncss !=
'') {
552 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
554print
'<input type="hidden" name="token" value="'.newToken().
'">';
555print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
556print
'<input type="hidden" name="action" value="list">';
557print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
558print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
559print
'<input type="hidden" name="page" value="'.$page.
'">';
560print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
561print
'<input type="hidden" name="mode" value="'.$mode.
'">';
562print
'<input type="hidden" name="id" value="'.$id.
'">';
566$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'));
567$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'));
569$newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/recruitment/recruitmentcandidature_card.php', 1).
'?action=create&fk_recruitmentjobposition='.$id,
'', $permissiontoadd);
571print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
574$topicmail =
"SendRecruitmentCandidatureRef";
575$modelmail =
"recruitmentcandidature";
577$trackid =
'recruitmentapplication'.$object->id;
578include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
582 foreach ($fieldstosearchall as $key => $val) {
583 $fieldstosearchall[$key] = $langs->trans($val);
584 $setupstring .= $key.
"=".$val.
";";
586 print
'<!-- Search done like if RECRUITMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
587 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
595$parameters = array();
596$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
597if (empty($reshook)) {
598 $moreforfilter .= $hookmanager->resPrint;
600 $moreforfilter = $hookmanager->resPrint;
603if (!empty($moreforfilter)) {
604 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
605 print $moreforfilter;
609$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
610$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
611$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
613print
'<div class="div-table-responsive">';
614print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
619print
'<tr class="liste_titre_filter">';
622 print
'<td class="liste_titre maxwidthsearch center">';
623 $searchpicto = $form->showFilterButtons(
'left');
627foreach (
$object->fields as $key => $val) {
628 $searchkey = empty($search[$key]) ?
'' : $search[$key];
629 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
630 if ($key ==
'status') {
631 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
632 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
633 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
634 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
635 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
636 } 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'])) {
637 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
639 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
640 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
641 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
642 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100'.($key ==
'status' ?
' search_status width100 onrightofpage' :
''), 1);
643 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
644 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
645 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
646 print
'<div class="nowrap">';
647 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
649 print
'<div class="nowrap">';
650 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
652 } elseif ($key ==
'lang') {
653 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
655 print $formadmin->select_language($search[$key],
'search_lang', 0,
null, 1, 0, 0,
'minwidth100imp maxwidth125', 2);
657 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
663include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
666$parameters = array(
'arrayfields' => $arrayfields);
667$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
668print $hookmanager->resPrint;
671 print
'<td class="liste_titre center maxwidthsearch">';
672 $searchpicto = $form->showFilterButtons();
678$totalarray = array();
679$totalarray[
'nbfield'] = 0;
683print
'<tr class="liste_titre">';
685 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
686 $totalarray[
'nbfield']++;
688foreach (
$object->fields as $key => $val) {
689 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
690 if ($key ==
'status') {
691 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
692 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
693 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
694 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
695 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
696 } 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'])) {
697 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
699 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
700 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
701 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
''), 0, (empty($val[
'helplist']) ?
'' : $val[
'helplist'])).
"\n";
702 $totalarray[
'nbfield']++;
706include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
708$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
709$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
710print $hookmanager->resPrint;
713 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
714 $totalarray[
'nbfield']++;
720$needToFetchEachLine = 0;
721if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
722 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
723 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
724 $needToFetchEachLine++;
733$savnbfield = $totalarray[
'nbfield'];
734$totalarray = array();
735$totalarray[
'nbfield'] = 0;
736$imaxinloop = ($limit ? min($num, $limit) : $num);
737while ($i < $imaxinloop) {
738 $obj = $db->fetch_object($resql);
744 $object->setVarsFromFetchObj($obj);
746 if ($mode ==
'kanban') {
748 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
749 print
'<div class="box-flex-container kanban">';
753 $recruitment->fetch($obj->fk_recruitmentjobposition);
759 if ($massactionbutton || $massaction) {
761 if (in_array(
$object->id, $arrayofselected)) {
765 print
$object->getKanbanView(
'', array(
'jobpositionlink' => $recruitment->getNomUrl(1),
'selected' => $selected));
766 if ($i == ($imaxinloop - 1)) {
773 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
776 print
'<td class="nowrap center">';
777 if ($massactionbutton || $massaction) {
779 if (in_array(
$object->id, $arrayofselected)) {
782 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
786 $totalarray[
'nbfield']++;
789 foreach (
$object->fields as $key => $val) {
790 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
791 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
792 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
793 } elseif ($key ==
'status') {
794 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
797 if (in_array($val[
'type'], array(
'timestamp'))) {
798 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
799 } elseif ($key ==
'ref') {
800 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
803 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
804 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
808 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
809 print
'<td'.($cssforfield ?
' class="'.$cssforfield.(preg_match(
'/tdoverflow/', $cssforfield) ?
' classfortooltip' :
'').
'"' :
'');
810 if (preg_match(
'/tdoverflow/', $cssforfield) && !is_numeric(
$object->$key)) {
811 print
' title="'.dol_escape_htmltag(
$object->$key).
'"';
814 if ($key ==
'status') {
815 print
$object->getLibStatut(5);
816 } elseif ($key ==
'rowid') {
823 $totalarray[
'nbfield']++;
825 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
827 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
829 if (!isset($totalarray[
'val'])) {
830 $totalarray[
'val'] = array();
832 if (!isset($totalarray[
'val'][
't.'.$key])) {
833 $totalarray[
'val'][
't.'.$key] = 0;
835 $totalarray[
'val'][
't.'.$key] +=
$object->$key;
840 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
842 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
843 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
844 print $hookmanager->resPrint;
847 print
'<td class="nowrap center">';
848 if ($massactionbutton || $massaction) {
850 if (in_array(
$object->id, $arrayofselected)) {
853 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
857 $totalarray[
'nbfield']++;
868include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
873 foreach ($arrayfields as $key => $val) {
874 if (!empty($val[
'checked'])) {
878 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
884$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
885$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
886print $hookmanager->resPrint;
888print
'</table>'.
"\n";
893if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
894 $hidegeneratedfilelistifempty = 1;
895 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
896 $hidegeneratedfilelistifempty = 0;
899 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
903 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
904 $urlsource .= str_replace(
'&',
'&', $param);
906 $filedir = $diroutputmassaction;
907 $genallowed = $permissiontoread;
908 $delallowed = $permissiontoadd;
910 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 to manage projects.
Class for RecruitmentCandidature.
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.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
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_get_fiche_end($notab=0)
Return tab footer of a card.
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...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
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...
recruitmentjobpositionPrepareHead($object)
Prepare array of tabs for RecruitmentJobPosition.
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.