Passed
Push — main ( 9a81fe...875825 )
by Rafael
41:55
created

BookCalBookCalIndexController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 49
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 46 3
1
<?php
2
3
/* Copyright (C) 2001-2005  Rodolphe Quiedeville    <[email protected]>
4
 * Copyright (C) 2004-2015  Laurent Destailleur     <[email protected]>
5
 * Copyright (C) 2005-2012  Regis Houssin           <[email protected]>
6
 * Copyright (C) 2015       Jean-François Ferry	    <[email protected]>
7
 * Copyright (C) 2024       Rafael San José         <[email protected]>
8
 *
9
 * This program is free software; you can redistribute it and/or modify
10
 * it under the terms of the GNU General Public License as published by
11
 * the Free Software Foundation; either version 3 of the License, or
12
 * (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21
 */
22
23
namespace DoliModules\BookCal\Controller;
24
25
global $conf;
26
global $db;
27
global $user;
28
global $hookmanager;
29
global $user;
30
global $menumanager;
31
global $langs;
32
global $mysoc;
33
34
use DoliCore\Base\DolibarrController;
35
36
/**
37
 *  \file       htdocs/bookcal/bookcalindex.php
38
 *  \ingroup    bookcal
39
 *  \brief      Home page of bookcal top menu
40
 */
41
42
// Load Dolibarr environment
43
require BASE_PATH . '/main.inc.php';
44
45
class BookCalBookCalIndexController extends DolibarrController
46
{
47
48
    public function index(bool $executeActions = true): bool
49
    {
50
        global $conf;
51
        global $db;
52
        global $user;
53
        global $hookmanager;
54
        global $user;
55
        global $menumanager;
56
        global $langs;
57
58
59
// Load translation files required by the page
60
        $langs->loadLangs(["agenda"]);
61
62
        $action = GETPOST('action', 'aZ09');
63
64
65
// Security check
66
// if (! $user->hasRight('bookcal', 'myobject', 'read')) {
67
//  accessforbidden();
68
// }
69
        $socid = GETPOSTINT('socid');
70
        if (isset($user->socid) && $user->socid > 0) {
71
            $action = '';
72
            $socid = $user->socid;
73
        }
74
75
        $max = 5;
76
        $now = dol_now();
77
78
79
        /*
80
         * Actions
81
         */
82
83
// None
84
85
86
        /*
87
         * View
88
         */
89
        require_once realpath(BASE_PATH . '/../Dolibarr/Modules/BookCal/Views/bookcalindex.php');
90
91
        $db->close();
92
93
        return true;
94
    }
95
}
96