34 global $db, $langs,
$conf;
36 $langs->load(
"agenda");
38 $showtabofpagecontact = 0;
39 $showtabofpagenote = 1;
40 $showtabofpagedocument = 0;
41 $showtabofpageagenda = 0;
46 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/availabilities_card.php?id=' .
$object->id;
47 $head[$h][1] = $langs->trans(
"Card");
48 $head[$h][2] =
'card';
51 if ($showtabofpagecontact) {
52 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/availabilities_contact.php?id=' .
$object->id;
53 $head[$h][1] = $langs->trans(
"Contacts");
54 $head[$h][2] =
'contact';
58 if ($showtabofpagenote) {
59 if (isset(
$object->fields[
'note_public']) || isset(
$object->fields[
'note_private'])) {
61 if (!empty(
$object->note_private)) {
64 if (!empty(
$object->note_public)) {
67 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/availabilities_note.php?id=' .
$object->id;
68 $head[$h][1] = $langs->trans(
'Notes');
70 $head[$h][1] .= (!
getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER') ?
'<span class="badge marginleftonlyshort">' . $nbNote .
'</span>' :
'');
72 $head[$h][2] =
'note';
77 if ($showtabofpagedocument) {
78 require_once DOL_DOCUMENT_ROOT .
'/core/lib/files.lib.php';
79 require_once DOL_DOCUMENT_ROOT .
'/core/class/link.class.php';
81 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
83 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/availabilities_document.php?id=' .
$object->id;
84 $head[$h][1] = $langs->trans(
'Documents');
85 if (($nbFiles + $nbLinks) > 0) {
86 $head[$h][1] .=
'<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) .
'</span>';
88 $head[$h][2] =
'document';
92 if ($showtabofpageagenda) {
93 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/availabilities_agenda.php?id=' .
$object->id;
94 $head[$h][1] = $langs->trans(
"Events");
95 $head[$h][2] =
'agenda';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
availabilitiesPrepareHead($object)
Prepare array of tabs for Availabilities.
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.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...