dolibarr 25.0.0-alpha
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 <support@ptibogxiv.net>
7 * Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
8 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
9 * Copyright (C) 2026 Pierre Ardoin <developpeur@lesmetiersdubatiment.fr>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 */
24
31// Load Dolibarr environment
32require '../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
41require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
42require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php';
43
44// Load translation files required by the page
45$langs->loadLangs(array('admin', 'other', 'orders', 'propal', 'bills', 'errors', 'mails', 'contracts'));
46
47// Security check
48if (!$user->admin) { // after this test, $user->admin is always true
50}
51
52$action = GETPOST('action', 'aZ09');
53$error = 0;
54
55
56/*
57 * Actions
58 */
59
60// Action to update or add a constant
61if ($action == 'settemplates') { // Test on permission already done
62 $db->begin();
63
64 if (is_array($_POST)) {
65 $reg = array();
66 foreach ($_POST as $key => $val) {
67 if (!preg_match('/^constvalue_(.*)_TEMPLATE/', $key, $reg)) {
68 continue;
69 }
70
71 $triggername = $reg[1];
72 $constvalue = GETPOST($key, 'alpha');
73 $consttype = 'emailtemplate:xxx';
74 $tmparray = explode(':', $constvalue);
75 if (!empty($tmparray[0]) && !empty($tmparray[1])) {
76 $constvalue = $tmparray[0];
77 $consttype = 'emailtemplate:'.$tmparray[1];
78 $res = dolibarr_set_const($db, $triggername.'_TEMPLATE', $constvalue, $consttype, 0, '', $conf->entity);
79 if ($res < 0) {
80 $error++;
81 break;
82 }
83 } else {
84 $res = dolibarr_del_const($db, $triggername.'_TEMPLATE', $conf->entity);
85 }
86 }
87 }
88
89
90 if (!$error) {
91 $db->commit();
92
93 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
94 } else {
95 $db->rollback();
96
97 setEventMessages($langs->trans("Error"), null, 'errors');
98 }
99}
100
101if ($action == 'setvalue') { // Test on permission already done
102 $db->begin();
103
104 $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", GETPOST("email_from", "alphawithlgt"), 'chaine', 0, '', $conf->entity);
105 if ($result < 0) {
106 $error++;
107 }
108
109 $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE", GETPOST("notif_disable", "alphawithlgt"), 'chaine', 0, '', $conf->entity);
110 if ($result < 0) {
111 $error++;
112 }
113
114 if (!$error) {
115 $db->commit();
116
117 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
118 } else {
119 $db->rollback();
120
121 setEventMessages($langs->trans("Error"), null, 'errors');
122 }
123}
124
125
126if ($action == 'setfixednotif') { // Test on permission already done
127 $db->begin();
128
129 if (is_array($_POST)) {
130 $reg = array();
131 foreach ($_POST as $key => $val) {
132 if (!preg_match('/^NOTIF_(.*)_key$/', $key, $reg)) {
133 continue;
134 }
135
136 $newval = '';
137 $newkey = '';
138
139 $shortkey = preg_replace('/_key$/', '', $key);
140 //print $shortkey.'<br>';
141
142 if (preg_match('/^NOTIF_(.*)_old_(.*)_key/', $key, $reg)) {
143 dolibarr_del_const($db, 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.$reg[2], $conf->entity);
144
145 $newkey = 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
146 $newval = GETPOST($shortkey.'_key');
147 //print $newkey.' - '.$newval.'<br>';
148 } elseif (preg_match('/^NOTIF_(.*)_new_key/', $key, $reg)) {
149 // Add a new entry
150 $newkey = 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
151 $newval = GETPOST($shortkey.'_key');
152 }
153
154 if ($newkey && $newval) {
155 $result = dolibarr_set_const($db, $newkey, $newval, 'chaine', 0, '', $conf->entity);
156 }
157 }
158 }
159
160 if (!$error) {
161 $db->commit();
162
163 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
164 } else {
165 $db->rollback();
166
167 setEventMessages($langs->trans("Error"), null, 'errors');
168 }
169}
170
171
172
173/*
174 * View
175 */
176
177$form = new Form($db);
178$notify = new Notify($db);
179
180llxHeader('', $langs->trans("NotificationSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-notification');
181
182$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
183
184print load_fiche_titre($langs->trans("NotificationSetup"), $linkback, 'title_setup');
185
186print '<span class="opacitymedium">';
187print $langs->trans("NotificationsDesc").'<br>';
188print $langs->trans("NotificationsDescUser").'<br>';
189if (isModEnabled("societe")) {
190 print $langs->trans("NotificationsDescContact").'<br>';
191}
192print $langs->trans("NotificationsDescGlobal").' - '.$langs->trans("YouAreHere").'<br>';
193print '</span>';
194print '<br>';
195
196print '<form method="post" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'" spellcheck="false">';
197print '<input type="hidden" name="token" value="'.newToken().'">';
198print '<input type="hidden" name="action" value="setvalue">';
199
200print '<div class="div-table-responsive-no-min">';
201print '<table class="noborder centpercent">';
202print '<tr class="liste_titre">';
203print '<td>'.$langs->trans("Parameter").'</td>';
204print '<td></td>';
205print "</tr>\n";
206
207
208print '<tr class="oddeven"><td>';
209print $langs->trans("NotificationEMailFrom").'</td>';
210print '<td>';
211print img_picto('', 'email', 'class="pictofixedwidth"');
212print '<input class="width150 quatrevingtpercentminusx" type="email" name="email_from" value="'.getDolGlobalString('NOTIFICATION_EMAIL_FROM').'">';
213if (getDolGlobalString('NOTIFICATION_EMAIL_FROM') && !isValidEmail(getDolGlobalString('NOTIFICATION_EMAIL_FROM'))) {
214 print ' '.img_warning($langs->trans("ErrorBadEMail"));
215}
216print '</td>';
217print '</tr>';
218
219
220print '<tr class="oddeven"><td>';
221print $langs->trans("NotificationDisableConfirmMessageUser").'</td>';
222print '<td>';
223if ($conf->use_javascript_ajax) {
224 print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER');
225} else {
226 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
227 print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER", $arrval, getDolGlobalString('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER'));
228}
229print '</td>';
230print '</tr>';
231
232
233print '<tr class="oddeven"><td>';
234print $langs->trans("NotificationDisableConfirmMessageContact").'</td>';
235print '<td>';
236if ($conf->use_javascript_ajax) {
237 print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT');
238} else {
239 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
240 print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT", $arrval, getDolGlobalString('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT'));
241}
242print '</td>';
243print '</tr>';
244
245
246print '<tr class="oddeven"><td>';
247print $langs->trans("NotificationDisableConfirmMessageFix").'</td>';
248print '<td>';
249if ($conf->use_javascript_ajax) {
250 print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX');
251} else {
252 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
253 print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX", $arrval, getDolGlobalString('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX'));
254}
255print '</td>';
256print '</tr>';
257
258
259print '</table>';
260print '</div>';
261
262print $form->buttonsSaveCancel("Save", '');
263
264print '</form>';
265
266
267print '<br><br>';
268
269
270// Emails templates for notification
271
272print '<form method="post" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'" spellcheck="false">';
273print '<input type="hidden" name="token" value="'.newToken().'">';
274print '<input type="hidden" name="action" value="settemplates">';
275
276$title = $langs->trans("TemplatesForNotifications");
277
278print load_fiche_titre($title, '', 'email');
279
280// Load array of available notifications
281$notificationtrigger = new InterfaceNotification($db);
282$listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
283
284// Editing global variables not related to a specific theme
285$constantes = array();
286foreach ($listofnotifiedevents as $notifiedevent) {
287 $label = $langs->trans("Notify_".$notifiedevent['code']);
288 $elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
289
290 $model = $notifiedevent['elementtype'];
291
292 if ($notifiedevent['elementtype'] == 'order_supplier') {
293 $elementLabel = $langs->trans('SupplierOrder');
294 } elseif ($notifiedevent['elementtype'] == 'propal') {
295 $elementLabel = $langs->trans('Proposal');
296 } elseif ($notifiedevent['elementtype'] == 'facture') {
297 $elementLabel = $langs->trans('Bill');
298 } elseif ($notifiedevent['elementtype'] == 'commande') {
299 $elementLabel = $langs->trans('Order');
300 } elseif ($notifiedevent['elementtype'] == 'ficheinter') {
301 $elementLabel = $langs->trans('Intervention');
302 } elseif ($notifiedevent['elementtype'] == 'shipping') {
303 $elementLabel = $langs->trans('Shipping');
304 } elseif ($notifiedevent['elementtype'] == 'expensereport' || $notifiedevent['elementtype'] == 'expense_report') {
305 $elementLabel = $langs->trans('ExpenseReport');
306 } elseif ($notifiedevent['elementtype'] == 'contrat') {
307 $elementLabel = $langs->trans('Contract');
308 }
309
310 if ($notifiedevent['elementtype'] == 'propal') {
311 $model = 'propal_send';
312 } elseif ($notifiedevent['elementtype'] == 'commande') {
313 $model = 'order_send';
314 } elseif ($notifiedevent['elementtype'] == 'facture') {
315 $model = 'facture_send';
316 } elseif ($notifiedevent['elementtype'] == 'shipping') {
317 $model = 'shipping_send';
318 } elseif ($notifiedevent['elementtype'] == 'ficheinter') {
319 $model = 'fichinter_send';
320 } elseif ($notifiedevent['elementtype'] == 'expensereport') {
321 $model = 'expensereport_send';
322 } elseif ($notifiedevent['elementtype'] == 'societe') {
323 $model = 'thirdparty';
324 } elseif ($notifiedevent['elementtype'] == 'order_supplier') {
325 $model = 'order_supplier_send';
326 } elseif ($notifiedevent['elementtype'] == 'invoice_supplier') {
327 $model = 'invoice_supplier_send';
328 } elseif ($notifiedevent['elementtype'] == 'member') {
329 $model = 'member';
330 } elseif ($notifiedevent['elementtype'] == 'contrat') {
331 $model = 'contract';
332 } elseif ($notifiedevent['elementtype'] == 'stocktransfer') {
333 $model = 'stocktransfer_send';
334 } elseif ($notifiedevent['elementtype'] == 'agenda') {
335 $model = 'actioncomm_send';
336 }
337 // The events of leaves can be recorded with the elementtype 'expensereport' in a database migrated from an old version
338 if (strpos($notifiedevent['code'], 'HOLIDAY_') === 0) {
339 $model = 'holiday';
340 }
341
342 $constantes[$notifiedevent['code'].'_TEMPLATE'] = array('type'=>'emailtemplate:'.$model, 'label'=>$label);
343}
344
345$helptext = $langs->trans("EmailTemplateHelp", $langs->transnoentitiesnoconv("Tools"), $langs->transnoentitiesnoconv("EMailTemplates"));
346form_constantes($constantes, 3, $helptext, 'EmailTemplate');
347
348print $form->buttonsSaveCancel("Save", '');
349
350/*
351} else {
352 print '<table class="noborder centpercent">';
353 print '<tr class="liste_titre">';
354 print '<td>'.$langs->trans("Label").'</td>';
355 //print '<td class="right">'.$langs->trans("NbOfTargetedContacts").'</td>';
356 print "</tr>\n";
357
358 print '<tr class="oddeven">';
359 print '<td>';
360
361 $i = 0;
362 foreach ($listofnotifiedevents as $notifiedevent) {
363 $label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
364 $elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
365
366 if ($notifiedevent['elementtype'] == 'order_supplier') {
367 $elementLabel = $langs->trans('SupplierOrder');
368 } elseif ($notifiedevent['elementtype'] == 'propal') {
369 $elementLabel = $langs->trans('Proposal');
370 } elseif ($notifiedevent['elementtype'] == 'facture') {
371 $elementLabel = $langs->trans('Bill');
372 } elseif ($notifiedevent['elementtype'] == 'commande') {
373 $elementLabel = $langs->trans('Order');
374 } elseif ($notifiedevent['elementtype'] == 'ficheinter') {
375 $elementLabel = $langs->trans('Intervention');
376 } elseif ($notifiedevent['elementtype'] == 'shipping') {
377 $elementLabel = $langs->trans('Shipping');
378 } elseif ($notifiedevent['elementtype'] == 'expensereport' || $notifiedevent['elementtype'] == 'expense_report') {
379 $elementLabel = $langs->trans('ExpenseReport');
380 }
381
382 if ($i) {
383 print ', ';
384 }
385 print $label;
386
387 $i++;
388 }
389
390 print '</td></tr>';
391 print '</table>';
392
393 print '<div class="opacitymedium">';
394 print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
395 if (isModEnabled("societe")) {
396 print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
397 }
398 print '</div>';
399}
400*/
401
402print '</form>';
403
404
405print '<br><br>';
406
407
408print '<form method="post" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'" spellcheck="false">';
409print '<input type="hidden" name="token" value="'.newToken().'">';
410print '<input type="hidden" name="action" value="setfixednotif">';
411print '<input type="hidden" name="page_y" value="">';
412
413print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', 'email');
414
415print '<div class="info">';
416print $langs->trans("Note").':<br>';
417print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
418if (isModEnabled("societe")) {
419 print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
420}
421print '</div>';
422
423print '<div class="div-table-responsive">';
424print '<table class="noborder centpercent">';
425print '<tr class="liste_titre">';
426print '<td>'.$langs->trans("Module").'</td>';
427print '<td>'.$langs->trans("Code").'</td>';
428print '<td>'.$langs->trans("Label").'</td>';
429print '<td>'.$langs->trans("FixedEmailTarget").'</td>';
430print '<td>'.$langs->trans("Threshold").'</td>';
431print '<td></td>';
432print "</tr>\n";
433
434foreach ($listofnotifiedevents as $notifiedevent) {
435 $label = $langs->trans("Notify_".$notifiedevent['code']);
436
437 $elementPicto = $notifiedevent['elementtype'];
438 $elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
439 // Special cases
440 if ($notifiedevent['elementtype'] == 'order_supplier') {
441 $elementPicto = 'supplier_order';
442 $elementLabel = $langs->trans('SupplierOrder');
443 } elseif ($notifiedevent['elementtype'] == 'propal') {
444 $elementLabel = $langs->trans('Proposal');
445 } elseif ($notifiedevent['elementtype'] == 'facture') {
446 $elementPicto = 'bill';
447 $elementLabel = $langs->trans('Bill');
448 } elseif ($notifiedevent['elementtype'] == 'commande') {
449 $elementPicto = 'order';
450 $elementLabel = $langs->trans('Order');
451 } elseif ($notifiedevent['elementtype'] == 'ficheinter') {
452 $elementPicto = 'intervention';
453 $elementLabel = $langs->trans('Intervention');
454 } elseif ($notifiedevent['elementtype'] == 'shipping') {
455 $elementPicto = 'shipment';
456 $elementLabel = $langs->trans('Shipping');
457 } elseif ($notifiedevent['elementtype'] == 'societe') {
458 $elementPicto = 'company';
459 } elseif ($notifiedevent['elementtype'] == 'expensereport' || $notifiedevent['elementtype'] == 'expense_report') {
460 $elementPicto = 'expensereport';
461 $elementLabel = $langs->trans('ExpenseReport');
462 } elseif ($notifiedevent['elementtype'] == 'contrat') {
463 $elementPicto = 'contract';
464 $elementLabel = $langs->trans('Contract');
465 } elseif ($notifiedevent['elementtype'] == 'agenda') {
466 $elementPicto = 'action';
467 }
468
469 $labelfortrigger = 'AmountHT';
470 $codehasnotrigger = 0;
471 if (preg_match('/^(ACTION|HOLIDAY)/', $notifiedevent['code'])) {
472 $codehasnotrigger++;
473 }
474
475 print '<tr class="oddeven">';
476 print '<td>';
477 print img_picto('', $elementPicto, 'class="pictofixedwidth"');
478 print $elementLabel;
479 print '</td>';
480 print '<td>'.$notifiedevent['code'].'</td>';
481 print '<td><span class="opacitymedium">'.$label.'</span></td>';
482 print '<td>';
483 $inputfieldalreadyshown = 0;
484 // Notification with threshold
485 foreach ($conf->global as $key => $val) {
486 if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.preg_quote($notifiedevent['code'], '/').'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) {
487 continue;
488 }
489
490 $param = 'NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_'.$reg[1];
491 $value = GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key') ? GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key', 'alpha') : getDolGlobalString($param);
492
493 $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.
494 $arrayemail = explode(',', $value);
495 $showwarning = 0;
496 foreach ($arrayemail as $keydet => $valuedet) {
497 $valuedet = trim($valuedet);
498 if (!empty($valuedet) && $valuedet != '__SUPERVISOREMAIL__' && $valuedet != '__AUTHOREMAIL__' && !isValidEmail($valuedet, 1)) {
499 $showwarning++;
500 }
501 }
502 if (getDolGlobalString($param) && $showwarning) {
503 $s .= ' '.img_warning($langs->trans("ErrorBadEMail"));
504 }
505 print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword").'<br>'.$langs->trans("YouCanAlsoUseAuthorKeyword"), 1, 'help', '', 0, 2);
506 print '<br>';
507
508 $inputfieldalreadyshown++;
509 }
510 // New entry input fields
511 if (empty($inputfieldalreadyshown) || !$codehasnotrigger) {
512 $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.
513 print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword").'<br>'.$langs->trans("YouCanAlsoUseAuthorKeyword"), 1, 'help', '', 0, 2);
514 }
515 print '</td>';
516
517 print '<td>';
518 // Notification with threshold
519 $inputfieldalreadyshown = 0;
520 foreach ($conf->global as $key => $val) {
521 if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) {
522 continue;
523 }
524
525 if (!$codehasnotrigger) {
526 print $langs->trans($labelfortrigger).' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_amount" value="'.dol_escape_htmltag($reg[1]).'">';
527 print '<br>';
528
529 $inputfieldalreadyshown++;
530 }
531 }
532 // New entry input fields
533 if (!$codehasnotrigger) {
534 print $langs->trans($labelfortrigger).' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_new_amount" value="">';
535 }
536 print '</td>';
537
538 print '<td>';
539 // TODO Add link to show message content
540
541 print '</td>';
542 print '</tr>';
543}
544print '</table>';
545print '</div>';
546
547print $form->buttonsSaveCancel("Save", '');
548
549print '</form>';
550
551// End of page
552llxFooter();
553$db->close();
form_constantes($tableau, $strictw3c=2, $helptext='', $text='')
Show array with constants to edit.
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).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
Class to manage generation of HTML components Only common components must be here.
Class of triggers for notification module.
Class to manage the table of subscription to notifications.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Definition html.lib.php:181
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.