dolibarr
21.0.0-alpha
Main Page
Related Pages
Topics
Classes
Files
File List
File Members
dolibarr_dev
htdocs
webportal
controllers
propallist.controller.class.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (C) 2023-2024 Laurent Destailleur <eldy@users.sourceforge.net>
3
* Copyright (C) 2023-2024 Lionel Vessiller <lvessiller@easya.solutions>
4
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <https://www.gnu.org/licenses/>.
18
*/
19
26
require_once DOL_DOCUMENT_ROOT .
'/webportal/class/html.formlistwebportal.class.php'
;
27
31
class
PropalListController
extends
Controller
32
{
36
protected
$formList;
37
38
44
public
function
checkAccess
()
45
{
46
$this->accessRight = isModEnabled(
'propal'
) &&
getDolGlobalInt
(
'WEBPORTAL_PROPAL_LIST_ACCESS'
);
47
48
return
parent::checkAccess();
49
}
50
57
public
function
action
()
58
{
59
global $langs;
60
61
$context =
Context::getInstance
();
62
if
(!$context->controllerInstance->checkAccess()) {
63
return
-1;
64
}
65
66
// Load translation files required by the page
67
$langs->loadLangs(array(
'companies'
,
'propal'
,
'compta'
,
'bills'
,
'orders'
,
'products'
,
'deliveries'
,
'categories'
));
68
if
(isModEnabled(
'shipping'
)) {
69
$langs->loadLangs(array(
'sendings'
));
70
}
71
72
$context->title = $langs->trans(
'WebPortalPropalListTitle'
);
73
$context->desc = $langs->trans(
'WebPortalPropalListDesc'
);
74
$context->menu_active[] =
'propal_list'
;
75
76
// set form list
77
$formListWebPortal =
new
FormListWebPortal
($this->db);
78
$formListWebPortal->init(
'propal'
);
79
80
// hook for action
81
$hookRes = $this->
hookDoAction
();
82
if
(empty($hookRes)) {
83
$formListWebPortal->doActions();
84
}
85
86
$this->formList = $formListWebPortal;
87
88
return
1;
89
}
90
96
public
function
display
()
97
{
98
$context =
Context::getInstance
();
99
if
(!$context->controllerInstance->checkAccess()) {
100
$this->
display404
();
101
return
;
102
}
103
104
$this->
loadTemplate
(
'header'
);
105
$this->
loadTemplate
(
'menu'
);
106
$this->
loadTemplate
(
'hero-header-banner'
);
107
108
$hookRes = $this->
hookPrintPageView
();
109
if
(empty($hookRes)) {
110
print
'<main class="container">'
;
111
//print '<figure>';
112
print $this->formList->elementList($context);
113
//print '</figure>';
114
print
'</main>'
;
115
}
116
117
$this->
loadTemplate
(
'footer'
);
118
}
119
}
Context\getInstance
static getInstance()
Singleton method to create one instance of this object.
Definition
context.class.php:197
Controller
Class to manage pages.
Definition
controller.class.php:29
Controller\hookPrintPageView
hookPrintPageView($parameters=array())
Execute hook PrintPageView.
Definition
controller.class.php:171
Controller\display404
display404()
Display error template.
Definition
controller.class.php:135
Controller\hookDoAction
hookDoAction($parameters=array())
Execute hook doActions.
Definition
controller.class.php:148
Controller\loadTemplate
loadTemplate($templateName, $vars=false)
Load a template .tpl file.
Definition
controller.class.php:195
FormListWebPortal
Class to manage generation of HTML components Only common components for WebPortal must be here.
Definition
html.formlistwebportal.class.php:39
PropalListController
Class for PropalListController.
Definition
propallist.controller.class.php:32
PropalListController\display
display()
Display.
Definition
propallist.controller.class.php:96
PropalListController\checkAccess
checkAccess()
Check current access to controller.
Definition
propallist.controller.class.php:44
PropalListController\action
action()
Action method is called before html output can be used to manage security and change context.
Definition
propallist.controller.class.php:57
getDolGlobalInt
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
Definition
functions.lib.php:230
Generated on Sun Sep 1 2024 01:00:34 for
dolibarr
by Doxygen 1.11.0