dolibarr 22.0.5
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 * Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
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 * or see https://www.gnu.org/
19 *
20 * $elementype must be defined.
21 */
22
39$maxsizestring = 255;
40$maxsizeint = 10;
41$mesg = '';
42$mesgs = array();
43
44$extrasize = GETPOST('size', 'intcomma');
45$type = GETPOST('type', 'alphanohtml');
46$param = GETPOST('param', 'alphanohtml');
47$css = GETPOST('css', 'alphanohtml');
48$cssview = GETPOST('cssview', 'alphanohtml');
49$csslist = GETPOST('csslist', 'alphanohtml');
50$confirm = GETPOST('confirm', 'alpha');
51
52if ($type == 'double' && strpos($extrasize, ',') === false) {
53 $extrasize = '24,8';
54}
55if ($type == 'date') {
56 $extrasize = '';
57}
58if ($type == 'datetime') {
59 $extrasize = '';
60}
61if ($type == 'select') {
62 $extrasize = '';
63}
64
65// List of reserved words for databases
66$listofreservedwords = array(
67 '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',
68 'CURSOR', 'DATABASE', 'DATABASES', 'DAY_HOUR', 'DAY_MICROSECOND', 'DAY_MINUTE', 'DAY_SECOND', 'DECIMAL', 'DECLARE', 'DEFAULT', 'DELAYED', 'DELETE', 'DESC', 'DESCRIBE', 'DETERMINISTIC', 'DISTINCT', 'DISTINCTROW', 'DOUBLE', 'DROP', 'DUAL',
69 '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',
70 'IGNORE', 'IGNORE_SERVER_IDS', 'INDEX', 'INFILE', 'INNER', 'INOUT', 'INSENSITIVE', 'INSERT', 'INT', 'INTEGER', 'INTERVAL', 'INTO', 'ITERATE',
71 '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',
72 'OFFSET', 'ON', 'OPTION', 'OPTIONALLY', 'OUTER', 'OUTFILE', 'OVER',
73 'PARTITION', 'POSITION', 'PRECISION', 'PRIMARY', 'PROCEDURE', 'PURGE', 'RANGE', 'READS', 'READ_WRITE', 'REAL', 'REFERENCES', 'REGEXP', 'RELEASE', 'RENAME', 'REPEAT', 'REQUIRE', 'RESTRICT', 'RETURN', 'REVOKE', 'RIGHT', 'RLIKE',
74 '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',
75 'TABLE', 'TERMINATED', 'TINYBLOB', 'TINYINT', 'TINYTEXT', 'TRAILING', 'TRIGGER', 'UNDO', 'UNIQUE', 'UNSIGNED', 'UPDATE', 'USAGE', 'USING', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP', 'VALUES', 'VARBINARY', 'VARCHAR', 'VARYING',
76 'WHEN', 'WHERE', 'WHILE', 'WRITE', 'XOR', 'YEAR_MONTH', 'ZEROFILL'
77);
78
79// Add attribute
80if ($action == 'add') {
81 if (GETPOST("button") != $langs->trans("Cancel")) {
82 // Check values
83 if (!$type) {
84 $error++;
85 $langs->load("errors");
86 $mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"));
87 $action = 'create';
88 }
89 if ($type == 'varchar' && $extrasize <= 0) {
90 $error++;
91 $langs->load("errors");
92 $mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Size"));
93 $action = 'edit';
94 }
95 if ($type == 'varchar' && $extrasize > $maxsizestring) {
96 $error++;
97 $langs->load("errors");
98 $mesgs[] = $langs->trans("ErrorSizeTooLongForVarcharType", $maxsizestring);
99 $action = 'create';
100 }
101 if ($type == 'int' && $extrasize > $maxsizeint) {
102 $error++;
103 $langs->load("errors");
104 $mesgs[] = $langs->trans("ErrorSizeTooLongForIntType", $maxsizeint);
105 $action = 'create';
106 }
107 if ($type == 'stars' && ($extrasize < 1 || $extrasize > 10)) {
108 $error++;
109 $langs->load("errors");
110 $mesgs[] = $langs->trans("ErrorSizeForStarsType");
111 $action = 'create';
112 }
113 if ($type == 'select' && !$param) {
114 $error++;
115 $langs->load("errors");
116 $mesgs[] = $langs->trans("ErrorNoValueForSelectType");
117 $action = 'create';
118 }
119 if ($type == 'sellist' && !$param) {
120 $error++;
121 $langs->load("errors");
122 $mesgs[] = $langs->trans("ErrorNoValueForSelectListType");
123 $action = 'create';
124 }
125 if ($type == 'checkbox' && !$param) {
126 $error++;
127 $langs->load("errors");
128 $mesgs[] = $langs->trans("ErrorNoValueForCheckBoxType");
129 $action = 'create';
130 }
131 if ($type == 'link' && !$param) {
132 $error++;
133 $langs->load("errors");
134 $mesgs[] = $langs->trans("ErrorNoValueForLinkType");
135 $action = 'create';
136 }
137 if ($type == 'radio' && !$param) {
138 $error++;
139 $langs->load("errors");
140 $mesgs[] = $langs->trans("ErrorNoValueForRadioType");
141 $action = 'create';
142 }
143 if ((($type == 'radio') || ($type == 'checkbox')) && $param) {
144 // Construct array for parameter (value of select list)
145 $parameters = $param;
146 $parameters_array = explode("\r\n", $parameters);
147 foreach ($parameters_array as $param_ligne) {
148 if (!empty($param_ligne)) {
149 if (preg_match_all('/,/', $param_ligne, $matches)) {
150 if (count($matches[0]) > 1) {
151 $error++;
152 $langs->load("errors");
153 $mesgs[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
154 $action = 'create';
155 }
156 } else {
157 $error++;
158 $langs->load("errors");
159 $mesgs[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
160 $action = 'create';
161 }
162 }
163 }
164 }
165
166 if (!$error) {
167 if (strlen(GETPOST('attrname', 'aZ09')) < 3) {
168 $error++;
169 $langs->load("errors");
170 $mesgs[] = $langs->trans("ErrorValueLength", $langs->transnoentitiesnoconv("AttributeCode"), 3);
171 $action = 'create';
172 }
173 }
174
175 // Check reserved keyword with more than 3 characters
176 if (!$error) {
177 if (in_array(strtoupper(GETPOST('attrname', 'aZ09')), $listofreservedwords)) {
178 $error++;
179 $langs->load("errors");
180 $mesgs[] = $langs->trans("ErrorReservedKeyword", GETPOST('attrname', 'aZ09'));
181 $action = 'create';
182 }
183 }
184
185 if (!$error) {
186 // attrname must be alphabetical and lower case only
187 if (GETPOSTISSET("attrname") && preg_match("/^[a-z0-9_]+$/", GETPOST('attrname', 'aZ09')) && !is_numeric(GETPOST('attrname', 'aZ09'))) {
188 // Construct array for parameter (value of select list)
189 $default_value = GETPOST('default_value', 'alpha');
190 $parameters = $param;
191 $parameters_array = explode("\r\n", $parameters);
192 $params = array();
193 //In sellist we have only one line and it can have come to do SQL expression
194 if ($type == 'sellist' || $type == 'chkbxlst') {
195 foreach ($parameters_array as $param_ligne) {
196 $params['options'] = array($parameters => null);
197 }
198 } else {
199 // Else it's separated key/value and coma list
200 foreach ($parameters_array as $param_ligne) {
201 if (strpos($param_ligne, ',') !== false) {
202 list($key, $value) = explode(',', $param_ligne);
203 if (!array_key_exists('options', $params)) {
204 $params['options'] = array();
205 }
206 } else {
207 $key = $param_ligne;
208 $value = null;
209 }
210 $params['options'][$key] = $value;
211 }
212 }
213
214 // Visibility: -1=not visible by default in list, 1=visible, 0=hidden
215 $visibility = GETPOST('list', 'alpha');
216 if (in_array($type, ['separate', 'point', 'linestrg', 'polygon'])) {
217 $visibility = 3;
218 }
219
220 $result = $extrafields->addExtraField(
221 GETPOST('attrname', 'aZ09'),
222 GETPOST('label', 'alpha'),
223 $type,
224 GETPOSTINT('pos'),
225 $extrasize,
226 $elementtype,
227 (GETPOST('unique', 'alpha') ? 1 : 0),
228 (GETPOST('required', 'alpha') ? 1 : 0),
229 $default_value,
230 $params,
231 (GETPOST('alwayseditable', 'alpha') ? 1 : 0),
232 (GETPOST('perms', 'alpha') ? GETPOST('perms', 'alpha') : ''),
233 $visibility,
234 GETPOST('help', 'alpha'),
235 GETPOST('computed_value', 'alpha'),
236 (GETPOST('entitycurrentorall', 'alpha') ? 0 : ''),
237 GETPOST('langfile', 'alpha'),
238 '1',
239 (GETPOST('totalizable', 'alpha') ? 1 : 0),
240 GETPOSTINT('printable'),
241 array('css' => $css, 'cssview' => $cssview, 'csslist' => $csslist),
242 GETPOST("ai_prompt")
243 );
244 if ($result > 0) {
245 setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
246 header("Location: ".$_SERVER["PHP_SELF"]);
247 exit;
248 } else {
249 $error++;
250 $mesg = $extrafields->error;
251 $mesgs = array_merge($mesgs, $extrafields->errors);
252 setEventMessages($mesg, $mesgs, 'errors');
253 }
254 } else {
255 $error++;
256 $langs->load("errors");
257 $mesg = $langs->trans("ErrorFieldCanNotContainSpecialNorUpperCharacters", $langs->transnoentities("AttributeCode"));
258 setEventMessages($mesg, $mesgs, 'errors');
259 $action = 'create';
260 }
261 } else {
262 setEventMessages($mesg, $mesgs, 'errors');
263 }
264 }
265}
266
267// Rename field
268if ($action == 'update') {
269 if (GETPOST("button") != $langs->trans("Cancel")) {
270 // Check values
271 if (!$type) {
272 $error++;
273 $langs->load("errors");
274 $mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"));
275 $action = 'edit';
276 }
277 if ($type == 'varchar' && $extrasize <= 0) {
278 $error++;
279 $langs->load("errors");
280 $mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Size"));
281 $action = 'edit';
282 }
283 if ($type == 'varchar' && $extrasize > $maxsizestring) {
284 $error++;
285 $langs->load("errors");
286 $mesgs[] = $langs->trans("ErrorSizeTooLongForVarcharType", $maxsizestring);
287 $action = 'edit';
288 }
289 if ($type == 'int' && $extrasize > $maxsizeint) {
290 $error++;
291 $langs->load("errors");
292 $mesgs[] = $langs->trans("ErrorSizeTooLongForIntType", $maxsizeint);
293 $action = 'edit';
294 }
295 if ($type == 'select' && !$param) {
296 $error++;
297 $langs->load("errors");
298 $mesgs[] = $langs->trans("ErrorNoValueForSelectType");
299 $action = 'edit';
300 }
301 if ($type == 'sellist' && !$param) {
302 $error++;
303 $langs->load("errors");
304 $mesgs[] = $langs->trans("ErrorNoValueForSelectListType");
305 $action = 'edit';
306 }
307 if ($type == 'stars' && ($extrasize < 1 || $extrasize > 10)) {
308 $error++;
309 $langs->load("errors");
310 $mesgs[] = $langs->trans("ErrorSizeForStarsType");
311 $action = 'edit';
312 }
313 if ($type == 'checkbox' && !$param) {
314 $error++;
315 $langs->load("errors");
316 $mesgs[] = $langs->trans("ErrorNoValueForCheckBoxType");
317 $action = 'edit';
318 }
319 if ($type == 'radio' && !$param) {
320 $error++;
321 $langs->load("errors");
322 $mesgs[] = $langs->trans("ErrorNoValueForRadioType");
323 $action = 'edit';
324 }
325 if ((($type == 'radio') || ($type == 'checkbox')) && $param) {
326 // Construct array for parameter (value of select list)
327 $parameters = $param;
328 $parameters_array = explode("\r\n", $parameters);
329 foreach ($parameters_array as $param_ligne) {
330 if (!empty($param_ligne)) {
331 if (preg_match_all('/,/', $param_ligne, $matches)) {
332 if (count($matches[0]) > 1) {
333 $error++;
334 $langs->load("errors");
335 $mesgs[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
336 $action = 'edit';
337 }
338 } else {
339 $error++;
340 $langs->load("errors");
341 $mesgs[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
342 $action = 'edit';
343 }
344 }
345 }
346 }
347
348 if (!$error) {
349 if (strlen(GETPOST('attrname', 'aZ09')) < 3 && !getDolGlobalString('MAIN_DISABLE_EXTRAFIELDS_CHECK_FOR_UPDATE')) {
350 $error++;
351 $langs->load("errors");
352 $mesgs[] = $langs->trans("ErrorValueLength", $langs->transnoentitiesnoconv("AttributeCode"), 3);
353 $action = 'edit';
354 }
355 }
356
357 // Check reserved keyword with more than 3 characters
358 if (!$error) {
359 if (in_array(strtoupper(GETPOST('attrname', 'aZ09')), $listofreservedwords) && !getDolGlobalString('MAIN_DISABLE_EXTRAFIELDS_CHECK_FOR_UPDATE')) {
360 $error++;
361 $langs->load("errors");
362 $mesgs[] = $langs->trans("ErrorReservedKeyword", GETPOST('attrname', 'aZ09'));
363 $action = 'edit';
364 }
365 }
366
367 if (!$error) {
368 if (GETPOSTISSET("attrname") && preg_match("/^\w[a-zA-Z0-9-_]*$/", GETPOST('attrname', 'aZ09')) && !is_numeric(GETPOST('attrname', 'aZ09'))) {
369 $pos = GETPOSTINT('pos');
370 // Construct array for parameter (value of select list)
371 $parameters = $param;
372 $parameters_array = explode("\r\n", $parameters);
373 $params = array();
374 //In sellist we have only one line and it can have come to do SQL expression
375 if ($type == 'sellist' || $type == 'chkbxlst') {
376 foreach ($parameters_array as $param_ligne) {
377 $params['options'] = array($parameters => null);
378 }
379 } else {
380 //Else it's separated key/value and coma list
381 foreach ($parameters_array as $param_ligne) {
382 $tmp = explode(',', $param_ligne);
383 $key = $tmp[0];
384 if (!empty($tmp[1])) {
385 $value = $tmp[1];
386 }
387 if (!array_key_exists('options', $params)) {
388 $params['options'] = array();
389 }
390 $params['options'][$key] = $value;
391 }
392 }
393
394 // $params['options'][$key] can be 'Facture:/compta/facture/class/facture.class.php' => '/custom'
395
396 // Visibility: -1=not visible by default in list, 1=visible, 0=hidden
397 $visibility = GETPOST('list', 'alpha');
398 if (in_array($type, ['separate', 'point', 'linestrg', 'polygon'])) {
399 $visibility = 3;
400 }
401
402 // Example: is_object($object) ? ($object->id < 10 ? round($object->id / 2, 2) : (2 * $user->id) * (int) substr($mysoc->zip, 1, 2)) : 'objnotdefined'
403 $computedvalue = GETPOST('computed_value', 'nohtml');
404
405 $result = $extrafields->update(
406 GETPOST('attrname', 'aZ09'),
407 GETPOST('label', 'alpha'),
408 $type,
409 $extrasize,
410 $elementtype,
411 (GETPOST('unique', 'alpha') ? 1 : 0),
412 (GETPOST('required', 'alpha') ? 1 : 0),
413 $pos,
414 $params,
415 (GETPOST('alwayseditable', 'alpha') ? 1 : 0),
416 (GETPOST('perms', 'alpha') ? GETPOST('perms', 'alpha') : ''),
417 $visibility,
418 GETPOST('help', 'alpha'),
419 GETPOST('default_value', 'alpha'),
420 $computedvalue,
421 (GETPOST('entitycurrentorall', 'alpha') ? 0 : ''),
422 GETPOST('langfile'),
423 GETPOST('enabled', 'nohtml'),
424 (GETPOST('totalizable', 'alpha') ? 1 : 0),
425 GETPOSTINT('printable'),
426 array('css' => $css, 'cssview' => $cssview, 'csslist' => $csslist),
427 GETPOST("ai_prompt")
428 );
429 if ($result > 0) {
430 setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
431 header("Location: ".$_SERVER["PHP_SELF"]);
432 exit;
433 } else {
434 $error++;
435 $mesg = $extrafields->error;
436 $mesgs = array_merge($mesgs, $extrafields->errors);
437 setEventMessages($mesg, $mesgs, 'errors');
438 }
439 } else {
440 $error++;
441 $langs->load("errors");
442 $mesg = $langs->trans("ErrorFieldCanNotContainSpecialCharacters", $langs->transnoentities("AttributeCode"));
443 setEventMessages($mesg, null, 'errors');
444 }
445 } else {
446 setEventMessages($mesg, $mesgs, 'errors');
447 }
448 }
449}
450
451// Delete attribute
452if ($action == 'confirm_delete' && $confirm == "yes") {
453 if (GETPOSTISSET("attrname") && preg_match("/^\w[a-zA-Z0-9-_]*$/", GETPOST("attrname", 'aZ09'))) {
454 $attributekey = GETPOST('attrname', 'aZ09');
455
456 $result = $extrafields->delete($attributekey, $elementtype);
457 if ($result >= 0) {
458 setEventMessages($langs->trans("ExtrafieldsDeleted", $attributekey), null, 'mesgs');
459
460 header("Location: ".$_SERVER["PHP_SELF"]);
461 exit;
462 } else {
463 $mesg = $extrafields->error;
464 $mesgs = array_merge($mesgs, $extrafields->errors);
465 }
466 } else {
467 $error++;
468 $langs->load("errors");
469 $mesg = $langs->trans("ErrorFieldCanNotContainSpecialCharacters", $langs->transnoentities("AttributeCode"));
470 }
471}
472
473// Recrypt data password
474if ($action == 'encrypt') {
475 // Load $extrafields->attributes
476 $extrafields->fetch_name_optionals_label($elementtype);
477 $attributekey = GETPOST('attrname', 'aZ09');
478
479 if (!empty($extrafields->attributes[$elementtype]['type'][$attributekey]) && $extrafields->attributes[$elementtype]['type'][$attributekey] == 'password') {
480 if (!empty($extrafields->attributes[$elementtype]['param'][$attributekey]['options'])) {
481 if (array_key_exists('dolcrypt', $extrafields->attributes[$elementtype]['param'][$attributekey]['options'])) {
482 // We can encrypt data with dolCrypt()
483 $arrayofelement = getElementProperties($elementtype);
484 if (!empty($arrayofelement['table_element'])) {
485 if ($extrafields->attributes[$elementtype]['entityid'][$attributekey] == $conf->entity || empty($extrafields->attributes[$elementtype]['entityid'][$attributekey])) {
486 dol_syslog("Loop on each extafields of table ".$arrayofelement['table_element']);
487
488 $sql = "SELECT te.rowid, te.".$attributekey;
489 $sql .= " FROM ".MAIN_DB_PREFIX.$arrayofelement['table_element']." as t, ".MAIN_DB_PREFIX.$arrayofelement['table_element'].'_extrafields as te';
490 $sql .= " WHERE te.fk_object = t.rowid";
491 $sql .= " AND te.".$attributekey." NOT LIKE 'dolcrypt:%'";
492 $sql .= " AND te.".$attributekey." IS NOT NULL";
493 $sql .= " AND te.".$attributekey." <> ''";
494 if ($extrafields->attributes[$elementtype]['entityid'][$attributekey] == $conf->entity) {
495 $sql .= " AND t.entity = ".getEntity($arrayofelement['element'], 0);
496 }
497
498 //print $sql;
499 $nbupdatedone = 0;
500 $resql = $db->query($sql);
501 if ($resql) {
502 $num_rows = $db->num_rows($resql);
503 $i = 0;
504 while ($i < $num_rows) {
505 $objtmp = $db->fetch_object($resql);
506 $id = $objtmp->rowid;
507 $pass = $objtmp->$attributekey;
508 if ($pass) {
509 $newpassword = dolEncrypt($pass);
510
511 $sqlupdate = "UPDATE ".MAIN_DB_PREFIX.$arrayofelement['table_element'].'_extrafields';
512 $sqlupdate .= " SET ".$attributekey." = '".$db->escape($newpassword)."'";
513 $sqlupdate .= " WHERE rowid = ".((int) $id);
514
515 $resupdate = $db->query($sqlupdate);
516 if ($resupdate) {
517 $nbupdatedone++;
518 } else {
519 setEventMessages($db->lasterror(), null, 'errors');
520 $error++;
521 break;
522 }
523 }
524
525 $i++;
526 }
527 }
528
529 if ($nbupdatedone > 0) {
530 setEventMessages($langs->trans("PasswordFieldEncrypted", $nbupdatedone), null, 'mesgs');
531 } else {
532 setEventMessages($langs->trans("PasswordFieldEncrypted", $nbupdatedone), null, 'warnings');
533 }
534 }
535 }
536 }
537 }
538 }
539}
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:48
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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
dolEncrypt($chain, $key='', $ciphering='', $forceseed='')
Encode a string with a symmetric encryption.