dolibarr 20.0.0
receiptprinter.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
4 * Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
5 * Copyright (C) 2020 Andreu Bisquerra Gaya <jove@bisquerra.com>
6 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
7 * Copyright (C) 2024 Abbes Bahfir <contact@ab1consult.com><bafbes@gmail.com>
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// Load Dolibarr environment
30require '../main.inc.php';
31
32require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
34require_once DOL_DOCUMENT_ROOT.'/core/lib/receiptprinter.lib.php';
35require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
36
37// Load translation files required by the page
38$langs->loadLangs(array("admin", "receiptprinter"));
39
40if (!$user->admin) {
42}
43
44$action = GETPOST('action', 'aZ09');
45$mode = GETPOST('mode', 'alpha');
46
47$printername = GETPOST('printername', 'alpha');
48$printerid = GETPOSTINT('printerid');
49$parameter = GETPOST('parameter', 'alpha');
50
51$template = GETPOST('template', 'alphanohtml');
52$templatename = GETPOST('templatename', 'alpha');
53$templateid = GETPOSTINT('templateid');
54
55$printer = new dolReceiptPrinter($db);
56$hookmanager->initHooks(array('receiptPrinter', 'globalcard'));
57if (!$mode) {
58 $mode = 'config';
59}
60
61// used in library escpos maybe useful if php doesn't support gzdecode
62if (!function_exists('gzdecode')) {
70 function gzdecode($data)
71 {
72 return gzinflate(substr($data, 10, -8));
73 }
74}
75
76
77/*
78 * Action
79 */
80
81if ($action == 'addprinter' && $user->admin) {
82 $error = 0;
83 if (empty($printername)) {
84 $error++;
85 setEventMessages($langs->trans("PrinterNameEmpty"), null, 'errors');
86 }
87
88 if (empty($parameter)) {
89 setEventMessages($langs->trans("PrinterParameterEmpty"), null, 'warnings');
90 }
91
92 if (!$error) {
93 $db->begin();
94 $result = $printer->addPrinter($printername, GETPOSTINT('printertypeid'), GETPOSTINT('printerprofileid'), $parameter);
95 if ($result > 0) {
96 $error++;
97 }
98
99 if (!$error) {
100 $db->commit();
101 setEventMessages($langs->trans("PrinterAdded", $printername), null);
102 } else {
103 $db->rollback();
104 dol_print_error($db);
105 }
106 }
107 $action = '';
108}
109
110if ($action == 'deleteprinter' && $user->admin) {
111 $error = 0;
112 if (empty($printerid)) {
113 $error++;
114 setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
115 }
116
117 if (!$error) {
118 $db->begin();
119 $result = $printer->deletePrinter($printerid);
120 if ($result > 0) {
121 $error++;
122 }
123
124 if (!$error) {
125 $db->commit();
126 setEventMessages($langs->trans("PrinterDeleted", $printername), null);
127 } else {
128 $db->rollback();
129 dol_print_error($db);
130 }
131 }
132 $action = '';
133}
134
135if ($action == 'updateprinter' && $user->admin) {
136 $error = 0;
137 if (empty($printerid)) {
138 $error++;
139 setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
140 }
141
142 if (!$error) {
143 $db->begin();
144 $result = $printer->updatePrinter($printername, GETPOSTINT('printertypeid'), GETPOSTINT('printerprofileid'), $parameter, $printerid);
145 if ($result > 0) {
146 $error++;
147 }
148
149 if (!$error) {
150 $db->commit();
151 setEventMessages($langs->trans("PrinterUpdated", $printername), null);
152 } else {
153 $db->rollback();
154 dol_print_error($db);
155 }
156 }
157 $action = '';
158}
159
160if ($action == 'testprinter' && $user->admin) {
161 $error = 0;
162 if (empty($printerid)) {
163 $error++;
164 setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
165 }
166
167 if (!$error) {
168 // test
169 $ret = $printer->sendTestToPrinter($printerid);
170 if ($ret == 0) {
171 setEventMessages($langs->trans("TestSentToPrinter", $printername), null);
172 } else {
173 setEventMessages($printer->error, $printer->errors, 'errors');
174 }
175 }
176 $action = '';
177}
178
179if ($action == 'testprinter2' && $user->admin) {
180 $error = 0;
181 if (empty($printerid)) {
182 $error++;
183 setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
184 }
185
186 if (!$error) {
187 // test
188 $ret = $printer->sendTestToPrinter($printerid, 1);
189 if ($ret == 0) {
190 setEventMessages($langs->trans("TestSentToPrinter", $printername), null);
191 } else {
192 setEventMessages($printer->error, $printer->errors, 'errors');
193 }
194 }
195 $action = '';
196}
197
198if ($action == 'testtemplate' && $user->admin) {
199 $error = 0;
200 // if (empty($printerid)) {
201 // $error++;
202 // setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
203 // }
204
205 // if (! $error) {
206 // test
207 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
208 $object = new Facture($db);
209 $object->initAsSpecimen();
210 //$object->fetch(18);
211 //var_dump($object->lines);
212 $ret = $printer->sendToPrinter($object, $templateid, 1);
213 if ($ret == 0) {
214 setEventMessages($langs->trans("TestTemplateToPrinter", $printername), null);
215 } else {
216 setEventMessages($printer->error, $printer->errors, 'errors');
217 }
218 //}
219 $action = '';
220}
221
222if ($action == 'updatetemplate' && $user->admin) {
223 $error = 0;
224 if (empty($templateid)) {
225 $error++;
226 setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors');
227 }
228
229 if (!$error) {
230 $db->begin();
231 $result = $printer->updateTemplate($templatename, $template, $templateid);
232 if ($result > 0) {
233 $error++;
234 }
235
236 if (!$error) {
237 $db->commit();
238 setEventMessages($langs->trans("TemplateUpdated", $templatename), null);
239 } else {
240 $db->rollback();
241 dol_print_error($db);
242 }
243 }
244 $action = '';
245}
246
247if ($action == 'addtemplate' && $user->admin) {
248 $error = 0;
249 if (empty($templatename)) {
250 $error++;
251 setEventMessages($langs->trans("TemplateNameEmpty"), null, 'errors');
252 }
253
254 if (!$error) {
255 $db->begin();
256 $result = $printer->addTemplate($templatename, $template);
257 if ($result > 0) {
258 $error++;
259 }
260
261 if (!$error) {
262 $db->commit();
263 setEventMessages($langs->trans("TemplateAdded", $templatename), null);
264 } else {
265 $db->rollback();
266 dol_print_error($db);
267 }
268 }
269 $action = '';
270}
271
272if ($action == 'deletetemplate' && $user->admin) {
273 $error = 0;
274 if (empty($templateid)) {
275 $error++;
276 setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors');
277 }
278
279 if (!$error) {
280 $db->begin();
281 $result = $printer->deleteTemplate($templateid);
282 if ($result > 0) {
283 $error++;
284 }
285
286 if (!$error) {
287 $db->commit();
288 setEventMessages($langs->trans("TemplateDeleted", $templatename), null);
289 } else {
290 $db->rollback();
291 dol_print_error($db);
292 }
293 }
294 $action = '';
295}
296
297
298/*
299 * View
300 */
301
302$form = new Form($db);
303
304llxHeader('', $langs->trans("ReceiptPrinterSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-receiptprinter');
305
306$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
307print load_fiche_titre($langs->trans("ReceiptPrinterSetup"), $linkback, 'title_setup');
308
310
311// mode = config
312if ($mode == 'config' && $user->admin) {
313 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=config" autocomplete="off">';
314 print '<input type="hidden" name="token" value="'.newToken().'">';
315 if ($action != 'editprinter') {
316 print '<input type="hidden" name="action" value="addprinter">';
317 } else {
318 print '<input type="hidden" name="action" value="updateprinter">';
319 }
320
321
322 print dol_get_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic');
323
324 //print info_admin($langs->trans("ThisFeatureIsForESCPOSPrintersOnly"));
325
326 print load_fiche_titre($langs->trans("ReceiptPrinterDesc"), '', '')."\n";
327
328 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
329 print '<table class="noborder centpercent">'."\n";
330 print '<tr class="liste_titre">';
331 print '<th>'.$langs->trans("Name").'</th>';
332 print '<th>'.$langs->trans("Type").'</th>';
333 print '<th>';
334 $htmltext = $langs->trans("PROFILE_DEFAULT").' = '.$langs->trans("PROFILE_DEFAULT_HELP").'<br>';
335 $htmltext .= $langs->trans("PROFILE_SIMPLE").' = '.$langs->trans("PROFILE_SIMPLE_HELP").'<br>';
336 $htmltext .= $langs->trans("PROFILE_EPOSTEP").' = '.$langs->trans("PROFILE_EPOSTEP_HELP").'<br>';
337 $htmltext .= $langs->trans("PROFILE_P822D").' = '.$langs->trans("PROFILE_P822D_HELP").'<br>';
338 $htmltext .= $langs->trans("PROFILE_STAR").' = '.$langs->trans("PROFILE_STAR_HELP").'<br>';
339
340 print $form->textwithpicto($langs->trans("Profile"), $htmltext);
341 print '</th>';
342 print '<th>'.$langs->trans("Parameters").'</th>';
343 print '<th></th>';
344 print "</tr>\n";
345
346 $ret = $printer->listprinters();
347 $nbofprinters = count($printer->listprinters);
348
349 if ($action != 'editprinter') {
350 print '<tr>';
351 print '<td><input class="minwidth200" type="text" name="printername"></td>';
352 $ret = $printer->selectTypePrinter();
353 print '<td>'.$printer->resprint.'</td>';
354 $ret = $printer->selectProfilePrinter();
355 print '<td>'.$printer->profileresprint.'</td>';
356 print '<td><input size="60" type="text" name="parameter"></td>';
357 print '<td class="right">';
358 if ($action != 'editprinter') {
359 print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
360 }
361 print '</td>';
362 print '</tr>';
363 }
364
365 if ($ret > 0) {
366 setEventMessages($printer->error, $printer->errors, 'errors');
367 } else {
368 for ($line = 0; $line < $nbofprinters; $line++) {
369 print '<tr class="oddeven">';
370 if ($action == 'editprinter' && $printer->listprinters[$line]['rowid'] == $printerid) {
371 print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">';
372 print '<td><input type="text" class="minwidth200" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
373 $ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']);
374 print '<td>'.$printer->resprint.'</td>';
375 $ret = $printer->selectProfilePrinter($printer->listprinters[$line]['fk_profile']);
376 print '<td>'.$printer->profileresprint.'</td>';
377 print '<td><input size="60" type="text" name="parameter" value="'.$printer->listprinters[$line]['parameter'].'"></td>';
378 print '<td>';
379 print $form->buttonsSaveCancel("Save", '');
380 print '</td>';
381 print '</tr>';
382 } else {
383 print '<td>'.$printer->listprinters[$line]['name'].'</td>';
384 print '<td>'.$langs->trans($printer->listprinters[$line]['fk_type_name']).'</td>';
385 print '<td>'.$langs->trans($printer->listprinters[$line]['fk_profile_name']).'</td>';
386 print '<td>'.$printer->listprinters[$line]['parameter'].'</td>';
387 // edit icon
388 print '<td class="center">';
389 print '<a class="editfielda marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=config&action=editprinter&token='.newToken().'&printerid='.$printer->listprinters[$line]['rowid'].'">';
390 print img_picto($langs->trans("Edit"), 'edit', 'class="paddingright"');
391 print '</a>';
392 // delete icon
393 print '<a class="marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=config&action=deleteprinter&token='.newToken().'&printerid='.$printer->listprinters[$line]['rowid'].'&printername='.urlencode($printer->listprinters[$line]['name']).'">';
394 print img_picto($langs->trans("Delete"), 'delete', 'class="paddingright"');
395 print '</a>';
396 // test icon
397 print '<a class="marginrightonly nowraponall" href="'.$_SERVER['PHP_SELF'].'?mode=config&action=testprinter&token='.newToken().'&printerid='.$printer->listprinters[$line]['rowid'].'&printername='.urlencode($printer->listprinters[$line]['name']).'">';
398 print img_picto($langs->trans("TestPrinterDesc"), 'printer', 'class="paddingright paddingleft"').'TXT';
399 print '</a>';
400 // test icon
401 print '<a class="marginrightonly nowraponall" href="'.$_SERVER['PHP_SELF'].'?mode=config&action=testprinter2&token='.newToken().'&printerid='.$printer->listprinters[$line]['rowid'].'&printername='.urlencode($printer->listprinters[$line]['name']).'">';
402 print img_picto($langs->trans("TestPrinterDesc2"), 'printer', 'class="paddingright paddingleft"').'IMG';
403 print '</a>';
404 print '</td>';
405 print '</tr>';
406 }
407 }
408 }
409
410 print '</table>';
411 print '</div>';
412
413 print dol_get_fiche_end();
414
415 print '</form>';
416
417 print '<br>';
418
419
420 print '<span class="opacitymedium">'.$langs->trans("ReceiptPrinterTypeDesc").'...</span><br><br>'."\n";
421
422 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
423 print '<table class="noborder centpercent">'."\n";
424 print '<tr class="oddeven"><td>'.$langs->trans("CONNECTOR_DUMMY").'</td><td>'.$langs->trans("CONNECTOR_DUMMY_HELP").'</td></tr>';
425 print '<tr class="oddeven"><td>'.$form->textwithpicto($langs->trans("CONNECTOR_NETWORK_PRINT"), $langs->trans("FromServerPointOfView")).'</td><td>'.$langs->trans("CONNECTOR_NETWORK_PRINT_HELP").'</td></tr>';
426 print '<tr class="oddeven"><td>'.$form->textwithpicto($langs->trans("CONNECTOR_FILE_PRINT"), $langs->trans("FromServerPointOfView")).'</td><td>'.$langs->trans("CONNECTOR_FILE_PRINT_HELP").'</td></tr>';
427 print '<tr class="oddeven"><td>'.$form->textwithpicto($langs->trans("CONNECTOR_WINDOWS_PRINT"), $langs->trans("FromServerPointOfView")).'</td><td>'.$langs->trans("CONNECTOR_WINDOWS_PRINT_HELP").'</td></tr>';
428 print '<tr class="oddeven"><td>'.$form->textwithpicto($langs->trans("CONNECTOR_CUPS_PRINT"), $langs->trans("FromServerPointOfView")).'</td><td>'.$langs->trans("CONNECTOR_CUPS_PRINT_HELP").'</td></tr>';
429 print '</table>';
430 print '</div>';
431
432 print '<br>';
433}
434
435// mode = template
436if ($mode == 'template' && $user->admin) {
437 print dol_get_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic');
438
439 //print info_admin($langs->trans("ThisFeatureIsForESCPOSPrintersOnly"));
440
441 print '<br>';
442
443 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">';
444 print '<input type="hidden" name="token" value="'.newToken().'">';
445 if ($action != 'edittemplate') {
446 print '<input type="hidden" name="action" value="addtemplate">';
447 } else {
448 print '<input type="hidden" name="action" value="updatetemplate">';
449 }
450
451 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
452 print '<table class="noborder centpercent">'."\n";
453 print '<tr class="liste_titre">';
454 print '<th>'.$langs->trans("Name").'</th>';
455 print '<th>'.$langs->trans("Template").'</th>';
456 print '<th></th>';
457 print "</tr>\n";
458 $ret = $printer->listPrintersTemplates();
459 //print '<pre>'.print_r($printer->listprinterstemplates, true).'</pre>';
460 if ($ret > 0) {
461 setEventMessages($printer->error, $printer->errors, 'errors');
462 } else {
463 $max = count($printer->listprinterstemplates);
464 for ($line = 0; $line < $max; $line++) {
465 print '<tr class="oddeven">';
466 if (!is_array($printer->listprinterstemplates[$line])) {
467 continue;
468 }
469 if ($action == 'edittemplate' && !empty($printer->listprinterstemplates[$line]) && !empty($printer->listprinterstemplates[$line]['rowid']) && $printer->listprinterstemplates[$line]['rowid'] == $templateid) {
470 print '<input type="hidden" name="templateid" value="'.($printer->listprinterstemplates[$line]['rowid'] ?? '').'">';
471 print '<td><input type="text" class="minwidth200" name="templatename" value="'.($printer->listprinterstemplates[$line]['name'] ?? '').'"></td>';
472 print '<td class="wordbreak">';
473 print '<textarea name="template" wrap="soft" cols="120" rows="12">'.($printer->listprinterstemplates[$line]['template'] ?? '').'</textarea>';
474 print '</td>';
475 print '<td>';
476 print $form->buttonsSaveCancel("Save", '');
477 print '</td>';
478 } else {
479 print '<td>'.($printer->listprinterstemplates[$line]['name'] ?? '').'</td>';
480 print '<td class="wordbreak">'.dol_htmlentitiesbr($printer->listprinterstemplates[$line]['template'] ?? '').'</td>';
481 // edit icon
482 print '<td class="center"><a class="editfielda paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=edittemplate&token='.newToken().'&templateid='.($printer->listprinterstemplates[$line]['rowid'] ?? '').'">';
483 print img_picto($langs->trans("Edit"), 'edit');
484 print '</a>';
485 // delete icon
486 print '<a class="paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=deletetemplate&token='.newToken().'&templateid='.($printer->listprinterstemplates[$line]['rowid'] ?? '').'&templatename='.urlencode($printer->listprinterstemplates[$line]['name'] ?? '').'">';
487 print img_picto($langs->trans("Delete"), 'delete');
488 print '</a>';
489 // test icon
490 print '<a class="paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=testtemplate&token='.newToken().'&templateid='.($printer->listprinterstemplates[$line]['rowid'] ?? '').'&templatename='.urlencode($printer->listprinterstemplates[$line]['name'] ?? '').'">';
491 print img_picto($langs->trans("TestPrinterTemplate"), 'printer');
492 print '</a></td>';
493 }
494 print '</tr>';
495 }
496 }
497
498 if ($action != 'edittemplate') {
499 print '<tr>';
500 print '<td><input type="text" class="minwidth200" name="templatename" value="'.($printer->listprinterstemplates[$line]['name'] ?? '').'"></td>';
501 print '<td class="wordbreak">';
502 print '<textarea name="template" wrap="soft" cols="120" rows="12">';
503 print '</textarea>';
504 print '</td>';
505 print '<td>';
506 print '<input type="hidden" name="templateid" value="'.($printer->listprinterstemplates[$line]['rowid'] ?? '').'">';
507 print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
508 print '</td>';
509 print '</tr>';
510 }
511
512 print '</table>';
513 print '</div>';
514
515 print '</form>';
516
517 print dol_get_fiche_end();
518
519 print '<br>';
520
521 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
522 print '<table class="noborder centpercent">'."\n";
523 print '<tr class="liste_titre">';
524 print '<th>'.$langs->trans("Tag").'</th>';
525 print '<th>'.$langs->trans("Description").'</th>';
526 print "</tr>\n";
527
528 $langs->loadLangs(array("bills", "companies"));
529 foreach ($printer->tags as $key => $val) {
530 print '<tr class="oddeven">';
531 print '<td>{'.$key.'}</td><td>'.$langs->trans($val).'</td>';
532 print '</tr>';
533 }
534 $reshook = $hookmanager->executeHooks('listReceiptPrinterTags', array(), $printer, $action); // Note that $action and $object may have been modified by some hooks
535 if ($reshook < 0) {
536 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
537 }
538 print '</table>';
539 print '</div>';
540}
541
542// End of page
543llxFooter();
544$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage invoices.
Class to manage generation of HTML components Only common components must be here.
Class to manage Receipt Printers.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
receiptprinteradmin_prepare_head($mode)
Define head array for tabs of receipt printer setup pages.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.