35 global $db, $langs, $conf;
42 $head[$h][0] = DOL_URL_ROOT.
"/hrm/job_card.php?id=".$object->id;
43 $head[$h][1] = $langs->trans(
"JobProfile");
44 $head[$h][2] =
'job_card';
47 $head[$h][0] = DOL_URL_ROOT.
"/hrm/skill_tab.php?id=".$object->id.
'&objecttype=job';
48 $head[$h][1] = $langs->trans(
"RequiredSkills");
50 $sql =
"SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX.
"hrm_skillrank WHERE objecttype = 'job' AND fk_object = ".((int) $object->id);
51 $resql = $db->query($sql);
53 $obj = $db->fetch_object($resql);
55 $nbResources = $obj->nb;
58 if ($nbResources > 0) {
59 $head[$h][1] .= (!
getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER') ?
'<span class="badge marginleftonlyshort">'.($nbResources).
'</span>' :
'');
61 $head[$h][2] =
'skill_tab';
64 $head[$h][0] = DOL_URL_ROOT.
"/hrm/position.php?id=".$object->id;
65 $head[$h][1] = $langs->trans(
"PositionsWithThisProfile");
67 $sql =
"SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX.
"hrm_job_user WHERE fk_job = ".((int) $object->id);
68 $resql = $db->query($sql);
70 $obj = $db->fetch_object($resql);
72 $nbResources = $obj->nb;
75 if ($nbResources > 0) {
76 $head[$h][1] .= (!
getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER') ?
'<span class="badge marginleftonlyshort">'.($nbResources).
'</span>' :
'');
78 $head[$h][2] =
'position';
82 if (isset($object->fields[
'note_public']) || isset($object->fields[
'note_private'])) {
84 if (!empty($object->note_private)) {
87 if (!empty($object->note_public)) {
90 $head[$h][0] =
dol_buildpath(
'/hrm/job_note.php', 1).
'?id='.$object->id;
91 $head[$h][1] = $langs->trans(
'Notes');
93 $head[$h][1] .= (!
getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER') ?
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>' :
'');
95 $head[$h][2] =
'note';
99 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
100 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
102 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
103 $nbLinks =
Link::count($db, $object->element, $object->id);
104 $head[$h][0] =
dol_buildpath(
"/hrm/job_document.php", 1).
'?id='.$object->id;
105 $head[$h][1] = $langs->trans(
'Documents');
106 if (($nbFiles + $nbLinks) > 0) {
107 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
109 $head[$h][2] =
'document';
112 $head[$h][0] =
dol_buildpath(
"/hrm/job_agenda.php", 1).
'?id='.$object->id;
113 $head[$h][1] = $langs->trans(
"Events");
114 $head[$h][2] =
'agenda';
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.
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).