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 $head[$h][0] =
dol_buildpath(
"/recruitment/recruitmentcandidature_list.php", 1).
'?id='.$object->id;
45 $head[$h][1] = $langs->trans(
"Candidatures");
46 $sql =
"SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX.
"recruitment_recruitmentcandidature WHERE fk_recruitmentjobposition = ".((int) $object->id);
49 $obj = $db->fetch_object(
$resql);
51 $nCandidature = $obj->nb;
52 if ($nCandidature > 0) {
53 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nCandidature.
'</span>';
59 $head[$h][2] =
'candidatures';
62 if (isset($object->fields[
'note_public']) || isset($object->fields[
'note_private'])) {
64 if (!empty($object->note_private)) {
67 if (!empty($object->note_public)) {
70 $head[$h][0] =
dol_buildpath(
'/recruitment/recruitmentjobposition_note.php', 1).
'?id='.$object->id;
71 $head[$h][1] = $langs->trans(
'Notes');
73 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
75 $head[$h][2] =
'note';
79 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
80 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
81 $upload_dir = $conf->recruitment->dir_output.
"/recruitmentjobposition/".
dol_sanitizeFileName($object->ref);
82 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
83 $nbLinks =
Link::count($db, $object->element, $object->id);
84 $head[$h][0] =
dol_buildpath(
"/recruitment/recruitmentjobposition_document.php", 1).
'?id='.$object->id;
85 $head[$h][1] = $langs->trans(
'Documents');
86 if (($nbFiles + $nbLinks) > 0) {
87 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
89 $head[$h][2] =
'document';
92 $head[$h][0] =
dol_buildpath(
"/recruitment/recruitmentjobposition_agenda.php", 1).
'?id='.$object->id;
93 $head[$h][1] = $langs->trans(
"Events");
94 $head[$h][2] =
'agenda';
123 global $conf, $dolibarr_main_url_root;
125 $ref = str_replace(
' ',
'', $ref);
129 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
130 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
133 $urltouse = DOL_MAIN_URL_ROOT;
134 if ($localorexternal) {
135 $urltouse = $urlwithroot;
138 $out = $urltouse.
'/public/recruitment/view.php?ref='.($mode ?
'<span style="color: #666666">' :
'').$ref.($mode ?
'</span>' :
'');
146 if (!empty($out) && !empty($conf->multicompany->enabled)) {
147 $out .=
"&entity=".$conf->entity;