32 global $db, $langs, $conf;
34 $langs->load(
"recruitment");
39 $head[$h][0] =
dol_buildpath(
"/recruitment/recruitmentjobposition_card.php", 1).
'?id='.$object->id;
40 $head[$h][1] = $langs->trans(
"PositionToBeFilled");
41 $head[$h][2] =
'card';
44 if ($conf->global->MAIN_FEATURES_LEVEL >= 1) {
45 $head[$h][0] =
dol_buildpath(
"/recruitment/recruitmentjobposition_applications.php", 1).
'?id='.$object->id;
46 $head[$h][1] = $langs->trans(
"Candidatures");
47 $head[$h][2] =
'candidatures';
51 if (isset($object->fields[
'note_public']) || isset($object->fields[
'note_private']))
54 if (!empty($object->note_private)) $nbNote++;
55 if (!empty($object->note_public)) $nbNote++;
56 $head[$h][0] =
dol_buildpath(
'/recruitment/recruitmentjobposition_note.php', 1).
'?id='.$object->id;
57 $head[$h][1] = $langs->trans(
'Notes');
58 if ($nbNote > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
59 $head[$h][2] =
'note';
63 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
64 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
65 $upload_dir = $conf->recruitment->dir_output.
"/recruitmentjobposition/".
dol_sanitizeFileName($object->ref);
66 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
67 $nbLinks =
Link::count($db, $object->element, $object->id);
68 $head[$h][0] =
dol_buildpath(
"/recruitment/recruitmentjobposition_document.php", 1).
'?id='.$object->id;
69 $head[$h][1] = $langs->trans(
'Documents');
70 if (($nbFiles + $nbLinks) > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
71 $head[$h][2] =
'document';
74 $head[$h][0] =
dol_buildpath(
"/recruitment/recruitmentjobposition_agenda.php", 1).
'?id='.$object->id;
75 $head[$h][1] = $langs->trans(
"Events");
76 $head[$h][2] =
'agenda';
105 global $conf, $dolibarr_main_url_root;
107 $ref = str_replace(
' ',
'', $ref);
111 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
112 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
115 $urltouse = DOL_MAIN_URL_ROOT;
116 if ($localorexternal) $urltouse = $urlwithroot;
118 $out = $urltouse.
'/public/recruitment/view.php?ref='.($mode ?
'<font color="#666666">' :
'').$ref.($mode ?
'</font>' :
'');
126 if (!empty($out) && !empty($conf->multicompany->enabled)) $out .=
"&entity=".$conf->entity;
recruitmentjobpositionPrepareHead($object)
Prepare array of tabs for RecruitmentJobPosition.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
static count($db, $objecttype, $objectid)
Return nb of links.
getPublicJobPositionUrl($mode, $ref= '', $localorexternal=0)
Return string with full Url.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode= 'add')
Complete or removed entries into a head array (used to build tabs).