dolibarr  16.0.5
notification.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.org>
4  * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
5  * Copyright (C) 2015 Bahfir Abbes <contact@dolibarrpar.org>
6  * Copyright (C) 2020 Thibault FOUCART <suport@ptibogxiv.net>
7  * Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  */
22 
29 require '../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php';
33 
34 // Load translation files required by the page
35 $langs->loadLangs(array('admin', 'other', 'orders', 'propal', 'bills', 'errors', 'mails'));
36 
37 // Security check
38 if (!$user->admin) {
40 }
41 
42 $action = GETPOST('action', 'aZ09');
43 $error = 0;
44 
45 
46 /*
47  * Actions
48  */
49 
50 // Action to update or add a constant
51 if ($action == 'settemplates' && $user->admin) {
52  $db->begin();
53 
54  if (!$error && is_array($_POST)) {
55  $reg = array();
56  foreach ($_POST as $key => $val) {
57  if (!preg_match('/^constvalue_(.*)_TEMPLATE/', $key, $reg)) {
58  continue;
59  }
60 
61  $triggername = $reg[1];
62  $constvalue = GETPOST($key, 'alpha');
63  $consttype = 'emailtemplate:xxx';
64  $tmparray = explode(':', $constvalue);
65  if (!empty($tmparray[0]) && !empty($tmparray[1])) {
66  $constvalue = $tmparray[0];
67  $consttype = 'emailtemplate:'.$tmparray[1];
68  //var_dump($constvalue);
69  //var_dump($consttype);
70  $res = dolibarr_set_const($db, $triggername.'_TEMPLATE', $constvalue, $consttype, 0, '', $conf->entity);
71  if ($res < 0) {
72  $error++;
73  break;
74  }
75  } else {
76  $res = dolibarr_del_const($db, $triggername.'_TEMPLATE', $conf->entity);
77  }
78  }
79  }
80 
81 
82  if (!$error) {
83  $db->commit();
84 
85  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
86  } else {
87  $db->rollback();
88 
89  setEventMessages($langs->trans("Error"), null, 'errors');
90  }
91 }
92 
93 if ($action == 'setvalue' && $user->admin) {
94  $db->begin();
95 
96  $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", GETPOST("email_from", "alphawithlgt"), 'chaine', 0, '', $conf->entity);
97  if ($result < 0) {
98  $error++;
99  }
100 
101  $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE", GETPOST("notif_disable", "alphawithlgt"), 'chaine', 0, '', $conf->entity);
102  if ($result < 0) {
103  $error++;
104  }
105 
106  if (!$error) {
107  $db->commit();
108 
109  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
110  } else {
111  $db->rollback();
112 
113  setEventMessages($langs->trans("Error"), null, 'errors');
114  }
115 }
116 
117 
118 if ($action == 'setfixednotif' && $user->admin) {
119  $db->begin();
120 
121  if (!$error && is_array($_POST)) {
122  $reg = array();
123  foreach ($_POST as $key => $val) {
124  if (!preg_match('/^NOTIF_(.*)_key$/', $key, $reg)) {
125  continue;
126  }
127 
128  $newval = '';
129  $newkey = '';
130 
131  $shortkey = preg_replace('/_key$/', '', $key);
132  //print $shortkey.'<br>';
133 
134  if (preg_match('/^NOTIF_(.*)_old_(.*)_key/', $key, $reg)) {
135  dolibarr_del_const($db, 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.$reg[2], $conf->entity);
136 
137  $newkey = 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
138  $newval = GETPOST($shortkey.'_key');
139  //print $newkey.' - '.$newval.'<br>';
140  } elseif (preg_match('/^NOTIF_(.*)_new_key/', $key, $reg)) {
141  // Add a new entry
142  $newkey = 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
143  $newval = GETPOST($shortkey.'_key');
144  }
145 
146  if ($newkey && $newval) {
147  $result = dolibarr_set_const($db, $newkey, $newval, 'chaine', 0, '', $conf->entity);
148  }
149  }
150  }
151 
152  if (!$error) {
153  $db->commit();
154 
155  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
156  } else {
157  $db->rollback();
158 
159  setEventMessages($langs->trans("Error"), null, 'errors');
160  }
161 }
162 
163 
164 
165 /*
166  * View
167  */
168 
169 $form = new Form($db);
170 $notify = new Notify($db);
171 
172 llxHeader('', $langs->trans("NotificationSetup"));
173 
174 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
175 print load_fiche_titre($langs->trans("NotificationSetup"), $linkback, 'title_setup');
176 
177 print '<span class="opacitymedium">';
178 print $langs->trans("NotificationsDesc").'<br>';
179 print $langs->trans("NotificationsDescUser").'<br>';
180 if (!empty($conf->societe->enabled)) {
181  print $langs->trans("NotificationsDescContact").'<br>';
182 }
183 print $langs->trans("NotificationsDescGlobal").'<br>';
184 print '</span>';
185 print '<br>';
186 
187 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
188 print '<input type="hidden" name="token" value="'.newToken().'">';
189 print '<input type="hidden" name="action" value="setvalue">';
190 
191 print '<div class="div-table-responsive">';
192 print '<table class="noborder centpercent">';
193 print '<tr class="liste_titre">';
194 print '<td>'.$langs->trans("Parameter").'</td>';
195 print '<td>'.$langs->trans("Value").'</td>';
196 print "</tr>\n";
197 
198 print '<tr class="oddeven"><td>';
199 print $langs->trans("NotificationEMailFrom").'</td>';
200 print '<td>';
201 print img_picto('', 'email', 'class="pictofixedwidth"');
202 print '<input class="width150 quatrevingtpercentminusx" type="email" name="email_from" value="'.getDolGlobalString('NOTIFICATION_EMAIL_FROM').'">';
203 if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->global->NOTIFICATION_EMAIL_FROM)) {
204  print ' '.img_warning($langs->trans("ErrorBadEMail"));
205 }
206 print '</td>';
207 print '</tr>';
208 
209 print '<tr class="oddeven"><td>';
210 print $langs->trans("NotificationDisableConfirmMessageContact").'</td>';
211 print '<td>';
212 if ($conf->use_javascript_ajax) {
213  print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT');
214 } else {
215  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
216  print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT", $arrval, getDolGlobalString('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT'));
217 }
218 print '</td>';
219 print '</tr>';
220 
221 print '<tr class="oddeven"><td>';
222 print $langs->trans("NotificationDisableConfirmMessageUser").'</td>';
223 print '<td>';
224 if ($conf->use_javascript_ajax) {
225  print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER');
226 } else {
227  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
228  print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER", $arrval, getDolGlobalString('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER'));
229 }
230 print '</td>';
231 print '</tr>';
232 
233 print '<tr class="oddeven"><td>';
234 print $langs->trans("NotificationDisableConfirmMessageFix").'</td>';
235 print '<td>';
236 if ($conf->use_javascript_ajax) {
237  print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX');
238 } else {
239  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
240  print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX", $arrval, getDolGlobalString('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX'));
241 }
242 print '</td>';
243 print '</tr>';
244 print '</table>';
245 print '</div>';
246 
247 print $form->buttonsSaveCancel("Save", '');
248 
249 print '</form>';
250 
251 
252 print '<br><br>';
253 
254 
255 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
256 print '<input type="hidden" name="token" value="'.newToken().'">';
257 print '<input type="hidden" name="action" value="settemplates">';
258 
259 // Notification per contacts
260 $title = $langs->trans("TemplatesForNotifications");
261 
262 print load_fiche_titre($title, '', 'email');
263 
264 // Load array of available notifications
265 $notificationtrigger = new InterfaceNotification($db);
266 $listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
267 
268 // Editing global variables not related to a specific theme
269 $constantes = array();
270 foreach ($listofnotifiedevents as $notifiedevent) {
271  $label = $langs->trans("Notify_".$notifiedevent['code']);
272  $elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
273 
274  $model = $notifiedevent['elementtype'];
275 
276  if ($notifiedevent['elementtype'] == 'order_supplier') {
277  $elementLabel = $langs->trans('SupplierOrder');
278  } elseif ($notifiedevent['elementtype'] == 'propal') {
279  $elementLabel = $langs->trans('Proposal');
280  } elseif ($notifiedevent['elementtype'] == 'facture') {
281  $elementLabel = $langs->trans('Bill');
282  } elseif ($notifiedevent['elementtype'] == 'commande') {
283  $elementLabel = $langs->trans('Order');
284  } elseif ($notifiedevent['elementtype'] == 'ficheinter') {
285  $elementLabel = $langs->trans('Intervention');
286  } elseif ($notifiedevent['elementtype'] == 'shipping') {
287  $elementLabel = $langs->trans('Shipping');
288  } elseif ($notifiedevent['elementtype'] == 'expensereport' || $notifiedevent['elementtype'] == 'expense_report') {
289  $elementLabel = $langs->trans('ExpenseReport');
290  }
291 
292  if ($notifiedevent['elementtype'] == 'propal') {
293  $model = 'propal_send';
294  } elseif ($notifiedevent['elementtype'] == 'commande') {
295  $model = 'order_send';
296  } elseif ($notifiedevent['elementtype'] == 'facture') {
297  $model = 'facture_send';
298  } elseif ($notifiedevent['elementtype'] == 'shipping') {
299  $model = 'shipping_send';
300  } elseif ($notifiedevent['elementtype'] == 'ficheinter') {
301  $model = 'fichinter_send';
302  } elseif ($notifiedevent['elementtype'] == 'expensereport') {
303  $model = 'expensereport_send';
304  } elseif ($notifiedevent['elementtype'] == 'order_supplier') {
305  $model = 'order_supplier_send';
306  // } elseif ($notifiedevent['elementtype'] == 'invoice_supplier') $model = 'invoice_supplier_send';
307  } elseif ($notifiedevent['elementtype'] == 'member') {
308  $model = 'member';
309  }
310 
311  $constantes[$notifiedevent['code'].'_TEMPLATE'] = array('type'=>'emailtemplate:'.$model, 'label'=>$label);
312 }
313 
314 $helptext = '';
315 form_constantes($constantes, 3, $helptext, 'EmailTemplate');
316 
317 print $form->buttonsSaveCancel("Save", '');
318 
319 /*
320 } else {
321  print '<table class="noborder centpercent">';
322  print '<tr class="liste_titre">';
323  print '<td>'.$langs->trans("Label").'</td>';
324  //print '<td class="right">'.$langs->trans("NbOfTargetedContacts").'</td>';
325  print "</tr>\n";
326 
327  print '<tr class="oddeven">';
328  print '<td>';
329 
330  $i = 0;
331  foreach ($listofnotifiedevents as $notifiedevent) {
332  $label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
333  $elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
334 
335  if ($notifiedevent['elementtype'] == 'order_supplier') {
336  $elementLabel = $langs->trans('SupplierOrder');
337  } elseif ($notifiedevent['elementtype'] == 'propal') {
338  $elementLabel = $langs->trans('Proposal');
339  } elseif ($notifiedevent['elementtype'] == 'facture') {
340  $elementLabel = $langs->trans('Bill');
341  } elseif ($notifiedevent['elementtype'] == 'commande') {
342  $elementLabel = $langs->trans('Order');
343  } elseif ($notifiedevent['elementtype'] == 'ficheinter') {
344  $elementLabel = $langs->trans('Intervention');
345  } elseif ($notifiedevent['elementtype'] == 'shipping') {
346  $elementLabel = $langs->trans('Shipping');
347  } elseif ($notifiedevent['elementtype'] == 'expensereport' || $notifiedevent['elementtype'] == 'expense_report') {
348  $elementLabel = $langs->trans('ExpenseReport');
349  }
350 
351  if ($i) {
352  print ', ';
353  }
354  print $label;
355 
356  $i++;
357  }
358 
359  print '</td></tr>';
360  print '</table>';
361 
362  print '<div class="opacitymedium">';
363  print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
364  if (!empty($conf->societe->enabled)) {
365  print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
366  }
367  print '</div>';
368 }
369 */
370 
371 print '</form>';
372 
373 
374 print '<br><br>';
375 
376 
377 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
378 print '<input type="hidden" name="token" value="'.newToken().'">';
379 print '<input type="hidden" name="action" value="setfixednotif">';
380 print '<input type="hidden" name="page_y" value="">';
381 
382 print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', 'email');
383 
384 print '<div class="info">';
385 print $langs->trans("Note").':<br>';
386 print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
387 if (!empty($conf->societe->enabled)) {
388  print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
389 }
390 print '</div>';
391 
392 print '<div class="div-table-responsive">';
393 print '<table class="noborder centpercent">';
394 print '<tr class="liste_titre">';
395 print '<td>'.$langs->trans("Module").'</td>';
396 print '<td>'.$langs->trans("Code").'</td>';
397 print '<td>'.$langs->trans("Label").'</td>';
398 print '<td>'.$langs->trans("FixedEmailTarget").'</td>';
399 print '<td>'.$langs->trans("Threshold").'</td>';
400 print '<td></td>';
401 print "</tr>\n";
402 
403 foreach ($listofnotifiedevents as $notifiedevent) {
404  $label = $langs->trans("Notify_".$notifiedevent['code']);
405 
406  $elementPicto = $notifiedevent['elementtype'];
407  $elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
408  // Special cases
409  if ($notifiedevent['elementtype'] == 'order_supplier') {
410  $elementPicto = 'supplier_order';
411  $elementLabel = $langs->trans('SupplierOrder');
412  } elseif ($notifiedevent['elementtype'] == 'propal') {
413  $elementLabel = $langs->trans('Proposal');
414  } elseif ($notifiedevent['elementtype'] == 'facture') {
415  $elementPicto = 'bill';
416  $elementLabel = $langs->trans('Bill');
417  } elseif ($notifiedevent['elementtype'] == 'commande') {
418  $elementPicto = 'order';
419  $elementLabel = $langs->trans('Order');
420  } elseif ($notifiedevent['elementtype'] == 'ficheinter') {
421  $elementPicto = 'intervention';
422  $elementLabel = $langs->trans('Intervention');
423  } elseif ($notifiedevent['elementtype'] == 'shipping') {
424  $elementPicto = 'shipment';
425  $elementLabel = $langs->trans('Shipping');
426  } elseif ($notifiedevent['elementtype'] == 'expensereport' || $notifiedevent['elementtype'] == 'expense_report') {
427  $elementPicto = 'expensereport';
428  $elementLabel = $langs->trans('ExpenseReport');
429  }
430 
431  $labelfortrigger = 'AmountHT';
432  $codehasnotrigger = 0;
433  if (preg_match('/^HOLIDAY/', $notifiedevent['code'])) {
434  $codehasnotrigger++;
435  }
436 
437  print '<tr class="oddeven">';
438  print '<td>';
439  print img_picto('', $elementPicto, 'class="pictofixedwidth"');
440  print $elementLabel;
441  print '</td>';
442  print '<td>'.$notifiedevent['code'].'</td>';
443  print '<td><span class="opacitymedium">'.$label.'</span></td>';
444  print '<td>';
445  $inputfieldalreadyshown = 0;
446  // Notification with threshold
447  foreach ($conf->global as $key => $val) {
448  if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) {
449  continue;
450  }
451 
452  $param = 'NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_'.$reg[1];
453  $value = GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key') ?GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key', 'alpha') : $conf->global->$param;
454 
455  $s = '<input type="text" class="minwidth200" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
456  $arrayemail = explode(',', $value);
457  $showwarning = 0;
458  foreach ($arrayemail as $keydet => $valuedet) {
459  $valuedet = trim($valuedet);
460  if (!empty($valuedet) && !isValidEmail($valuedet, 1)) {
461  $showwarning++;
462  }
463  }
464  if ((!empty($conf->global->$param)) && $showwarning) {
465  $s .= ' '.img_warning($langs->trans("ErrorBadEMail"));
466  }
467  print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
468  print '<br>';
469 
470  $inputfieldalreadyshown++;
471  }
472  // New entry input fields
473  if (empty($inputfieldalreadyshown) || !$codehasnotrigger) {
474  $s = '<input type="text" class="minwidth200" name="NOTIF_'.$notifiedevent['code'].'_new_key" value="">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
475  print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
476  }
477  print '</td>';
478 
479  print '<td>';
480  // Notification with threshold
481  $inputfieldalreadyshown = 0;
482  foreach ($conf->global as $key => $val) {
483  if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) {
484  continue;
485  }
486 
487  if (!$codehasnotrigger) {
488  print $langs->trans($labelfortrigger).' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_amount" value="'.dol_escape_htmltag($reg[1]).'">';
489  print '<br>';
490 
491  $inputfieldalreadyshown++;
492  }
493  }
494  // New entry input fields
495  if (!$codehasnotrigger) {
496  print $langs->trans($labelfortrigger).' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_new_amount" value="">';
497  }
498  print '</td>';
499 
500  print '<td>';
501  // TODO Add link to show message content
502 
503  print '</td>';
504  print '</tr>';
505 }
506 print '</table>';
507 print '</div>';
508 
509 print $form->buttonsSaveCancel("Save", '');
510 
511 print '</form>';
512 
513 // End of page
514 llxFooter();
515 $db->close();
dol_escape_htmltag
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
Definition: functions.lib.php:1468
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
dolibarr_del_const
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:552
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
Notify
Class to manage notifications.
Definition: notify.class.php:33
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
InterfaceNotification
Class of triggers for notification module.
Definition: interface_50_modNotification_Notification.class.php:33
isValidEmail
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
Definition: functions.lib.php:3681
ajax_constantonoff
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='')
On/off button for constant.
Definition: ajax.lib.php:573
getDolGlobalString
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:80
dolibarr_set_const
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:627
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
form_constantes
form_constantes($tableau, $strictw3c=0, $helptext='', $text='Value')
Show array with constants to edit.
Definition: admin.lib.php:1619
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59