dolibarr
23.0.3
Main Page
Related Pages
Topics
Classes
Files
File List
File Members
dolibarr_23.0
htdocs
webportal
controllers
partnershipcard.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
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
6
*
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <https://www.gnu.org/licenses/>.
19
*/
20
27
require_once DOL_DOCUMENT_ROOT .
'/webportal/class/html.formcardwebportal.class.php'
;
28
require_once DOL_DOCUMENT_ROOT .
'/webportal/controllers/abstractcard.controller.class.php'
;
29
33
class
PartnershipCardController
extends
AbstractCardController
34
{
40
public
function
checkAccess
()
41
{
42
$context
=
Context::getInstance
();
43
$cardAccess =
getDolGlobalString
(
'WEBPORTAL_PARTNERSHIP_CARD_ACCESS'
);
44
$this->accessRight =
isModEnabled
(
'partnership'
) && in_array($cardAccess, array(
'visible'
,
'edit'
)) &&
$context
->logged_partnership &&
$context
->logged_partnership->id > 0;
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
// Load translation files required by the page
64
$langs->loadLangs(array(
'partnership'
));
65
66
$context
->title = $langs->trans(
'WebPortalPartnershipCardTitle'
);
67
$context
->desc = $langs->trans(
'WebPortalPartnershipCardDesc'
);
68
$context
->menu_active[] =
'partnership_card'
;
69
70
// set form card
71
$cardAccess =
getDolGlobalString
(
'WEBPORTAL_PARTNERSHIP_CARD_ACCESS'
);
72
$permissiontoread = (int)
isModEnabled
(
'partnership'
) && in_array($cardAccess, array(
'visible'
,
'edit'
));
73
$permissiontoadd = (int)
isModEnabled
(
'partnership'
) && in_array($cardAccess, array(
'edit'
));
74
$permissiontodelete = 0;
75
$permissionnote = 0;
76
$permissiondellink = 0;
77
$formCardWebPortal =
new
FormCardWebPortal
($this->db);
78
$formCardWebPortal->init(
'partnership'
,
$context
->logged_partnership->id, (
int
) $permissiontoread, (
int
) $permissiontoadd, $permissiontodelete, $permissionnote, $permissiondellink);
79
80
// hook for action
81
$hookRes = $this->
hookDoAction
();
82
if
(empty($hookRes)) {
83
$formCardWebPortal->doActions();
84
}
85
86
$this->formCard = $formCardWebPortal;
87
88
return
1;
89
}
90
}
AbstractCardController
Class for AbstractCardController.
Definition
abstractcard.controller.class.php:31
Context\getInstance
static getInstance()
Singleton method to create one instance of this object.
Definition
context.class.php:228
Controller\hookDoAction
hookDoAction($parameters=array())
Execute hook doActions.
Definition
controller.class.php:162
FormCardWebPortal
Class to manage generation of HTML components Only common components for WebPortal must be here.
Definition
html.formcardwebportal.class.php:37
PartnershipCardController
Class for PartnershipCardController.
Definition
partnershipcard.controller.class.php:34
PartnershipCardController\action
action()
Action method is called before html output can be used to manage security and change context.
Definition
partnershipcard.controller.class.php:54
PartnershipCardController\checkAccess
checkAccess()
Check current access to controller.
Definition
partnershipcard.controller.class.php:40
getDolGlobalString
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
Definition
functions.lib.php:258
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