dolibarr 25.0.0-alpha
actions_blockedlog.class.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
24require_once DOL_DOCUMENT_ROOT.'/core/class/commonhookactions.class.php';
25
30{
34 public $db;
35
39 public $error = '';
40
44 public $errors = array();
45
46
50 public $results = array();
51
55 public $resprints;
56
60 public $priority;
61
62
68 public function __construct($db)
69 {
70 $this->db = $db;
71 }
72
73
84 public function beforePDFCreation($parameters, &$object, &$action)
85 {
86 global $conf, $user, $langs;
87 global $hookmanager;
88
89 $outputlangs = $langs;
90
91 $ret = 0;
92 $deltemp = array();
93 dol_syslog(get_class($this).'::executeHooks action='.$action);
94
95 /* print_r($parameters); print_r($object); echo "action: " . $action; */
96 // @phan-suppress-next-line PhanPluginEmptyStatementIf
97 if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) {
98 // do something only for the context 'somecontext1' or 'somecontext2'
99 }
100
101 return $ret;
102 }
103
114 public function afterPDFCreation($parameters, &$pdfhandler, &$action)
115 {
116 global $conf, $user, $langs;
117 global $hookmanager;
118
119 $outputlangs = $langs;
120
121 $ret = 0;
122 $deltemp = array();
123 dol_syslog(get_class($this).'::executeHooks action='.$action);
124
125 /* print_r($parameters); print_r($object); echo "action: " . $action; */
126 // @phan-suppress-next-line PhanPluginEmptyStatementIf
127 if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) {
128 // do something only for the context 'somecontext1' or 'somecontext2'
129 }
130
131 return $ret;
132 }
133}
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
Class ActionsBlockedlog.
afterPDFCreation($parameters, &$pdfhandler, &$action)
Execute action after PDF (document) creation.
beforePDFCreation($parameters, &$object, &$action)
Execute action before PDF (document) creation.
Parent class of all other hook actions classes.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.