dolibarr 21.0.0-beta
hrm.lib.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2020 jean-pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
3 * Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
4 * Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
5 * Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
6 * Copyright (C) 2021 Grégory BLEMAND <gregory.blemand@atm-consulting.fr>
7 * Copyright (C) 2022-2024 Frédéric France <frederic.france@free.fr>
8 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
36{
37 global $langs, $conf, $db;
38
39 $langs->load("hrm");
40
41 $extrafields = new ExtraFields($db);
42 $extrafields->fetch_name_optionals_label('hrm_evaluation');
43 $extrafields->fetch_name_optionals_label('hrm_job');
44 $extrafields->fetch_name_optionals_label('hrm_skill');
45
46 $h = 0;
47 $head = array();
48 $head[$h][0] = DOL_URL_ROOT . "/admin/hrm.php";
49 $head[$h][1] = $langs->trans("Settings");
50 $head[$h][2] = 'settings';
51 $h++;
52
53 $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_establishment.php';
54 $head[$h][1] = $langs->trans("Establishments");
55 $head[$h][2] = 'establishments';
56 $h++;
57
58 $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/skill_extrafields.php';
59 $head[$h][1] = $langs->trans("SkillsExtraFields");
60 $nbExtrafields = $extrafields->attributes['hrm_skill']['count'];
61 if ($nbExtrafields > 0) {
62 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
63 }
64 $head[$h][2] = 'skillsAttributes';
65 $h++;
66
67 $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/job_extrafields.php';
68 $head[$h][1] = $langs->trans("JobsExtraFields");
69 $nbExtrafields = $extrafields->attributes['hrm_job']['count'];
70 if ($nbExtrafields > 0) {
71 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
72 }
73 $head[$h][2] = 'jobsAttributes';
74 $h++;
75
76 $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/evaluation_extrafields.php';
77 $head[$h][1] = $langs->trans("EvaluationsExtraFields");
78 $nbExtrafields = $extrafields->attributes['hrm_evaluation']['count'];
79 if ($nbExtrafields > 0) {
80 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
81 }
82 $head[$h][2] = 'evaluationsAttributes';
83 $h++;
84
85 // Show more tabs from modules
86 // Entries must be declared in modules descriptor with line
87 //$this->tabs = array(
88 // 'entity:+tabname:Title:@workstation:/workstation/mypage.php?id=__ID__'
89 //); // to add new tab
90 //$this->tabs = array(
91 // 'entity:-tabname:Title:@workstation:/workstation/mypage.php?id=__ID__'
92 //); // to remove a tab
93 complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin');
94
95 complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin', 'remove');
96
97 return $head;
98}
Class to manage standard extra fields.
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).
hrmAdminPrepareHead()
Prepare admin pages header.
Definition hrm.lib.php:35
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79