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(
"RecruitmentCandidatures");
46 $sql =
"SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX.
"recruitment_recruitmentcandidature WHERE fk_recruitmentjobposition = ".((int) $object->id);
47 $resql = $db->query($sql);
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) && isModEnabled(
'multicompany')) {
147 $out .=
"&entity=".$conf->entity;
static count($dbs, $objecttype, $objectid)
Return nb of links.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
getPublicJobPositionUrl($mode, $ref='', $localorexternal=0)
Return string with full Url.
recruitmentjobpositionPrepareHead($object)
Prepare array of tabs for RecruitmentJobPosition.