dolibarr
21.0.0-alpha
Main Page
Related Pages
Topics
Classes
Files
File List
File Members
dolibarr_dev
htdocs
webportal
controllers
invoicelist.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
*
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
28
class
InvoiceListController
extends
Controller
29
{
33
protected
$formList;
34
35
41
public
function
checkAccess
()
42
{
43
$this->accessRight = isModEnabled(
'invoice'
) &&
getDolGlobalInt
(
'WEBPORTAL_INVOICE_LIST_ACCESS'
);
44
45
return
parent::checkAccess();
46
}
47
54
public
function
action
()
55
{
56
global $langs;
57
58
$context =
Context::getInstance
();
59
if
(!$context->controllerInstance->checkAccess()) {
60
return
-1;
61
}
62
63
dol_include_once
(
'/webportal/class/html.formlistwebportal.class.php'
);
64
65
// Load translation files required by the page
66
$langs->loadLangs(array(
'bills'
,
'companies'
,
'products'
,
'categories'
));
67
68
$context->title = $langs->trans(
'WebPortalInvoiceListTitle'
);
69
$context->desc = $langs->trans(
'WebPortalInvoiceListDesc'
);
70
$context->menu_active[] =
'invoice_list'
;
71
72
// set form list
73
$formListWebPortal =
new
FormListWebPortal
($this->db);
74
$formListWebPortal->init(
'invoice'
);
75
76
// hook for action
77
$hookRes = $this->
hookDoAction
();
78
if
(empty($hookRes)) {
79
$formListWebPortal->doActions();
80
}
81
82
$this->formList = $formListWebPortal;
83
84
return
1;
85
}
86
92
public
function
display
()
93
{
94
$context =
Context::getInstance
();
95
if
(!$context->controllerInstance->checkAccess()) {
96
$this->
display404
();
97
return
;
98
}
99
100
$this->
loadTemplate
(
'header'
);
101
$this->
loadTemplate
(
'menu'
);
102
$this->
loadTemplate
(
'hero-header-banner'
);
103
104
$hookRes = $this->
hookPrintPageView
();
105
if
(empty($hookRes)) {
106
print
'<main class="container">'
;
107
//print '<figure>';
108
print $this->formList->elementList($context);
109
//print '</figure>';
110
print
'</main>'
;
111
}
112
113
$this->
loadTemplate
(
'footer'
);
114
}
115
}
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
InvoiceListController
Class for InvoiceListController.
Definition
invoicelist.controller.class.php:29
InvoiceListController\checkAccess
checkAccess()
Check current access to controller.
Definition
invoicelist.controller.class.php:41
InvoiceListController\display
display()
Display.
Definition
invoicelist.controller.class.php:92
InvoiceListController\action
action()
Action method is called before html output can be used to manage security and change context.
Definition
invoicelist.controller.class.php:54
getDolGlobalInt
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
Definition
functions.lib.php:230
dol_include_once
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
Definition
functions.lib.php:1362
Generated on Sun Sep 1 2024 01:00:34 for
dolibarr
by Doxygen 1.11.0