34 global $db, $langs,
$conf;
36 $langs->load(
"agenda");
38 $showtabofpagecontact = 0;
39 $showtabofpagenote = 1;
40 $showtabofpagedocument = 0;
41 $showtabofpageagenda = 1;
46 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/calendar_card.php?id=' .
$object->id;
47 $head[$h][1] = $langs->trans(
"Calendar");
48 $head[$h][2] =
'card';
51 if (
$object->status == Calendar::STATUS_VALIDATED) {
52 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/booking_list.php?id=' .
$object->id;
53 $head[$h][1] = $langs->trans(
"Bookings");
54 $head[$h][2] =
'booking';
59 if ($showtabofpagecontact) {
60 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/calendar_contact.php?id=' .
$object->id;
61 $head[$h][1] = $langs->trans(
"Contacts");
62 $head[$h][2] =
'contact';
66 if ($showtabofpagenote) {
67 if (isset(
$object->fields[
'note_public']) || isset(
$object->fields[
'note_private'])) {
69 if (!empty(
$object->note_private)) {
72 if (!empty(
$object->note_public)) {
75 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/calendar_note.php?id=' .
$object->id;
76 $head[$h][1] = $langs->trans(
'Notes');
78 $head[$h][1] .= (!
getDolGlobalInt(
'MAIN_OPTIMIZEFORTEXTBROWSER') ?
'<span class="badge marginleftonlyshort">' . $nbNote .
'</span>' :
'');
80 $head[$h][2] =
'note';
85 if ($showtabofpagedocument) {
86 require_once DOL_DOCUMENT_ROOT .
'/core/lib/files.lib.php';
87 require_once DOL_DOCUMENT_ROOT .
'/core/class/link.class.php';
89 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
91 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/calendar_document.php?id=' .
$object->id;
92 $head[$h][1] = $langs->trans(
'Documents');
93 if (($nbFiles + $nbLinks) > 0) {
94 $head[$h][1] .=
'<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) .
'</span>';
96 $head[$h][2] =
'document';
100 if ($showtabofpageagenda) {
101 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/calendar_agenda.php?id=' .
$object->id;
102 $head[$h][1] = $langs->trans(
"Events");
103 $head[$h][2] =
'agenda';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
calendarPrepareHead($object)
Prepare array of tabs for Calendar.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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).
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...