dolibarr
21.0.0-alpha
Main Page
Related Pages
Topics
Classes
Files
File List
File Members
dolibarr_dev
htdocs
webportal
controllers
orderlist.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
OrderListController
extends
Controller
32
{
36
protected
$formList;
37
38
44
public
function
checkAccess
()
45
{
46
$this->accessRight = isModEnabled(
'order'
) &&
getDolGlobalInt
(
'WEBPORTAL_ORDER_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(
'orders'
,
'sendings'
,
'deliveries'
,
'companies'
,
'compta'
,
'bills'
,
'stocks'
,
'products'
));
68
69
$context->title = $langs->trans(
'WebPortalOrderListTitle'
);
70
$context->desc = $langs->trans(
'WebPortalOrderListDesc'
);
71
$context->menu_active[] =
'order_list'
;
72
73
// set form list
74
$formListWebPortal =
new
FormListWebPortal
($this->db);
75
$formListWebPortal->init(
'order'
);
76
77
// hook for action
78
$hookRes = $this->
hookDoAction
();
79
if
(empty($hookRes)) {
80
$formListWebPortal->doActions();
81
}
82
83
$this->formList = $formListWebPortal;
84
85
return
1;
86
}
87
93
public
function
display
()
94
{
95
$context =
Context::getInstance
();
96
if
(!$context->controllerInstance->checkAccess()) {
97
$this->
display404
();
98
return
;
99
}
100
101
$this->
loadTemplate
(
'header'
);
102
$this->
loadTemplate
(
'menu'
);
103
$this->
loadTemplate
(
'hero-header-banner'
);
104
105
$hookRes = $this->
hookPrintPageView
();
106
if
(empty($hookRes)) {
107
print
'<main class="container">'
;
108
//print '<figure>';
109
print $this->formList->elementList($context);
110
//print '</figure>';
111
print
'</main>'
;
112
}
113
114
$this->
loadTemplate
(
'footer'
);
115
}
116
}
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
OrderListController
Class for OrderListController.
Definition
orderlist.controller.class.php:32
OrderListController\display
display()
Display.
Definition
orderlist.controller.class.php:93
OrderListController\checkAccess
checkAccess()
Check current access to controller.
Definition
orderlist.controller.class.php:44
OrderListController\action
action()
Action method is called before html output can be used to manage security and change context.
Definition
orderlist.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