32 global $db, $langs, $conf, $user;
37 $head[$h][0] = DOL_URL_ROOT.
'/holiday/card.php?id='.$object->id;
38 $head[$h][1] = $langs->trans(
"Leave");
39 $head[$h][2] =
'card';
43 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
44 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
45 $upload_dir = $conf->holiday->multidir_output[$object->entity].
'/'.
dol_sanitizeFileName($object->ref);
46 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
47 $nbLinks =
Link::count($db, $object->element, $object->id);
48 $head[$h][0] = DOL_URL_ROOT.
'/holiday/document.php?id='.$object->id;
49 $head[$h][1] = $langs->trans(
'Documents');
50 if (($nbFiles + $nbLinks) > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
51 $head[$h][2] =
'documents';
54 $head[$h][0] = DOL_URL_ROOT.
'/holiday/info.php?id='.$object->id;
55 $head[$h][1] = $langs->trans(
"Info");
56 $head[$h][2] =
'info';
78 global $db, $langs, $conf, $user;
83 $head[$h][0] = DOL_URL_ROOT.
'/admin/holiday.php';
84 $head[$h][1] = $langs->trans(
"Setup");
85 $head[$h][2] =
'holiday';
94 $head[$h][0] = DOL_URL_ROOT.
'/admin/holiday_extrafields.php';
95 $head[$h][1] = $langs->trans(
"ExtraFields");
96 $head[$h][2] =
'attributes';
holiday_prepare_head($object)
Return array head with list of tabs to view object informations.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
static count($db, $objecttype, $objectid)
Return nb of links.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode= 'add')
Complete or removed entries into a head array (used to build tabs).
holiday_admin_prepare_head()
Return array head with list of tabs to view object informations.