27require_once
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/recruitment/lib/recruitment.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/recruitment/lib/recruitment_recruitmentjobposition.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/recruitment/class/recruitmentcandidature.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/recruitment/class/recruitmentjobposition.class.php';
45$langs->loadLangs(array(
"recruitment",
"other"));
50$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
51$massaction =
GETPOST(
'massaction',
'alpha');
53$confirm =
GETPOST(
'confirm',
'alpha');
54$cancel =
GETPOST(
'cancel',
'alpha');
55$toselect =
GETPOST(
'toselect',
'array:int');
56$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : ((empty(
$id) && empty($ref)) ?
'recruitmentcandidaturelist' :
'recruitmentjobposition_candidature');
57$backtopage =
GETPOST(
'backtopage',
'alpha');
58$optioncss =
GETPOST(
'optioncss',
'aZ');
64$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
65$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
67if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
71$offset = $limit * $page;
78$diroutputmassaction =
$conf->recruitment->dir_output.
'/temp/massgeneration/'.$user->id;
79$hookmanager->initHooks(array($contextpage));
82$extrafields->fetch_name_optionals_label(
$object->table_element);
85$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
89 $sortfield =
"t.date_creation";
96$search_all =
GETPOST(
'search_all',
'alphanohtml');
98foreach (
$object->fields as $key => $val) {
99 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
100 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
102 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
109$fieldstosearchall = array();
110foreach (
$object->fields as $key => $val) {
111 if (!empty($val[
'searchall'])) {
112 $fieldstosearchall[
't.'.$key] = $val[
'label'];
124$arrayfields = array();
125foreach (
$object->fields as $key => $val) {
127 if (!empty($val[
'visible'])) {
128 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
129 $arrayfields[
't.'.$key] = array(
130 'label' => $val[
'label'],
131 'checked' => (($visible < 0) ? 0 : 1),
132 'enabled' => (abs($visible) != 3 && (bool)
dol_eval((
string) $val[
'enabled'], 1)),
133 'position' => $val[
'position'],
134 'help' => isset($val[
'help']) ? $val[
'help'] :
''
139include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
143if ($id > 0 || !empty($ref)) {
144 $jobposition->fetch($id, $ref);
145 $id = $jobposition->id;
151$permissiontoread = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'read');
152$permissiontoadd = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'write');
153$permissiontodelete = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'delete');
159if ($jobposition->id > 0) {
160 $isdraft = (($jobposition->status == $jobposition::STATUS_DRAFT) ? 1 : 0);
161 $result =
restrictedArea($user,
'recruitment', $jobposition->id,
'recruitment_recruitmentjobposition',
'recruitmentjobposition',
'',
'rowid', $isdraft);
163 $result =
restrictedArea($user,
'recruitment', 0,
'recruitment_recruitmentcandidature',
'recruitmentjobposition');
172if (
GETPOST(
'cancel',
'alpha')) {
176if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
180$parameters = array();
181$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
186if (empty($reshook)) {
188 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
191 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
192 foreach (
$object->fields as $key => $val) {
194 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
195 $search[$key.
'_dtstart'] =
'';
196 $search[$key.
'_dtend'] =
'';
200 $search_array_options = array();
202 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
203 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
208 $objectclass =
'RecruitmentCandidature';
209 $objectlabel =
'RecruitmentCandidature';
210 $uploaddir =
$conf->recruitment->dir_output;
211 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
226$title = $langs->trans(
'RecruitmentCandidatures');
234$sql .=
$object->getFieldList(
't');
236if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
237 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
238 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
242$parameters = array();
243$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
244$sql .= $hookmanager->resPrint;
245$sql = preg_replace(
'/,\s*$/',
'', $sql);
249$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
250if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
251 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
254$parameters = array();
255$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
256$sql .= $hookmanager->resPrint;
257if (
$object->ismultientitymanaged == 1) {
258 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element).
")";
260 $sql .=
" WHERE 1 = 1";
262foreach ($search as $key => $val) {
263 if (array_key_exists($key,
$object->fields)) {
264 if ($key ==
'status' && $search[$key] == -1) {
268 if ((strpos(
$object->fields[$key][
'type'],
'integer:') === 0) || (strpos(
$object->fields[$key][
'type'],
'sellist:') === 0) || !empty(
$object->fields[$key][
'arrayofkeyval'])) {
269 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty(
$object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0',
$object->fields[$key][
'arrayofkeyval'])))) {
274 if ($search[$key] !=
'') {
275 $sql .=
natural_search(
"t.".
$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
278 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
279 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
280 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
281 if (preg_match(
'/_dtstart$/', $key)) {
282 $sql .=
" AND t.".$db->escape($columnName).
" >= '".
$db->idate($search[$key]).
"'";
284 if (preg_match(
'/_dtend$/', $key)) {
285 $sql .=
" AND t.".$db->escape($columnName).
" <= '" .
$db->idate($search[$key]).
"'";
292 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
295 $sql .=
" AND t.fk_recruitmentjobposition = ".((int) $id);
299include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
301$parameters = array();
302$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
303$sql .= $hookmanager->resPrint;
324$nbtotalofrecords =
'';
327 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
328 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
329 $resql =
$db->query($sqlforcount);
331 $objforcount =
$db->fetch_object($resql);
332 $nbtotalofrecords = $objforcount->nbtotalofrecords;
337 if (($page * $limit) > (
int) $nbtotalofrecords) {
345$sql .=
$db->order($sortfield, $sortorder);
347 $sql .=
$db->plimit($limit + 1, $offset);
350$resql =
$db->query($sql);
356$num =
$db->num_rows($resql);
360if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
361 $obj =
$db->fetch_object($resql);
363 header(
"Location: ".DOL_URL_ROOT.
'/recruitment/recruitmentcandidature_card.php?id='.$id);
371llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist');
376if ($jobposition->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
381 $res =
$object->fetch_optionals();
389 if ($action ==
'delete') {
390 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'DeleteRecruitmentJobPosition'), $langs->trans(
'ConfirmDeleteObject'),
'confirm_delete',
'', 0, 1);
393 if ($action ==
'deleteline') {
394 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
397 if ($action ==
'clone') {
399 $formquestion = array();
400 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneAsk',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1);
404 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
405 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
406 if (empty($reshook)) {
407 $formconfirm .= $hookmanager->resPrint;
408 } elseif ($reshook > 0) {
409 $formconfirm = $hookmanager->resPrint;
418 $linkback =
'<a href="'.dol_buildpath(
'/recruitment/recruitmentjobposition_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
420 $morehtmlref =
'<div class="refidno">';
430 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
432 $langs->load(
"projects");
433 $morehtmlref .= $langs->trans(
'Project').
' ';
434 if ($permissiontoadd) {
435 if ($action !=
'classify') {
436 $morehtmlref .=
'<a class="editfielda" href="'.dolBuildUrl($_SERVER[
'PHP_SELF'], [
'action' =>
'classify',
'id' =>
$object->id],
true).
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a>';
438 $morehtmlref .=
' : ';
439 if ($action ==
'classify') {
441 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
442 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
443 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
444 $morehtmlref .= $formproject->select_projects(0, (
string)
$object->fk_project,
'projectid', 0, 0, 1, 0, 1, 0, 0,
'', 1);
445 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
446 $morehtmlref .=
'</form>';
448 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, !empty(
$object->socid) ?
$object->socid : 0, (
string)
$object->fk_project,
'none', 0, 0, 0, 1,
'',
'maxwidth300');
451 if (!empty(
$object->fk_project)) {
453 $proj->fetch(
$object->fk_project);
454 $morehtmlref .=
': '.$proj->getNomUrl();
460 $morehtmlref .=
'</div>';
463 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
466 print
'<div class="fichecenter">';
467 print
'<div class="fichehalfleft">';
468 print
'<div class="underbanner clearboth"></div>';
469 print
'<table class="border centpercent tableforfield">'.
"\n";
472 $keyforbreak =
'description';
473 unset(
$object->fields[
'fk_project']);
475 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
478 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
484 print
'<div class="clearboth"></div>';
494$arrayofselected = is_array($toselect) ? $toselect : array();
498 $param .=
'&id='.urlencode((
string) ($id));
501 $param .=
'&mode='.urlencode($mode);
503if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
504 $param .=
'&contextpage='.urlencode($contextpage);
506if ($limit > 0 && $limit !=
$conf->liste_limit) {
507 $param .=
'&limit='.((int) $limit);
509foreach ($search as $key => $val) {
510 if (is_array($search[$key])) {
511 foreach ($search[$key] as $skey) {
513 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
516 } elseif ($search[$key] !=
'') {
517 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
520if ($optioncss !=
'') {
521 $param .=
'&optioncss='.urlencode($optioncss);
524include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
526$parameters = array(
'param' => &$param);
527$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
528$param .= $hookmanager->resPrint;
531$arrayofmassactions = array(
532 'validate' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
537if (!empty($permissiontodelete)) {
538 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
540if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
541 $arrayofmassactions = array();
543$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
545print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
546if ($optioncss !=
'') {
547 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
549print
'<input type="hidden" name="token" value="'.newToken().
'">';
550print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
551print
'<input type="hidden" name="action" value="list">';
552print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
553print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
554print
'<input type="hidden" name="page" value="'.$page.
'">';
555print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
556print
'<input type="hidden" name="mode" value="'.$mode.
'">';
557print
'<input type="hidden" name="id" value="'.$id.
'">';
561$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'));
562$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'));
563$newcardbutton .= dolGetButtonTitleSeparator();
564$newcardbutton .= dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/recruitment/recruitmentcandidature_card.php', 1).
'?action=create&fk_recruitmentjobposition='.$id,
'', $permissiontoadd);
566print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
569$topicmail =
"SendRecruitmentCandidatureRef";
570$modelmail =
"recruitmentcandidature";
572$trackid =
'recruitmentapplication'.$object->id;
573include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
577 foreach ($fieldstosearchall as $key => $val) {
578 $fieldstosearchall[$key] = $langs->trans($val);
579 $setupstring .= $key.
"=".$val.
";";
581 print
'<!-- Search done like if RECRUITMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
582 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
590$parameters = array();
591$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
592if (empty($reshook)) {
593 $moreforfilter .= $hookmanager->resPrint;
595 $moreforfilter = $hookmanager->resPrint;
598if (!empty($moreforfilter)) {
599 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
600 print $moreforfilter;
604$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
605$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
606$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
608print
'<div class="div-table-responsive">';
609print
'<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
614print
'<tr class="liste_titre_filter">';
616if (
$conf->main_checkbox_left_column) {
617 print
'<td class="liste_titre maxwidthsearch center">';
618 $searchpicto = $form->showFilterButtons(
'left');
622foreach (
$object->fields as $key => $val) {
623 $searchkey = empty($search[$key]) ?
'' : $search[$key];
624 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
625 if ($key ==
'status') {
626 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
627 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
628 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
629 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
630 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
631 } 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'])) {
632 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
634 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
635 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
636 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
637 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);
638 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
639 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
640 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
641 print
'<div class="nowrap">';
642 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
644 print
'<div class="nowrap">';
645 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
647 } elseif ($key ==
'lang') {
648 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
650 print $formadmin->select_language($search[$key],
'search_lang', 0, array(), 1, 0, 0,
'minwidth100imp maxwidth125', 2);
652 print
'<input type="text" class="flat maxwidth'.($val[
'type'] ==
'integer' ?
'50' :
'75').
'" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
658include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
661$parameters = array(
'arrayfields' => $arrayfields);
662$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
663print $hookmanager->resPrint;
665if (!
$conf->main_checkbox_left_column) {
666 print
'<td class="liste_titre center maxwidthsearch">';
667 $searchpicto = $form->showFilterButtons();
678print
'<tr class="liste_titre">';
679if (
$conf->main_checkbox_left_column) {
680 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
683foreach (
$object->fields as $key => $val) {
684 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
685 if ($key ==
'status') {
686 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
687 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
688 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
689 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
690 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
691 } 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'])) {
692 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
694 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
695 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
696 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";
701include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
703$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
704$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
705print $hookmanager->resPrint;
707if (!
$conf->main_checkbox_left_column) {
708 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
715$needToFetchEachLine = 0;
716if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
717 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
718 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
719 $needToFetchEachLine++;
731$imaxinloop = ($limit ? min($num, $limit) : $num);
732while ($i < $imaxinloop) {
733 $obj =
$db->fetch_object($resql);
739 $object->setVarsFromFetchObj($obj);
741 if ($mode ==
'kanban') {
743 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
744 print
'<div class="box-flex-container kanban">';
748 $recruitment->fetch($obj->fk_recruitmentjobposition);
754 if ($massactionbutton || $massaction) {
756 if (in_array(
$object->id, $arrayofselected)) {
760 print
$object->getKanbanView(
'', array(
'jobpositionlink' => $recruitment->getNomUrl(1),
'selected' => $selected));
761 if ($i == ($imaxinloop - 1)) {
768 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
770 if (
$conf->main_checkbox_left_column) {
771 print
'<td class="nowrap center">';
772 if ($massactionbutton || $massaction) {
774 if (in_array(
$object->id, $arrayofselected)) {
777 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
784 foreach (
$object->fields as $key => $val) {
785 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
786 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
787 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
788 } elseif ($key ==
'status') {
789 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
792 if (in_array($val[
'type'], array(
'timestamp'))) {
793 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
794 } elseif ($key ==
'ref') {
795 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
798 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
799 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
803 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
804 print
'<td'.($cssforfield ?
' class="'.$cssforfield.(preg_match(
'/tdoverflow/', $cssforfield) ?
' classfortooltip' :
'').
'"' :
'');
805 if (preg_match(
'/tdoverflow/', $cssforfield) && !is_numeric(
$object->$key)) {
806 print
' title="'.dol_escape_htmltag((
string)
$object->$key).
'"';
809 if ($key ==
'status') {
810 print
$object->getLibStatut(5);
811 } elseif ($key ==
'rowid') {
812 print
$object->showOutputField($val, $key, (
string)
$object->id,
'');
820 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
824 if (!isset($totalarray[
'val'])) {
827 if (!isset($totalarray[
'val'][
't.'.$key])) {
835 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
837 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
838 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
839 print $hookmanager->resPrint;
841 if (!
$conf->main_checkbox_left_column) {
842 print
'<td class="nowrap center">';
843 if ($massactionbutton || $massaction) {
845 if (in_array(
$object->id, $arrayofselected)) {
848 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
863include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
868 foreach ($arrayfields as $key => $val) {
869 if (!empty($val[
'checked'])) {
873 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
879$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
880$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
881print $hookmanager->resPrint;
883print
'</table>'.
"\n";
888if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
889 $hidegeneratedfilelistifempty = 1;
890 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
891 $hidegeneratedfilelistifempty = 0;
894 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
898 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
899 $urlsource .= str_replace(
'&',
'&', $param);
901 $filedir = $diroutputmassaction;
902 $genallowed = $permissiontoread;
903 $delallowed = $permissiontoadd;
905 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 to manage projects.
Class for RecruitmentCandidature.
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...
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)
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, $morecssdiv='')
Show tabs of a record.
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, $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...
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
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.
isModEnabled($module)
Is Dolibarr module enabled.
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...
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
buildzip.php
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.