33 global $db, $langs, $conf, $user;
38 $head[$h][0] = DOL_URL_ROOT.
'/holiday/card.php?id='.$object->id;
39 $head[$h][1] = $langs->trans(
"Leave");
40 $head[$h][2] =
'card';
44 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
45 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
46 $upload_dir = $conf->holiday->multidir_output[$object->entity].
'/'.
dol_sanitizeFileName($object->ref);
47 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
48 $nbLinks =
Link::count($db, $object->element, $object->id);
49 $head[$h][0] = DOL_URL_ROOT.
'/holiday/document.php?id='.$object->id;
50 $head[$h][1] = $langs->trans(
'Documents');
51 if (($nbFiles + $nbLinks) > 0) {
52 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
54 $head[$h][2] =
'documents';
59 $head[$h][0] = DOL_URL_ROOT.
'/holiday/info.php?id='.$object->id;
60 $head[$h][1] = $langs->trans(
"Info");
61 $head[$h][2] =
'info';
83 global $db, $langs, $conf, $user;
86 $extrafields->fetch_name_optionals_label(
'holiday');
91 $head[$h][0] = DOL_URL_ROOT.
'/admin/holiday.php';
92 $head[$h][1] = $langs->trans(
"Setup");
93 $head[$h][2] =
'holiday';
102 $head[$h][0] = DOL_URL_ROOT.
'/admin/holiday_extrafields.php';
103 $head[$h][1] = $langs->trans(
"ExtraFields");
104 $nbExtrafields = $extrafields->attributes[
'holiday'][
'count'];
105 if ($nbExtrafields > 0) {
106 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
108 $head[$h][2] =
'attributes';
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).