dolibarr
23.0.3
Main Page
Related Pages
Topics
Classes
Files
File List
File Members
dolibarr_23.0
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
require_once DOL_DOCUMENT_ROOT .
'/webportal/controllers/abstractlist.controller.class.php'
;
28
32
class
PropalListController
extends
AbstractListController
33
{
39
public
function
checkAccess
()
40
{
41
$this->accessRight =
isModEnabled
(
'propal'
) &&
getDolGlobalInt
(
'WEBPORTAL_PROPAL_LIST_ACCESS'
);
42
43
return
parent::checkAccess();
44
}
45
52
public
function
action
()
53
{
54
global $langs;
55
56
$context
=
Context::getInstance
();
57
if
(!
$context
->controllerInstance->checkAccess()) {
58
return
-1;
59
}
60
61
// Load translation files required by the page
62
$langs->loadLangs(array(
'companies'
,
'propal'
,
'compta'
,
'bills'
,
'orders'
,
'products'
,
'categories'
));
63
if
(
isModEnabled
(
'shipping'
)) {
64
$langs->loadLangs(array(
'sendings'
));
65
}
66
67
$context
->title = $langs->trans(
'WebPortalPropalListTitle'
);
68
$context
->desc = $langs->trans(
'WebPortalPropalListDesc'
);
69
$context
->menu_active[] =
'propal_list'
;
70
71
// set form list
72
$this->formList =
new
FormListWebPortal
($this->db);
73
$this->formList->init($this,
'propal'
);
74
75
// hook for action
76
$hookRes = $this->
hookDoAction
();
77
if
(empty($hookRes)) {
78
$this->formList->doActions();
79
}
80
81
$this->formList->setSqlRequest();
82
83
// filter on logged third-party
84
$this->formList->sql_body .=
" AND t.fk_soc = "
. ((int)
$context
->logged_thirdparty->id);
85
// discard record with status draft
86
$this->formList->sql_body .=
" AND t.fk_statut <> 0"
;
87
88
$this->formList->loadRecords();
89
$this->formList->setParams();
90
$this->formList->setColumnsVisibility();
91
92
return
1;
93
}
94
100
public
function
display
()
101
{
102
$context
=
Context::getInstance
();
103
if
(!
$context
->controllerInstance->checkAccess()) {
104
$this->
display404
();
105
return
;
106
}
107
108
$this->
loadTemplate
(
'header'
);
109
$this->
loadTemplate
(
'menu'
);
110
$this->
loadTemplate
(
'hero-header-banner'
);
111
112
$hookRes = $this->
hookPrintPageView
();
113
if
(empty($hookRes)) {
114
print
'<main class="container">'
;
115
//print '<figure>';
116
$this->
loadTemplate
(
'list'
);
117
//print '</figure>';
118
print
'</main>'
;
119
}
120
121
$this->
loadTemplate
(
'footer'
);
122
}
123
}
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:38
PropalListController
Class for PropalListController.
Definition
propallist.controller.class.php:33
PropalListController\display
display()
Display.
Definition
propallist.controller.class.php:100
PropalListController\checkAccess
checkAccess()
Check current access to controller.
Definition
propallist.controller.class.php:39
PropalListController\action
action()
Action method is called before html output can be used to manage security and change context.
Definition
propallist.controller.class.php:52
getDolGlobalInt
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
Definition
functions.lib.php:273
isModEnabled
isModEnabled($module)
Is Dolibarr module enabled.
Definition
functions.lib.php:440
$context
$context
@method int call_trigger(string $triggerName, ?User $user)
Definition
logout.php:42
Generated on Mon Jun 22 2026 20:45:36 for
dolibarr
by Doxygen 1.11.0