dolibarr 21.0.0-alpha
actions_extrafields.inc.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2011-2020 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 * or see https://www.gnu.org/
18 *
19 * $elementype must be defined.
20 */
21
28$maxsizestring = 255;
29$maxsizeint = 10;
30$mesg = '';
31$mesgs = array();
32
33$extrasize = GETPOST('size', 'intcomma');
34$type = GETPOST('type', 'alphanohtml');
35$param = GETPOST('param', 'alphanohtml');
36$css = GETPOST('css', 'alphanohtml');
37$cssview = GETPOST('cssview', 'alphanohtml');
38$csslist = GETPOST('csslist', 'alphanohtml');
39$confirm = GETPOST('confirm', 'alpha');
40
41if ($type == 'double' && strpos($extrasize, ',') === false) {
42 $extrasize = '24,8';
43}
44if ($type == 'date') {
45 $extrasize = '';
46}
47if ($type == 'datetime') {
48 $extrasize = '';
49}
50if ($type == 'select') {
51 $extrasize = '';
52}
53
54$listofreservedwords = array(
55 'ADD', 'ALL', 'ALTER', 'ANALYZE', 'AND', 'AS', 'ASENSITIVE', 'BEFORE', 'BETWEEN', 'BINARY', 'BLOB', 'BOTH', 'CALL', 'CASCADE', 'CASE', 'CHANGE', 'CHAR', 'CHARACTER', 'CHECK', 'COLLATE', 'COLUMN', 'CONDITION', 'CONSTRAINT', 'CONTINUE', 'CONVERT', 'CREATE', 'CROSS', 'CURRENT_DATE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'CURRENT_USER',
56 'CURSOR', 'DATABASE', 'DATABASES', 'DAY_HOUR', 'DAY_MICROSECOND', 'DAY_MINUTE', 'DAY_SECOND', 'DECIMAL', 'DECLARE', 'DEFAULT', 'DELAYED', 'DELETE', 'DESC', 'DESCRIBE', 'DETERMINISTIC', 'DISTINCT', 'DISTINCTROW', 'DOUBLE', 'DROP', 'DUAL',
57 'EACH', 'ELSE', 'ELSEIF', 'ENCLOSED', 'ESCAPED', 'EXISTS', 'EXPLAIN', 'FALSE', 'FETCH', 'FLOAT', 'FLOAT4', 'FLOAT8', 'FORCE', 'FOREIGN', 'FULLTEXT', 'GRANT', 'GROUP', 'HAVING', 'HIGH_PRIORITY', 'HOUR_MICROSECOND', 'HOUR_MINUTE', 'HOUR_SECOND',
58 'IGNORE', 'IGNORE_SERVER_IDS', 'INDEX', 'INFILE', 'INNER', 'INOUT', 'INSENSITIVE', 'INSERT', 'INT', 'INTEGER', 'INTERVAL', 'INTO', 'ITERATE',
59 'KEYS', 'KEYWORD', 'LEADING', 'LEAVE', 'LEFT', 'LIKE', 'LIMIT', 'LINES', 'LOCALTIME', 'LOCALTIMESTAMP', 'LONGBLOB', 'LONGTEXT', 'MASTER_SSL_VERIFY_SERVER_CERT', 'MATCH', 'MEDIUMBLOB', 'MEDIUMINT', 'MEDIUMTEXT', 'MIDDLEINT', 'MINUTE_MICROSECOND', 'MINUTE_SECOND', 'MODIFIES', 'NATURAL', 'NOT', 'NO_WRITE_TO_BINLOG', 'NUMERIC',
60 'OFFSET', 'ON', 'OPTION', 'OPTIONALLY', 'OUTER', 'OUTFILE',
61 'PARTITION', 'POSITION', 'PRECISION', 'PRIMARY', 'PROCEDURE', 'PURGE', 'RANGE', 'READS', 'READ_WRITE', 'REAL', 'REFERENCES', 'REGEXP', 'RELEASE', 'RENAME', 'REPEAT', 'REQUIRE', 'RESTRICT', 'RETURN', 'REVOKE', 'RIGHT', 'RLIKE',
62 'SCHEMAS', 'SECOND_MICROSECOND', 'SENSITIVE', 'SEPARATOR', 'SIGNAL', 'SMALLINT', 'SPATIAL', 'SPECIFIC', 'SQLEXCEPTION', 'SQLSTATE', 'SQLWARNING', 'SQL_BIG_RESULT', 'SQL_CALC_FOUND_ROWS', 'SQL_SMALL_RESULT', 'SSL', 'STARTING', 'STRAIGHT_JOIN',
63 'TABLE', 'TERMINATED', 'TINYBLOB', 'TINYINT', 'TINYTEXT', 'TRAILING', 'TRIGGER', 'UNDO', 'UNIQUE', 'UNSIGNED', 'UPDATE', 'USAGE', 'USING', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP', 'VALUES', 'VARBINARY', 'VARCHAR', 'VARYING',
64 'WHEN', 'WHERE', 'WHILE', 'WRITE', 'XOR', 'YEAR_MONTH', 'ZEROFILL'
65);
66
67// Add attribute
68if ($action == 'add') {
69 if (GETPOST("button") != $langs->trans("Cancel")) {
70 // Check values
71 if (!$type) {
72 $error++;
73 $langs->load("errors");
74 $mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"));
75 $action = 'create';
76 }
77 if ($type == 'varchar' && $extrasize <= 0) {
78 $error++;
79 $langs->load("errors");
80 $mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Size"));
81 $action = 'edit';
82 }
83 if ($type == 'varchar' && $extrasize > $maxsizestring) {
84 $error++;
85 $langs->load("errors");
86 $mesgs[] = $langs->trans("ErrorSizeTooLongForVarcharType", $maxsizestring);
87 $action = 'create';
88 }
89 if ($type == 'int' && $extrasize > $maxsizeint) {
90 $error++;
91 $langs->load("errors");
92 $mesgs[] = $langs->trans("ErrorSizeTooLongForIntType", $maxsizeint);
93 $action = 'create';
94 }
95 if ($type == 'stars' && ($extrasize < 1 || $extrasize > 10)) {
96 $error++;
97 $langs->load("errors");
98 $mesgs[] = $langs->trans("ErrorSizeForStarsType");
99 $action = 'create';
100 }
101 if ($type == 'select' && !$param) {
102 $error++;
103 $langs->load("errors");
104 $mesgs[] = $langs->trans("ErrorNoValueForSelectType");
105 $action = 'create';
106 }
107 if ($type == 'sellist' && !$param) {
108 $error++;
109 $langs->load("errors");
110 $mesgs[] = $langs->trans("ErrorNoValueForSelectListType");
111 $action = 'create';
112 }
113 if ($type == 'checkbox' && !$param) {
114 $error++;
115 $langs->load("errors");
116 $mesgs[] = $langs->trans("ErrorNoValueForCheckBoxType");
117 $action = 'create';
118 }
119 if ($type == 'link' && !$param) {
120 $error++;
121 $langs->load("errors");
122 $mesgs[] = $langs->trans("ErrorNoValueForLinkType");
123 $action = 'create';
124 }
125 if ($type == 'radio' && !$param) {
126 $error++;
127 $langs->load("errors");
128 $mesgs[] = $langs->trans("ErrorNoValueForRadioType");
129 $action = 'create';
130 }
131 if ((($type == 'radio') || ($type == 'checkbox')) && $param) {
132 // Construct array for parameter (value of select list)
133 $parameters = $param;
134 $parameters_array = explode("\r\n", $parameters);
135 foreach ($parameters_array as $param_ligne) {
136 if (!empty($param_ligne)) {
137 if (preg_match_all('/,/', $param_ligne, $matches)) {
138 if (count($matches[0]) > 1) {
139 $error++;
140 $langs->load("errors");
141 $mesgs[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
142 $action = 'create';
143 }
144 } else {
145 $error++;
146 $langs->load("errors");
147 $mesgs[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
148 $action = 'create';
149 }
150 }
151 }
152 }
153
154 if (!$error) {
155 if (strlen(GETPOST('attrname', 'aZ09')) < 3) {
156 $error++;
157 $langs->load("errors");
158 $mesgs[] = $langs->trans("ErrorValueLength", $langs->transnoentitiesnoconv("AttributeCode"), 3);
159 $action = 'create';
160 }
161 }
162
163 // Check reserved keyword with more than 3 characters
164 if (!$error) {
165 if (in_array(strtoupper(GETPOST('attrname', 'aZ09')), $listofreservedwords)) {
166 $error++;
167 $langs->load("errors");
168 $mesgs[] = $langs->trans("ErrorReservedKeyword", GETPOST('attrname', 'aZ09'));
169 $action = 'create';
170 }
171 }
172
173 if (!$error) {
174 // attrname must be alphabetical and lower case only
175 if (GETPOSTISSET("attrname") && preg_match("/^[a-z0-9_]+$/", GETPOST('attrname', 'aZ09')) && !is_numeric(GETPOST('attrname', 'aZ09'))) {
176 // Construct array for parameter (value of select list)
177 $default_value = GETPOST('default_value', 'alpha');
178 $parameters = $param;
179 $parameters_array = explode("\r\n", $parameters);
180 $params = array();
181 //In sellist we have only one line and it can have come to do SQL expression
182 if ($type == 'sellist' || $type == 'chkbxlst') {
183 foreach ($parameters_array as $param_ligne) {
184 $params['options'] = array($parameters => null);
185 }
186 } else {
187 // Else it's separated key/value and coma list
188 foreach ($parameters_array as $param_ligne) {
189 if (strpos($param_ligne, ',') !== false) {
190 list($key, $value) = explode(',', $param_ligne);
191 if (!array_key_exists('options', $params)) {
192 $params['options'] = array();
193 }
194 } else {
195 $key = $param_ligne;
196 $value = null;
197 }
198 $params['options'][$key] = $value;
199 }
200 }
201
202 // Visibility: -1=not visible by default in list, 1=visible, 0=hidden
203 $visibility = GETPOST('list', 'alpha');
204 if (in_array($type, ['separate', 'point', 'linestrg', 'polygon'])) {
205 $visibility = 3;
206 }
207
208 $result = $extrafields->addExtraField(
209 GETPOST('attrname', 'aZ09'),
210 GETPOST('label', 'alpha'),
211 $type,
212 GETPOSTINT('pos'),
213 $extrasize,
214 $elementtype,
215 (GETPOST('unique', 'alpha') ? 1 : 0),
216 (GETPOST('required', 'alpha') ? 1 : 0),
217 $default_value,
218 $params,
219 (GETPOST('alwayseditable', 'alpha') ? 1 : 0),
220 (GETPOST('perms', 'alpha') ? GETPOST('perms', 'alpha') : ''),
221 $visibility,
222 GETPOST('help', 'alpha'),
223 GETPOST('computed_value', 'alpha'),
224 (GETPOST('entitycurrentorall', 'alpha') ? 0 : ''),
225 GETPOST('langfile', 'alpha'),
226 1,
227 (GETPOST('totalizable', 'alpha') ? 1 : 0),
228 GETPOST('printable', 'alpha'),
229 array('css' => $css, 'cssview' => $cssview, 'csslist' => $csslist)
230 );
231 if ($result > 0) {
232 setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
233 header("Location: ".$_SERVER["PHP_SELF"]);
234 exit;
235 } else {
236 $error++;
237 $mesg = $extrafields->error;
238 $mesgs = array_merge($mesgs, $extrafields->errors);
239 setEventMessages($mesg, $mesgs, 'errors');
240 }
241 } else {
242 $error++;
243 $langs->load("errors");
244 $mesg = $langs->trans("ErrorFieldCanNotContainSpecialNorUpperCharacters", $langs->transnoentities("AttributeCode"));
245 setEventMessages($mesg, $mesgs, 'errors');
246 $action = 'create';
247 }
248 } else {
249 setEventMessages($mesg, $mesgs, 'errors');
250 }
251 }
252}
253
254// Rename field
255if ($action == 'update') {
256 if (GETPOST("button") != $langs->trans("Cancel")) {
257 // Check values
258 if (!$type) {
259 $error++;
260 $langs->load("errors");
261 $mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"));
262 $action = 'edit';
263 }
264 if ($type == 'varchar' && $extrasize <= 0) {
265 $error++;
266 $langs->load("errors");
267 $mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Size"));
268 $action = 'edit';
269 }
270 if ($type == 'varchar' && $extrasize > $maxsizestring) {
271 $error++;
272 $langs->load("errors");
273 $mesgs[] = $langs->trans("ErrorSizeTooLongForVarcharType", $maxsizestring);
274 $action = 'edit';
275 }
276 if ($type == 'int' && $extrasize > $maxsizeint) {
277 $error++;
278 $langs->load("errors");
279 $mesgs[] = $langs->trans("ErrorSizeTooLongForIntType", $maxsizeint);
280 $action = 'edit';
281 }
282 if ($type == 'select' && !$param) {
283 $error++;
284 $langs->load("errors");
285 $mesgs[] = $langs->trans("ErrorNoValueForSelectType");
286 $action = 'edit';
287 }
288 if ($type == 'sellist' && !$param) {
289 $error++;
290 $langs->load("errors");
291 $mesgs[] = $langs->trans("ErrorNoValueForSelectListType");
292 $action = 'edit';
293 }
294 if ($type == 'stars' && ($extrasize < 1|| $extrasize > 10)) {
295 $error++;
296 $langs->load("errors");
297 $mesgs[] = $langs->trans("ErrorSizeForStarsType");
298 $action = 'edit';
299 }
300 if ($type == 'checkbox' && !$param) {
301 $error++;
302 $langs->load("errors");
303 $mesgs[] = $langs->trans("ErrorNoValueForCheckBoxType");
304 $action = 'edit';
305 }
306 if ($type == 'radio' && !$param) {
307 $error++;
308 $langs->load("errors");
309 $mesgs[] = $langs->trans("ErrorNoValueForRadioType");
310 $action = 'edit';
311 }
312 if ((($type == 'radio') || ($type == 'checkbox')) && $param) {
313 // Construct array for parameter (value of select list)
314 $parameters = $param;
315 $parameters_array = explode("\r\n", $parameters);
316 foreach ($parameters_array as $param_ligne) {
317 if (!empty($param_ligne)) {
318 if (preg_match_all('/,/', $param_ligne, $matches)) {
319 if (count($matches[0]) > 1) {
320 $error++;
321 $langs->load("errors");
322 $mesgs[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
323 $action = 'edit';
324 }
325 } else {
326 $error++;
327 $langs->load("errors");
328 $mesgs[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
329 $action = 'edit';
330 }
331 }
332 }
333 }
334
335 if (!$error) {
336 if (strlen(GETPOST('attrname', 'aZ09')) < 3 && !getDolGlobalString('MAIN_DISABLE_EXTRAFIELDS_CHECK_FOR_UPDATE')) {
337 $error++;
338 $langs->load("errors");
339 $mesgs[] = $langs->trans("ErrorValueLength", $langs->transnoentitiesnoconv("AttributeCode"), 3);
340 $action = 'edit';
341 }
342 }
343
344 // Check reserved keyword with more than 3 characters
345 if (!$error) {
346 if (in_array(strtoupper(GETPOST('attrname', 'aZ09')), $listofreservedwords) && !getDolGlobalString('MAIN_DISABLE_EXTRAFIELDS_CHECK_FOR_UPDATE')) {
347 $error++;
348 $langs->load("errors");
349 $mesgs[] = $langs->trans("ErrorReservedKeyword", GETPOST('attrname', 'aZ09'));
350 $action = 'edit';
351 }
352 }
353
354 if (!$error) {
355 if (GETPOSTISSET("attrname") && preg_match("/^\w[a-zA-Z0-9-_]*$/", GETPOST('attrname', 'aZ09')) && !is_numeric(GETPOST('attrname', 'aZ09'))) {
356 $pos = GETPOSTINT('pos');
357 // Construct array for parameter (value of select list)
358 $parameters = $param;
359 $parameters_array = explode("\r\n", $parameters);
360 $params = array();
361 //In sellist we have only one line and it can have come to do SQL expression
362 if ($type == 'sellist' || $type == 'chkbxlst') {
363 foreach ($parameters_array as $param_ligne) {
364 $params['options'] = array($parameters => null);
365 }
366 } else {
367 //Else it's separated key/value and coma list
368 foreach ($parameters_array as $param_ligne) {
369 $tmp = explode(',', $param_ligne);
370 $key = $tmp[0];
371 if (!empty($tmp[1])) {
372 $value = $tmp[1];
373 }
374 if (!array_key_exists('options', $params)) {
375 $params['options'] = array();
376 }
377 $params['options'][$key] = $value;
378 }
379 }
380
381 // $params['options'][$key] can be 'Facture:/compta/facture/class/facture.class.php' => '/custom'
382
383 // Visibility: -1=not visible by default in list, 1=visible, 0=hidden
384 $visibility = GETPOST('list', 'alpha');
385 if (in_array($type, ['separate', 'point', 'linestrg', 'polygon'])) {
386 $visibility = 3;
387 }
388
389 // Example: is_object($object) ? ($object->id < 10 ? round($object->id / 2, 2) : (2 * $user->id) * (int) substr($mysoc->zip, 1, 2)) : 'objnotdefined'
390 $computedvalue = GETPOST('computed_value', 'nohtml');
391
392 $result = $extrafields->update(
393 GETPOST('attrname', 'aZ09'),
394 GETPOST('label', 'alpha'),
395 $type,
396 $extrasize,
397 $elementtype,
398 (GETPOST('unique', 'alpha') ? 1 : 0),
399 (GETPOST('required', 'alpha') ? 1 : 0),
400 $pos,
401 $params,
402 (GETPOST('alwayseditable', 'alpha') ? 1 : 0),
403 (GETPOST('perms', 'alpha') ? GETPOST('perms', 'alpha') : ''),
404 $visibility,
405 GETPOST('help', 'alpha'),
406 GETPOST('default_value', 'alpha'),
407 $computedvalue,
408 (GETPOST('entitycurrentorall', 'alpha') ? 0 : ''),
409 GETPOST('langfile'),
410 GETPOST('enabled', 'nohtml'),
411 (GETPOST('totalizable', 'alpha') ? 1 : 0),
412 GETPOST('printable', 'alpha'),
413 array('css' => $css, 'cssview' => $cssview, 'csslist' => $csslist)
414 );
415 if ($result > 0) {
416 setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
417 header("Location: ".$_SERVER["PHP_SELF"]);
418 exit;
419 } else {
420 $error++;
421 $mesg = $extrafields->error;
422 $mesgs = array_merge($mesgs, $extrafields->errors);
423 setEventMessages($mesg, $mesgs, 'errors');
424 }
425 } else {
426 $error++;
427 $langs->load("errors");
428 $mesg = $langs->trans("ErrorFieldCanNotContainSpecialCharacters", $langs->transnoentities("AttributeCode"));
429 setEventMessages($mesg, null, 'errors');
430 }
431 } else {
432 setEventMessages($mesg, $mesgs, 'errors');
433 }
434 }
435}
436
437// Delete attribute
438if ($action == 'confirm_delete' && $confirm == "yes") {
439 if (GETPOSTISSET("attrname") && preg_match("/^\w[a-zA-Z0-9-_]*$/", GETPOST("attrname", 'aZ09'))) {
440 $attributekey = GETPOST('attrname', 'aZ09');
441
442 $result = $extrafields->delete($attributekey, $elementtype);
443 if ($result >= 0) {
444 setEventMessages($langs->trans("ExtrafieldsDeleted", $attributekey), null, 'mesgs');
445
446 header("Location: ".$_SERVER["PHP_SELF"]);
447 exit;
448 } else {
449 $mesg = $extrafields->error;
450 $mesgs = array_merge($mesgs, $extrafields->errors);
451 }
452 } else {
453 $error++;
454 $langs->load("errors");
455 $mesg = $langs->trans("ErrorFieldCanNotContainSpecialCharacters", $langs->transnoentities("AttributeCode"));
456 }
457}
458
459// Recrypt data password
460if ($action == 'encrypt') {
461 // Load $extrafields->attributes
462 $extrafields->fetch_name_optionals_label($elementtype);
463 $attributekey = GETPOST('attrname', 'aZ09');
464
465 if (!empty($extrafields->attributes[$elementtype]['type'][$attributekey]) && $extrafields->attributes[$elementtype]['type'][$attributekey] == 'password') {
466 if (!empty($extrafields->attributes[$elementtype]['param'][$attributekey]['options'])) {
467 if (array_key_exists('dolcrypt', $extrafields->attributes[$elementtype]['param'][$attributekey]['options'])) {
468 // We can encrypt data with dolCrypt()
469 $arrayofelement = getElementProperties($elementtype);
470 if (!empty($arrayofelement['table_element'])) {
471 if ($extrafields->attributes[$elementtype]['entityid'][$attributekey] == $conf->entity || empty($extrafields->attributes[$elementtype]['entityid'][$attributekey])) {
472 dol_syslog("Loop on each extafields of table ".$arrayofelement['table_element']);
473
474 $sql = "SELECT te.rowid, te.".$attributekey;
475 $sql .= " FROM ".MAIN_DB_PREFIX.$arrayofelement['table_element']." as t, ".MAIN_DB_PREFIX.$arrayofelement['table_element'].'_extrafields as te';
476 $sql .= " WHERE te.fk_object = t.rowid";
477 $sql .= " AND te.".$attributekey." NOT LIKE 'dolcrypt:%'";
478 $sql .= " AND te.".$attributekey." IS NOT NULL";
479 $sql .= " AND te.".$attributekey." <> ''";
480 if ($extrafields->attributes[$elementtype]['entityid'][$attributekey] == $conf->entity) {
481 $sql .= " AND t.entity = ".getEntity($arrayofelement['table_element'], 0);
482 }
483
484 //print $sql;
485 $nbupdatedone = 0;
486 $resql = $db->query($sql);
487 if ($resql) {
488 $num_rows = $db->num_rows($resql);
489 $i = 0;
490 while ($i < $num_rows) {
491 $objtmp = $db->fetch_object($resql);
492 $id = $objtmp->rowid;
493 $pass = $objtmp->$attributekey;
494 if ($pass) {
495 $newpassword = dolEncrypt($pass);
496
497 $sqlupdate = "UPDATE ".MAIN_DB_PREFIX.$arrayofelement['table_element'].'_extrafields';
498 $sqlupdate .= " SET ".$attributekey." = '".$db->escape($newpassword)."'";
499 $sqlupdate .= " WHERE rowid = ".((int) $id);
500
501 $resupdate = $db->query($sqlupdate);
502 if ($resupdate) {
503 $nbupdatedone++;
504 } else {
505 setEventMessages($db->lasterror(), null, 'errors');
506 $error++;
507 break;
508 }
509 }
510
511 $i++;
512 }
513 }
514
515 if ($nbupdatedone > 0) {
516 setEventMessages($langs->trans("PasswordFieldEncrypted", $nbupdatedone), null, 'mesgs');
517 } else {
518 setEventMessages($langs->trans("PasswordFieldEncrypted", $nbupdatedone), null, 'warnings');
519 }
520 }
521 }
522 }
523 }
524 }
525}
$id
Definition account.php:39
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
getElementProperties($elementType)
Get an array with properties of an element.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dolEncrypt($chain, $key='', $ciphering='', $forceseed='')
Encode a string with a symmetric encryption.