dolibarr
19.0.0-dev
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
dolibarr_dev
htdocs
core
triggers
dolibarrtriggers.class.php
1
<?php
2
/* Copyright (C) 2014 Marcos GarcĂa <marcosgdf@gmail.com>
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
21
abstract
class
DolibarrTriggers
22
{
27
protected
$db;
28
33
public
$name =
''
;
34
39
public
$description =
''
;
40
45
public
$version = self::VERSION_DEVELOPMENT;
46
51
public
$picto =
'technic'
;
52
57
public
$family =
''
;
58
65
public
$error =
''
;
66
71
public
$errors = array();
72
76
const
VERSION_DEVELOPMENT =
'development'
;
77
81
const
VERSION_EXPERIMENTAL =
'experimental'
;
82
86
const
VERSION_DOLIBARR =
'dolibarr'
;
87
93
public
function
__construct
(
DoliDB
$db)
94
{
95
96
$this->db = $db;
97
98
if
(empty($this->
name
)) {
99
$this->
name
= preg_replace(
'/^Interface/i'
,
''
, get_class($this));
100
}
101
}
102
108
public
function
getName
()
109
{
110
return
$this->name;
111
}
112
118
public
function
getDesc
()
119
{
120
return
$this->description;
121
}
122
128
public
function
getVersion
()
129
{
130
global $langs;
131
$langs->load(
"admin"
);
132
133
if
($this->version == self::VERSION_DEVELOPMENT) {
134
return
$langs->trans(
"VersionDevelopment"
);
135
} elseif ($this->version == self::VERSION_EXPERIMENTAL) {
136
return
$langs->trans(
"VersionExperimental"
);
137
} elseif ($this->version == self::VERSION_DOLIBARR) {
138
return
DOL_VERSION;
139
} elseif ($this->version) {
140
return
$this->version;
141
}
else
{
142
return
$langs->trans(
"Unknown"
);
143
}
144
}
145
157
abstract
public
function
runTrigger
($action, $object,
User
$user,
Translate
$langs,
Conf
$conf);
158
}
DoliDB
Class to manage Dolibarr database access.
Definition:
DoliDB.class.php:30
DolibarrTriggers\runTrigger
runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
Function called when a Dolibarrr business event is done.
Translate
Class to manage translations.
Definition:
translate.class.php:30
name
$conf db name
Definition:
repair.php:123
Conf
Class to stock current configuration.
Definition:
conf.class.php:33
User
Class to manage Dolibarr users.
Definition:
user.class.php:47
DolibarrTriggers\getDesc
getDesc()
Returns the description of trigger file.
Definition:
dolibarrtriggers.class.php:118
DolibarrTriggers\getName
getName()
Returns the name of the trigger file.
Definition:
dolibarrtriggers.class.php:108
DolibarrTriggers
Class that all the triggers must extend.
Definition:
dolibarrtriggers.class.php:21
DolibarrTriggers\__construct
__construct(DoliDB $db)
Constructor.
Definition:
dolibarrtriggers.class.php:93
DolibarrTriggers\getVersion
getVersion()
Returns the version of the trigger file.
Definition:
dolibarrtriggers.class.php:128
Generated on Sun Oct 1 2023 01:01:55 for
dolibarr
by Doxygen 1.8.17