dolibarr 18.0.6
eventorganization.lib.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2021 Florian Henry <florian.henry@scopen.fr>
3 * Copyright (C) 2023 Frédéric France <frederic.france@netlogic.fr>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
31{
32 global $langs, $conf, $db;
33
34 $extrafields = new ExtraFields($db);
35 $extrafields->fetch_name_optionals_label('actioncomm');
36 $extrafields->fetch_name_optionals_label('eventorganization_conferenceorboothattendee');
37
38 $langs->load("eventorganization");
39
40 $h = 0;
41 $head = array();
42
43 $head[$h][0] = DOL_URL_ROOT.'/admin/eventorganization.php';
44 $head[$h][1] = $langs->trans("Settings");
45 $head[$h][2] = 'settings';
46 $h++;
47
48
49 $head[$h][0] = DOL_URL_ROOT.'/admin/eventorganization_confbooth_extrafields.php';
50 $head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("EventOrganizationConfOrBooth").")";
51 $nbExtrafields = $extrafields->attributes['actioncomm']['count'];
52 if ($nbExtrafields > 0) {
53 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
54 }
55 $head[$h][2] = 'eventorganization_extrafields';
56 $h++;
57
58 $head[$h][0] = DOL_URL_ROOT.'/admin/eventorganization_confboothattendee_extrafields.php';
59 $head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Attendees").")";
60 $nbExtrafields = $extrafields->attributes['eventorganization_conferenceorboothattendee']['count'];
61 if ($nbExtrafields > 0) {
62 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
63 }
64 $head[$h][2] = 'conferenceorboothattendee_extrafields';
65 $h++;
66
67 // Show more tabs from modules
68 // Entries must be declared in modules descriptor with line
69 //$this->tabs = array(
70 // 'entity:+tabname:Title:@eventorganization:/eventorganization/mypage.php?id=__ID__'
71 //); // to add new tab
72 //$this->tabs = array(
73 // 'entity:-tabname:Title:@eventorganization:/eventorganization/mypage.php?id=__ID__'
74 //); // to remove a tab
75 complete_head_from_modules($conf, $langs, null, $head, $h, 'eventorganization');
76
77 complete_head_from_modules($conf, $langs, null, $head, $h, 'eventorganization', 'remove');
78
79 return $head;
80}
Class to manage standard extra fields.
eventorganizationAdminPrepareHead()
Prepare admin pages header.
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).