dolibarr
24.0.0-beta
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
25
require_once DOL_DOCUMENT_ROOT .
'/webportal/class/html.formlistwebportal.class.php'
;
26
require_once DOL_DOCUMENT_ROOT .
'/webportal/controllers/abstractlist.controller.class.php'
;
27
31
class
InvoiceListController
extends
AbstractListController
32
{
38
public
function
checkAccess
()
39
{
40
$this->accessRight =
isModEnabled
(
'invoice'
) &&
getDolGlobalInt
(
'WEBPORTAL_INVOICE_LIST_ACCESS'
);
41
42
return
parent::checkAccess();
43
}
44
51
public
function
action
()
52
{
53
global $langs;
54
55
$context
=
Context::getInstance
();
56
if
(!
$context
->controllerInstance->checkAccess()) {
57
return
-1;
58
}
59
60
// Load translation files required by the page
61
$langs->loadLangs(array(
'bills'
,
'companies'
,
'products'
,
'categories'
));
62
63
$context
->title = $langs->trans(
'WebPortalInvoiceListTitle'
);
64
$context
->desc = $langs->trans(
'WebPortalInvoiceListDesc'
);
65
$context
->menu_active[] =
'invoice_list'
;
66
67
// set form list
68
$this->formList =
new
FormListWebPortal
($this->db);
69
$this->formList->init($this,
'invoice'
);
70
71
// hook for action
72
$hookRes = $this->
hookDoAction
();
73
if
(empty($hookRes)) {
74
$this->formList->doActions();
75
}
76
77
// filter on logged third-party
78
$sqlBody =
" AND t.fk_soc = "
.((int)
$context
->logged_thirdparty->id);
79
// discard record with status draft
80
$sqlBody .=
" AND t.fk_statut <> 0"
;
81
$this->formList->setSqlRequest(
''
, $sqlBody);
82
83
$this->formList->loadRecords();
84
$this->formList->setParams();
85
$this->formList->setColumnsVisibility();
86
87
return
1;
88
}
89
95
public
function
display
()
96
{
97
$context
=
Context::getInstance
();
98
if
(!
$context
->controllerInstance->checkAccess()) {
99
$this->
display404
();
100
return
;
101
}
102
103
$this->
loadTemplate
(
'header'
);
104
$this->
loadTemplate
(
'menu'
);
105
$this->
loadTemplate
(
'hero-header-banner'
);
106
107
$hookRes = $this->
hookPrintPageView
();
108
if
(empty($hookRes)) {
109
print
'<main class="container">'
;
110
//print '<figure>';
111
$this->
loadTemplate
(
'list'
);
112
//print '</figure>';
113
print
'</main>'
;
114
}
115
116
$this->
loadTemplate
(
'footer'
);
117
}
118
}
AbstractListController
Class for AbstractListController.
Definition
abstractlist.controller.class.php:31
Context\getInstance
static getInstance()
Singleton method to create one instance of this object.
Definition
context.class.php:228
Controller\hookPrintPageView
hookPrintPageView($parameters=array())
Execute hook PrintPageView.
Definition
controller.class.php:185
Controller\display404
display404()
Display error template.
Definition
controller.class.php:149
Controller\hookDoAction
hookDoAction($parameters=array())
Execute hook doActions.
Definition
controller.class.php:162
Controller\loadTemplate
loadTemplate($templateName, $vars=false)
Load a template .tpl file.
Definition
controller.class.php:209
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:32
InvoiceListController\checkAccess
checkAccess()
Check current access to controller.
Definition
invoicelist.controller.class.php:38
InvoiceListController\display
display()
Display.
Definition
invoicelist.controller.class.php:95
InvoiceListController\action
action()
Action method is called before html output can be used to manage security and change context.
Definition
invoicelist.controller.class.php:51
getDolGlobalInt
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
Definition
functions.lib.php:321
isModEnabled
isModEnabled($module)
Is Dolibarr module enabled.
Definition
functions.lib.php:489
$context
$context
@method int call_trigger(string $triggerName, ?User $user)
Definition
logout.php:42
Generated on Mon Jun 22 2026 21:04:50 for
dolibarr
by Doxygen 1.11.0