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