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