33 global $db, $langs, $conf;
35 $langs->load(
"agenda");
37 $showtabofpagecontact = 0;
38 $showtabofpagenote = 1;
39 $showtabofpagedocument = 0;
40 $showtabofpageagenda = 1;
45 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/calendar_card.php?id=' .
$object->id;
46 $head[$h][1] = $langs->trans(
"Calendar");
47 $head[$h][2] =
'card';
50 if (
$object->status == Calendar::STATUS_VALIDATED) {
51 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/booking_list.php?id=' .
$object->id;
52 $head[$h][1] = $langs->trans(
"Bookings");
53 $head[$h][2] =
'booking';
58 if ($showtabofpagecontact) {
59 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/calendar_contact.php?id=' .
$object->id;
60 $head[$h][1] = $langs->trans(
"Contacts");
61 $head[$h][2] =
'contact';
65 if ($showtabofpagenote) {
66 if (isset(
$object->fields[
'note_public']) || isset(
$object->fields[
'note_private'])) {
68 if (!empty(
$object->note_private)) {
71 if (!empty(
$object->note_public)) {
74 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/calendar_note.php?id=' .
$object->id;
75 $head[$h][1] = $langs->trans(
'Notes');
77 $head[$h][1] .= (!
getDolGlobalInt(
'MAIN_OPTIMIZEFORTEXTBROWSER') ?
'<span class="badge marginleftonlyshort">' . $nbNote .
'</span>' :
'');
79 $head[$h][2] =
'note';
84 if ($showtabofpagedocument) {
85 require_once DOL_DOCUMENT_ROOT .
'/core/lib/files.lib.php';
86 require_once DOL_DOCUMENT_ROOT .
'/core/class/link.class.php';
88 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
90 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/calendar_document.php?id=' .
$object->id;
91 $head[$h][1] = $langs->trans(
'Documents');
92 if (($nbFiles + $nbLinks) > 0) {
93 $head[$h][1] .=
'<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) .
'</span>';
95 $head[$h][2] =
'document';
99 if ($showtabofpageagenda) {
100 $head[$h][0] = DOL_URL_ROOT .
'/bookcal/calendar_agenda.php?id=' .
$object->id;
101 $head[$h][1] = $langs->trans(
"Events");
102 $head[$h][2] =
'agenda';
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.
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).