34 global $db, $langs, $conf, $user;
40 $head[$h][1] = $langs->trans(
"Leave");
41 $head[$h][2] =
'card';
45 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
46 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
47 $upload_dir = $conf->holiday->multidir_output[
$object->entity ?? $conf->entity].
'/'.
get_exdir(0, 0, 0, 1,
$object,
'holiday');
48 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
50 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/holiday/document.php', [
'id' =>
$object->id]);
51 $head[$h][1] = $langs->trans(
'Documents');
52 if (($nbFiles + $nbLinks) > 0) {
53 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
55 $head[$h][2] =
'documents';
61 $head[$h][1] = $langs->trans(
"Info");
62 $head[$h][2] =
'info';
84 global $db, $langs, $conf, $user;
87 $extrafields->fetch_name_optionals_label(
'holiday');
92 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/admin/holiday.php');
93 $head[$h][1] = $langs->trans(
"Setup");
94 $head[$h][2] =
'holiday';
103 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/admin/holiday_extrafields.php');
104 $head[$h][1] = $langs->trans(
"ExtraFields");
105 $nbExtrafields = $extrafields->attributes[
'holiday'][
'count'];
106 if ($nbExtrafields > 0) {
107 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
109 $head[$h][2] =
'attributes';
if(! $sortfield) if(! $sortorder) $object
static count($dbs, $objecttype, $objectid)
Return nb of links.
dol_dir_list($utf8_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.
dolBuildUrl($url, $params=[], $addtoken=false)
Return path of url.
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).
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
holiday_prepare_head($object)
Return array head with list of tabs to view object information.
holiday_admin_prepare_head()
Return array head with list of tabs to view object information.