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';
141$parameters = array(
'arrayfields' => &$arrayfields);
142$reshook = $hookmanager->executeHooks(
'completeArrayFields', $parameters, $object, $action);
146if ($id > 0 || !empty($ref)) {
147 $jobposition->fetch($id, $ref);
148 $id = $jobposition->id;
154$permissiontoread = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'read');
155$permissiontoadd = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'write');
156$permissiontodelete = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'delete');
162if ($jobposition->id > 0) {
163 $isdraft = (($jobposition->status == $jobposition::STATUS_DRAFT) ? 1 : 0);
164 $result =
restrictedArea($user,
'recruitment', $jobposition->id,
'recruitment_recruitmentjobposition',
'recruitmentjobposition',
'',
'rowid', $isdraft);
166 $result =
restrictedArea($user,
'recruitment', 0,
'recruitment_recruitmentcandidature',
'recruitmentjobposition');
175if (
GETPOST(
'cancel',
'alpha')) {
179if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
183$parameters = array();
184$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
189if (empty($reshook)) {
191 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
194 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
195 foreach (
$object->fields as $key => $val) {
197 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
198 $search[$key.
'_dtstart'] =
'';
199 $search[$key.
'_dtend'] =
'';
203 $search_array_options = array();
205 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
206 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
211 $objectclass =
'RecruitmentCandidature';
212 $objectlabel =
'RecruitmentCandidature';
213 $uploaddir =
$conf->recruitment->dir_output;
214 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
229$title = $langs->trans(
'RecruitmentCandidatures');
237$sql .=
$object->getFieldList(
't');
239if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
240 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
241 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
245$parameters = array();
246$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
247$sql .= $hookmanager->resPrint;
248$sql = preg_replace(
'/,\s*$/',
'', $sql);
252$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
253if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
254 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
257$parameters = array();
258$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
259$sql .= $hookmanager->resPrint;
260if (
$object->ismultientitymanaged == 1) {
261 $sql .=
" WHERE t.entity IN (".getEntity(
$object->element).
")";
263 $sql .=
" WHERE 1 = 1";
265foreach ($search as $key => $val) {
266 if (array_key_exists($key,
$object->fields)) {
267 if ($key ==
'status' && $search[$key] == -1) {
271 if ((strpos(
$object->fields[$key][
'type'],
'integer:') === 0) || (strpos(
$object->fields[$key][
'type'],
'sellist:') === 0) || !empty(
$object->fields[$key][
'arrayofkeyval'])) {
272 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty(
$object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0',
$object->fields[$key][
'arrayofkeyval'])))) {
277 if ($search[$key] !=
'') {
278 $sql .=
natural_search(
"t.".
$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
281 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
282 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
283 if (preg_match(
'/^(date|timestamp|datetime)/',
$object->fields[$columnName][
'type'])) {
284 if (preg_match(
'/_dtstart$/', $key)) {
285 $sql .=
" AND t.".$db->sanitize($columnName).
" >= '".
$db->idate($search[$key]).
"'";
287 if (preg_match(
'/_dtend$/', $key)) {
288 $sql .=
" AND t.".$db->sanitize($columnName).
" <= '" .
$db->idate($search[$key]).
"'";
295 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
298 $sql .=
" AND t.fk_recruitmentjobposition = ".((int) $id);
302include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
304$parameters = array();
305$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
306$sql .= $hookmanager->resPrint;
327$nbtotalofrecords =
'';
330 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
331 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
332 $resql =
$db->query($sqlforcount);
334 $objforcount =
$db->fetch_object($resql);
335 $nbtotalofrecords = $objforcount->nbtotalofrecords;
340 if (($page * $limit) > (
int) $nbtotalofrecords) {
348$sql .=
$db->order($sortfield, $sortorder);
350 $sql .=
$db->plimit($limit + 1, $offset);
353$resql =
$db->query($sql);
359$num =
$db->num_rows($resql);
363if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
364 $obj =
$db->fetch_object($resql);
366 header(
"Location: ".DOL_URL_ROOT.
'/recruitment/recruitmentcandidature_card.php?id='.$id);
374llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist');
379if ($jobposition->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
384 $res =
$object->fetch_optionals();
392 if ($action ==
'delete') {
393 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'DeleteRecruitmentJobPosition'), $langs->trans(
'ConfirmDeleteObject'),
'confirm_delete',
'', 0, 1);
396 if ($action ==
'deleteline') {
397 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
400 if ($action ==
'clone') {
402 $formquestion = array();
403 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneAsk',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1);
407 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
408 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
409 if (empty($reshook)) {
410 $formconfirm .= $hookmanager->resPrint;
411 } elseif ($reshook > 0) {
412 $formconfirm = $hookmanager->resPrint;
421 $linkback =
'<a href="'.dol_buildpath(
'/recruitment/recruitmentjobposition_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
423 $morehtmlref =
'<div class="refidno">';
433 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
435 $langs->load(
"projects");
436 $morehtmlref .= $langs->trans(
'Project').
' ';
437 if ($permissiontoadd) {
438 if ($action !=
'classify') {
439 $morehtmlref .=
'<a class="editfielda" href="'.dolBuildUrl($_SERVER[
'PHP_SELF'], [
'action' =>
'classify',
'id' =>
$object->id],
true).
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a>';
441 $morehtmlref .=
' : ';
442 if ($action ==
'classify') {
444 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
445 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
446 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
447 $morehtmlref .= $formproject->select_projects(0, (
string)
$object->fk_project,
'projectid', 0, 0, 1, 0, 1, 0, 0,
'', 1);
448 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
449 $morehtmlref .=
'</form>';
451 $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');
454 if (!empty(
$object->fk_project)) {
456 $proj->fetch(
$object->fk_project);
457 $morehtmlref .=
': '.$proj->getNomUrl();
463 $morehtmlref .=
'</div>';
466 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
469 print
'<div class="fichecenter">';
470 print
'<div class="fichehalfleft">';
471 print
'<div class="underbanner clearboth"></div>';
472 print
'<table class="border centpercent tableforfield">'.
"\n";
475 $keyforbreak =
'description';
476 unset(
$object->fields[
'fk_project']);
478 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
481 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
487 print
'<div class="clearboth"></div>';
497$arrayofselected = is_array($toselect) ? $toselect : array();
501 $param .=
'&id='.urlencode((
string) ($id));
504 $param .=
'&mode='.urlencode($mode);
506if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
507 $param .=
'&contextpage='.urlencode($contextpage);
509if ($limit > 0 && $limit !=
$conf->liste_limit) {
510 $param .=
'&limit='.((int) $limit);
512foreach ($search as $key => $val) {
513 if (is_array($search[$key])) {
514 foreach ($search[$key] as $skey) {
516 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
519 } elseif ($search[$key] !=
'') {
520 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
523if ($optioncss !=
'') {
524 $param .=
'&optioncss='.urlencode($optioncss);
527include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
529$parameters = array(
'param' => &$param);
530$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
531$param .= $hookmanager->resPrint;
534$arrayofmassactions = array(
535 'validate' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
540if (!empty($permissiontodelete)) {
541 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
543if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
544 $arrayofmassactions = array();
546$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
548print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
549if ($optioncss !=
'') {
550 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
552print
'<input type="hidden" name="token" value="'.newToken().
'">';
553print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
554print
'<input type="hidden" name="action" value="list">';
555print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
556print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
557print
'<input type="hidden" name="page" value="'.$page.
'">';
558print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
559print
'<input type="hidden" name="mode" value="'.$mode.
'">';
560print
'<input type="hidden" name="id" value="'.$id.
'">';
564$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'));
565$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'));
567$newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle',
dol_buildpath(
'/recruitment/recruitmentcandidature_card.php', 1).
'?action=create&fk_recruitmentjobposition='.$id,
'', $permissiontoadd);
569print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_'.
$object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
572$topicmail =
"SendRecruitmentCandidatureRef";
573$modelmail =
"recruitmentcandidature";
575$trackid =
'recruitmentapplication'.$object->id;
576include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
580 foreach ($fieldstosearchall as $key => $val) {
581 $fieldstosearchall[$key] = $langs->trans($val);
582 $setupstring .= $key.
"=".$val.
";";
584 print
'<!-- Search done like if RECRUITMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
585 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
593$parameters = array();
594$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
595if (empty($reshook)) {
596 $moreforfilter .= $hookmanager->resPrint;
598 $moreforfilter = $hookmanager->resPrint;
601if (!empty($moreforfilter)) {
602 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
603 print $moreforfilter;
607$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
608$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
609$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
611print
'<div class="div-table-responsive">';
612print
'<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
617print
'<tr class="liste_titre_filter">';
619if (
$conf->main_checkbox_left_column) {
620 print
'<td class="liste_titre maxwidthsearch center">';
621 $searchpicto = $form->showFilterButtons(
'left');
625foreach (
$object->fields as $key => $val) {
626 $searchkey = empty($search[$key]) ?
'' : $search[$key];
627 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
628 if ($key ==
'status') {
629 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
630 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
631 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
632 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
633 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
634 } 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'])) {
635 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
637 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
638 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
639 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
640 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);
641 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
642 print
$object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] :
''),
'',
'',
'search_', $cssforfield.
' maxwidth250', 1);
643 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
644 print
'<div class="nowrap">';
645 print $form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
647 print
'<div class="nowrap">';
648 print $form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
650 } elseif ($key ==
'lang') {
651 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
653 print $formadmin->select_language($search[$key],
'search_lang', 0, array(), 1, 0, 0,
'minwidth100imp maxwidth125', 2);
655 print
'<input type="text" class="flat maxwidth'.($val[
'type'] ==
'integer' ?
'50' :
'75').
'" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
661include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
664$parameters = array(
'arrayfields' => $arrayfields);
665$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
666print $hookmanager->resPrint;
668if (!
$conf->main_checkbox_left_column) {
669 print
'<td class="liste_titre center maxwidthsearch">';
670 $searchpicto = $form->showFilterButtons();
681print
'<tr class="liste_titre">';
682if (
$conf->main_checkbox_left_column) {
683 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
686foreach (
$object->fields as $key => $val) {
687 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
688 if ($key ==
'status') {
689 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
690 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
691 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
692 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
693 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
694 } 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'])) {
695 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
697 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
698 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
699 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";
704include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
706$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
707$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
708print $hookmanager->resPrint;
710if (!
$conf->main_checkbox_left_column) {
711 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
718$needToFetchEachLine = 0;
719if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
720 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
721 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
722 $needToFetchEachLine++;
734$imaxinloop = ($limit ? min($num, $limit) : $num);
735while ($i < $imaxinloop) {
736 $obj =
$db->fetch_object($resql);
742 $object->setVarsFromFetchObj($obj);
744 if ($mode ==
'kanban') {
746 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
747 print
'<div class="box-flex-container kanban">';
751 $recruitment->fetch($obj->fk_recruitmentjobposition);
757 if ($massactionbutton || $massaction) {
759 if (in_array(
$object->id, $arrayofselected)) {
763 print
$object->getKanbanView(
'', array(
'jobpositionlink' => $recruitment->getNomUrl(1),
'selected' => $selected));
764 if ($i == ($imaxinloop - 1)) {
771 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
773 if (
$conf->main_checkbox_left_column) {
774 print
'<td class="nowrap center">';
775 if ($massactionbutton || $massaction) {
777 if (in_array(
$object->id, $arrayofselected)) {
780 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
787 foreach (
$object->fields as $key => $val) {
788 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
789 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
790 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
791 } elseif ($key ==
'status') {
792 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
795 if (in_array($val[
'type'], array(
'timestamp'))) {
796 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
797 } elseif ($key ==
'ref') {
798 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
801 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'status')) && empty($val[
'arrayofkeyval'])) {
802 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
806 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
807 print
'<td'.($cssforfield ?
' class="'.$cssforfield.(preg_match(
'/tdoverflow/', $cssforfield) ?
' classfortooltip' :
'').
'"' :
'');
808 if (preg_match(
'/tdoverflow/', $cssforfield) && !is_numeric(
$object->$key)) {
809 print
' title="'.dol_escape_htmltag((
string)
$object->$key).
'"';
812 if ($key ==
'status') {
813 print
$object->getLibStatut(5);
814 } elseif ($key ==
'rowid') {
815 print
$object->showOutputField($val, $key, (
string)
$object->id,
'');
823 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
827 if (!isset($totalarray[
'val'])) {
830 if (!isset($totalarray[
'val'][
't.'.$key])) {
838 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
840 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
841 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
842 print $hookmanager->resPrint;
844 if (!
$conf->main_checkbox_left_column) {
845 print
'<td class="nowrap center">';
846 if ($massactionbutton || $massaction) {
848 if (in_array(
$object->id, $arrayofselected)) {
851 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
866include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
871 foreach ($arrayfields as $key => $val) {
872 if (!empty($val[
'checked'])) {
876 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
882$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
883$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
884print $hookmanager->resPrint;
886print
'</table>'.
"\n";
891if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
892 $hidegeneratedfilelistifempty = 1;
893 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
894 $hidegeneratedfilelistifempty = 0;
897 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
901 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
902 $urlsource .= str_replace(
'&',
'&', $param);
904 $filedir = $diroutputmassaction;
905 $genallowed = $permissiontoread;
906 $delallowed = $permissiontoadd;
908 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)
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.
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, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
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.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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.