dolibarr
24.0.0-beta
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
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
// filter on logged third-party
82
$sqlBody =
" AND t.fk_soc = "
.((int)
$context
->logged_thirdparty->id);
83
// discard record with status draft
84
$sqlBody .=
" AND t.fk_statut <> 0"
;
85
$this->formList->setSqlRequest(
''
, $sqlBody);
86
87
$this->formList->loadRecords();
88
$this->formList->setParams();
89
$this->formList->setColumnsVisibility();
90
91
return
1;
92
}
93
99
public
function
display
()
100
{
101
$context
=
Context::getInstance
();
102
if
(!
$context
->controllerInstance->checkAccess()) {
103
$this->
display404
();
104
return
;
105
}
106
107
$this->
loadTemplate
(
'header'
);
108
$this->
loadTemplate
(
'menu'
);
109
$this->
loadTemplate
(
'hero-header-banner'
);
110
111
$hookRes = $this->
hookPrintPageView
();
112
if
(empty($hookRes)) {
113
print
'<main class="container">'
;
114
//print '<figure>';
115
$this->
loadTemplate
(
'list'
);
116
//print '</figure>';
117
print
'</main>'
;
118
}
119
120
$this->
loadTemplate
(
'footer'
);
121
}
122
}
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
PropalListController
Class for PropalListController.
Definition
propallist.controller.class.php:33
PropalListController\display
display()
Display.
Definition
propallist.controller.class.php:99
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: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