25require_once
'../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.
'/recruitment/lib/recruitment.lib.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/recruitmentcandidature.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/recruitment/class/recruitmentjobposition.class.php';
35$langs->loadLangs(array(
"recruitment",
"other"));
40$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
41$massaction =
GETPOST(
'massaction',
'alpha');
42$show_files =
GETPOST(
'show_files',
'int');
43$confirm =
GETPOST(
'confirm',
'alpha');
44$cancel =
GETPOST(
'cancel',
'alpha');
45$toselect =
GETPOST(
'toselect',
'array');
46$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : ((empty($id) && empty($ref)) ?
'recruitmentcandidaturelist' :
'recruitmentjobposition_candidature');
47$backtopage =
GETPOST(
'backtopage',
'alpha');
48$optioncss =
GETPOST(
'optioncss',
'aZ');
50$lineid =
GETPOST(
'lineid',
'int');
53$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
54$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
55$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
56$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
57if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
61$offset = $limit * $page;
68$diroutputmassaction = $conf->recruitment->dir_output.
'/temp/massgeneration/'.$user->id;
69$hookmanager->initHooks(array($contextpage));
72$extrafields->fetch_name_optionals_label($object->table_element);
75$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
79 $sortfield =
"t.date_creation";
86$search_all =
GETPOST(
'search_all',
'alphanohtml');
88foreach ($object->fields as $key => $val) {
89 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
90 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
92 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
93 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
94 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
99$fieldstosearchall = array();
100foreach ($object->fields as $key => $val) {
101 if (!empty($val[
'searchall'])) {
102 $fieldstosearchall[
't.'.$key] = $val[
'label'];
114$arrayfields = array();
115foreach ($object->fields as $key => $val) {
117 if (!empty($val[
'visible'])) {
118 $visible = (int)
dol_eval($val[
'visible'], 1);
119 $arrayfields[
't.'.$key] = array(
120 'label'=>$val[
'label'],
121 'checked'=>(($visible < 0) ? 0 : 1),
122 'enabled'=>(abs($visible) != 3 &&
dol_eval($val[
'enabled'], 1)),
123 'position'=>$val[
'position'],
124 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
129include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
133if ($id > 0 || !empty($ref)) {
134 $jobposition->fetch($id, $ref);
135 $id = $jobposition->id;
141$permissiontoread = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'read');
142$permissiontoadd = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'write');
143$permissiontodelete = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'delete');
149if ($jobposition->id > 0) {
150 $isdraft = (($jobposition->status == $jobposition::STATUS_DRAFT) ? 1 : 0);
151 $result =
restrictedArea($user,
'recruitment', $jobposition->id,
'recruitment_recruitmentjobposition',
'recruitmentjobposition',
'',
'rowid', $isdraft);
153 $result =
restrictedArea($user,
'recruitment', 0,
'recruitment_recruitmentcandidature',
'recruitmentjobposition');
162if (
GETPOST(
'cancel',
'alpha')) {
166if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
170$parameters = array();
171$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
176if (empty($reshook)) {
178 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
181 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
182 foreach ($object->fields as $key => $val) {
184 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
185 $search[$key.
'_dtstart'] =
'';
186 $search[$key.
'_dtend'] =
'';
190 $search_array_options = array();
192 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
193 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
198 $objectclass =
'RecruitmentCandidature';
199 $objectlabel =
'RecruitmentCandidature';
200 $uploaddir = $conf->recruitment->dir_output;
201 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
210$form =
new Form($db);
216$title = $langs->trans(
'RecruitmentCandidatures');
224$sql .= $object->getFieldList(
't');
226if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
227 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
228 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
232$parameters = array();
233$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
234$sql .= $hookmanager->resPrint;
235$sql = preg_replace(
'/,\s*$/',
'', $sql);
239$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
240if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
241 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
244$parameters = array();
245$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
246$sql .= $hookmanager->resPrint;
247if ($object->ismultientitymanaged == 1) {
248 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
250 $sql .=
" WHERE 1 = 1";
252foreach ($search as $key => $val) {
253 if (array_key_exists($key, $object->fields)) {
254 if ($key ==
'status' && $search[$key] == -1) {
257 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
258 if ((strpos($object->fields[$key][
'type'],
'integer:') === 0) || (strpos($object->fields[$key][
'type'],
'sellist:') === 0) || !empty($object->fields[$key][
'arrayofkeyval'])) {
259 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0', $object->fields[$key][
'arrayofkeyval'])))) {
264 if ($search[$key] !=
'') {
265 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
268 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
269 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
270 if (preg_match(
'/^(date|timestamp|datetime)/', $object->fields[$columnName][
'type'])) {
271 if (preg_match(
'/_dtstart$/', $key)) {
272 $sql .=
" AND t.".$db->escape($columnName).
" >= '".$db->idate($search[$key]).
"'";
274 if (preg_match(
'/_dtend$/', $key)) {
275 $sql .=
" AND t.".$db->escape($columnName).
" <= '" . $db->idate($search[$key]).
"'";
282 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
285 $sql .=
" AND t.fk_recruitmentjobposition = ".((int) $id);
289include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
291$parameters = array();
292$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
293$sql .= $hookmanager->resPrint;
314$nbtotalofrecords =
'';
317 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
318 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
319 $resql = $db->query($sqlforcount);
321 $objforcount = $db->fetch_object($resql);
322 $nbtotalofrecords = $objforcount->nbtotalofrecords;
327 if (($page * $limit) > $nbtotalofrecords) {
335$sql .= $db->order($sortfield, $sortorder);
337 $sql .= $db->plimit($limit + 1, $offset);
340$resql = $db->query($sql);
346$num = $db->num_rows($resql);
350if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
351 $obj = $db->fetch_object($resql);
353 header(
"Location: ".DOL_URL_ROOT.
'/recruitment/recruitmentcandidature_card.php?id='.$id);
361llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist');
366if ($jobposition->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
367 $savobject = $object;
369 $object = $jobposition;
371 $res = $object->fetch_optionals();
374 print
dol_get_fiche_head($head,
'candidatures', $langs->trans(
"RecruitmentCandidatures"), -1, $object->picto);
379 if ($action ==
'delete') {
380 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'DeleteRecruitmentJobPosition'), $langs->trans(
'ConfirmDeleteObject'),
'confirm_delete',
'', 0, 1);
383 if ($action ==
'deleteline') {
384 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
387 if ($action ==
'clone') {
389 $formquestion = array();
390 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneAsk', $object->ref),
'confirm_clone', $formquestion,
'yes', 1);
394 if ($action ==
'xxx') {
395 $formquestion = array();
406 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'XXX'), $text,
'confirm_xxx', $formquestion, 0, 1, 220);
410 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
411 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
412 if (empty($reshook)) {
413 $formconfirm .= $hookmanager->resPrint;
414 } elseif ($reshook > 0) {
415 $formconfirm = $hookmanager->resPrint;
424 $linkback =
'<a href="'.dol_buildpath(
'/recruitment/recruitmentjobposition_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
426 $morehtmlref =
'<div class="refidno">';
435 if (isModEnabled(
'project')) {
436 $langs->load(
"projects");
437 $morehtmlref .= $langs->trans(
'Project').
' ';
438 if ($permissiontoadd) {
439 if ($action !=
'classify') {
440 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.newToken().
'&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a>';
442 $morehtmlref .=
' : ';
443 if ($action ==
'classify') {
445 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
446 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
447 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
448 $morehtmlref .= $formproject->select_projects(0, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
449 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
450 $morehtmlref .=
'</form>';
452 $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');
455 if (!empty($object->fk_project)) {
457 $proj->fetch($object->fk_project);
458 $morehtmlref .=
': '.$proj->getNomUrl();
464 $morehtmlref .=
'</div>';
467 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
470 print
'<div class="fichecenter">';
471 print
'<div class="fichehalfleft">';
472 print
'<div class="underbanner clearboth"></div>';
473 print
'<table class="border centpercent tableforfield">'.
"\n";
476 $keyforbreak =
'description';
477 unset($object->fields[
'fk_project']);
479 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
482 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
488 print
'<div class="clearboth"></div>';
494 $object = $savobject;
498$arrayofselected = is_array($toselect) ? $toselect : array();
502 $param .=
'&id='.urlencode($id);
505 $param .=
'&mode='.urlencode($mode);
507if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
508 $param .=
'&contextpage='.urlencode($contextpage);
510if ($limit > 0 && $limit != $conf->liste_limit) {
511 $param .=
'&limit='.((int) $limit);
513foreach ($search as $key => $val) {
514 if (is_array($search[$key])) {
515 foreach ($search[$key] as $skey) {
517 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
520 } elseif ($search[$key] !=
'') {
521 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
524if ($optioncss !=
'') {
525 $param .=
'&optioncss='.urlencode($optioncss);
528include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
530$parameters = array(
'param' => &$param);
531$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
532$param .= $hookmanager->resPrint;
535$arrayofmassactions = array(
536 'validate'=>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
541if (!empty($permissiontodelete)) {
542 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
544if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
545 $arrayofmassactions = array();
547$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
549print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
550if ($optioncss !=
'') {
551 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
553print
'<input type="hidden" name="token" value="'.newToken().
'">';
554print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
555print
'<input type="hidden" name="action" value="list">';
556print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
557print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
558print
'<input type="hidden" name="page" value="'.$page.
'">';
559print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
560print
'<input type="hidden" name="mode" value="'.$mode.
'">';
561print
'<input type="hidden" name="id" value="'.$id.
'">';
565$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'));
566$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'));
568$newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/recruitment/recruitmentcandidature_card.php', 1).
'?action=create&fk_recruitmentjobposition='.$id,
'', $permissiontoadd);
570print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
573$topicmail =
"SendRecruitmentCandidatureRef";
574$modelmail =
"recruitmentcandidature";
576$trackid =
'recruitmentapplication'.$object->id;
577include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
581 foreach ($fieldstosearchall as $key => $val) {
582 $fieldstosearchall[$key] = $langs->trans($val);
583 $setupstring .= $key.
"=".$val.
";";
585 print
'<!-- Search done like if RECRUITMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
586 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>'.
"\n";
594$parameters = array();
595$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
596if (empty($reshook)) {
597 $moreforfilter .= $hookmanager->resPrint;
599 $moreforfilter = $hookmanager->resPrint;
602if (!empty($moreforfilter)) {
603 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
604 print $moreforfilter;
608$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
609$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
610$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
612print
'<div class="div-table-responsive">';
613print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
618print
'<tr class="liste_titre_filter">';
621 print
'<td class="liste_titre maxwidthsearch center">';
622 $searchpicto = $form->showFilterButtons(
'left');
626foreach ($object->fields as $key => $val) {
627 $searchkey = empty($search[$key]) ?
'' : $search[$key];
628 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
629 if ($key ==
'status') {
630 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
631 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
632 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
633 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
634 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
635 } 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'])) {
636 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
638 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
639 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
640 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
641 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);
642 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
643 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
644 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
645 print
'<div class="nowrap">';
646 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
648 print
'<div class="nowrap">';
649 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
651 } elseif ($key ==
'lang') {
652 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
654 print $formadmin->select_language($search[$key],
'search_lang', 0,
null, 1, 0, 0,
'minwidth150 maxwidth200', 2);
656 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
662include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
665$parameters = array(
'arrayfields'=>$arrayfields);
666$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
667print $hookmanager->resPrint;
670 print
'<td class="liste_titre center maxwidthsearch">';
671 $searchpicto = $form->showFilterButtons();
677$totalarray = array();
678$totalarray[
'nbfield'] = 0;
682print
'<tr class="liste_titre">';
684 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
685 $totalarray[
'nbfield']++;
687foreach ($object->fields as $key => $val) {
688 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
689 if ($key ==
'status') {
690 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
691 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
692 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
693 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
694 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
695 } 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'])) {
696 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
698 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
699 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
700 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";
701 $totalarray[
'nbfield']++;
705include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
707$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
708$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
709print $hookmanager->resPrint;
712 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
713 $totalarray[
'nbfield']++;
719$needToFetchEachLine = 0;
720if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
721 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
722 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
723 $needToFetchEachLine++;
732$savnbfield = $totalarray[
'nbfield'];
733$totalarray = array();
734$totalarray[
'nbfield'] = 0;
735$imaxinloop = ($limit ? min($num, $limit) : $num);
736while ($i < $imaxinloop) {
737 $obj = $db->fetch_object($resql);
743 $object->setVarsFromFetchObj($obj);
745 if ($mode ==
'kanban') {
747 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
748 print
'<div class="box-flex-container kanban">';
752 $recruitment->fetch($obj->fk_recruitmentjobposition);
754 $object->phone = $obj->phone;
758 if ($massactionbutton || $massaction) {
760 if (in_array($object->id, $arrayofselected)) {
764 print $object->getKanbanView(
'', array(
'jobpositionlink'=>$recruitment->getNomUrl(1),
'selected' => $selected));
765 if ($i == ($imaxinloop - 1)) {
772 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
775 print
'<td class="nowrap center">';
776 if ($massactionbutton || $massaction) {
778 if (in_array($object->id, $arrayofselected)) {
781 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
785 $totalarray[
'nbfield']++;
788 foreach ($object->fields as $key => $val) {
789 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
790 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
791 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
792 } elseif ($key ==
'status') {
793 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
796 if (in_array($val[
'type'], array(
'timestamp'))) {
797 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
798 } elseif ($key ==
'ref') {
799 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
802 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
803 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
807 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
808 print
'<td'.($cssforfield ?
' class="'.$cssforfield.(preg_match(
'/tdoverflow/', $cssforfield) ?
' classfortooltip' :
'').
'"' :
'');
809 if (preg_match(
'/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
810 print
' title="'.dol_escape_htmltag($object->$key).
'"';
813 if ($key ==
'status') {
814 print $object->getLibStatut(5);
815 } elseif ($key ==
'rowid') {
816 print $object->showOutputField($val, $key, $object->id,
'');
818 print $object->showOutputField($val, $key, $object->$key,
'');
822 $totalarray[
'nbfield']++;
824 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
826 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
828 if (!isset($totalarray[
'val'])) {
829 $totalarray[
'val'] = array();
831 if (!isset($totalarray[
'val'][
't.'.$key])) {
832 $totalarray[
'val'][
't.'.$key] = 0;
834 $totalarray[
'val'][
't.'.$key] += $object->$key;
839 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
841 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
842 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
843 print $hookmanager->resPrint;
846 print
'<td class="nowrap center">';
847 if ($massactionbutton || $massaction) {
849 if (in_array($object->id, $arrayofselected)) {
852 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
856 $totalarray[
'nbfield']++;
867include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
872 foreach ($arrayfields as $key => $val) {
873 if (!empty($val[
'checked'])) {
877 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
883$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
884$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
885print $hookmanager->resPrint;
887print
'</table>'.
"\n";
892if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
893 $hidegeneratedfilelistifempty = 1;
894 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
895 $hidegeneratedfilelistifempty = 0;
898 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
902 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
903 $urlsource .= str_replace(
'&',
'&', $param);
905 $filedir = $diroutputmassaction;
906 $genallowed = $permissiontoread;
907 $delallowed = $permissiontoadd;
909 print $formfile->showdocuments(
'massfilesarea_recruitment',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage projects.
Class for RecruitmentCandidature.
Class for RecruitmentJobPosition.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
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_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
dol_eval($s, $returnvalue=0, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier 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.