dolibarr 22.0.5
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-2025 MDW <mdeweerd@users.noreply.github.com>
7 * Copyright (C) 2024 Abbes Bahfir <contact@ab1consult.com><bafbes@gmail.com>
8 * Copyright (C) 2026 Nathan Pixodeo <nathan@pixodeo.net>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
30// Load Dolibarr environment
31require '../main.inc.php';
32
33require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
34require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
35require_once DOL_DOCUMENT_ROOT.'/core/lib/receiptprinter.lib.php';
36require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
37
46// Load translation files required by the page
47$langs->loadLangs(array("admin", "receiptprinter"));
48
49if (!$user->admin) {
51}
52
53$action = GETPOST('action', 'aZ09');
54$mode = GETPOST('mode', 'alpha');
55
56$printername = GETPOST('printername', 'alpha');
57$printerid = GETPOSTINT('printerid');
58$parameter = GETPOST('parameter', 'alpha');
59
60$template = GETPOST('template', 'alphanohtml');
61$templatename = GETPOST('templatename', 'alpha');
62$templateid = GETPOSTINT('templateid');
63
64$printer = new dolReceiptPrinter($db);
65$hookmanager->initHooks(array('receiptPrinter', 'globalcard'));
66if (!$mode) {
67 $mode = 'config';
68}
69
70// used in library escpos maybe useful if php doesn't support gzdecode
71if (!function_exists('gzdecode')) {
79 function gzdecode($data)
80 {
81 return gzinflate(substr($data, 10, -8));
82 }
83}
84
85
86/*
87 * Action
88 */
89
90if ($action == 'addprinter' && $user->admin) {
91 $error = 0;
92 if (empty($printername)) {
93 $error++;
94 setEventMessages($langs->trans("PrinterNameEmpty"), null, 'errors');
95 }
96
97 if (empty($parameter)) {
98 setEventMessages($langs->trans("PrinterParameterEmpty"), null, 'warnings');
99 }
100
101 if (!$error) {
102 $db->begin();
103 $result = $printer->addPrinter($printername, GETPOSTINT('printertypeid'), GETPOSTINT('printerprofileid'), $parameter);
104 if ($result > 0) {
105 $error++;
106 }
107
108 if (!$error) {
109 $db->commit();
110 setEventMessages($langs->trans("PrinterAdded", $printername), null);
111 } else {
112 $db->rollback();
113 dol_print_error($db);
114 }
115 }
116 $action = '';
117}
118
119if ($action == 'deleteprinter' && $user->admin) {
120 $error = 0;
121 if (empty($printerid)) {
122 $error++;
123 setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
124 }
125
126 if (!$error) {
127 $db->begin();
128 $result = $printer->deletePrinter($printerid);
129 if ($result > 0) {
130 $error++;
131 }
132
133 if (!$error) {
134 $db->commit();
135 setEventMessages($langs->trans("PrinterDeleted", $printername), null);
136 } else {
137 $db->rollback();
138 dol_print_error($db);
139 }
140 }
141 $action = '';
142}
143
144if ($action == 'updateprinter' && $user->admin) {
145 $error = 0;
146 if (empty($printerid)) {
147 $error++;
148 setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
149 }
150
151 if (!$error) {
152 $db->begin();
153 $result = $printer->updatePrinter($printername, GETPOSTINT('printertypeid'), GETPOSTINT('printerprofileid'), $parameter, $printerid);
154 if ($result > 0) {
155 $error++;
156 }
157
158 if (!$error) {
159 $db->commit();
160 setEventMessages($langs->trans("PrinterUpdated", $printername), null);
161 } else {
162 $db->rollback();
163 dol_print_error($db);
164 }
165 }
166 $action = '';
167}
168
169if ($action == 'testprinter' && $user->admin) {
170 $error = 0;
171 if (empty($printerid)) {
172 $error++;
173 setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
174 }
175
176 if (!$error) {
177 // test
178 $ret = $printer->sendTestToPrinter($printerid);
179 if ($ret == 0) {
180 setEventMessages($langs->trans("TestSentToPrinter", $printername), null);
181 } else {
182 setEventMessages($printer->error, $printer->errors, 'errors');
183 }
184 }
185 $action = '';
186}
187
188if ($action == 'testprinter2' && $user->admin) {
189 $error = 0;
190 if (empty($printerid)) {
191 $error++;
192 setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
193 }
194
195 if (!$error) {
196 // test
197 $ret = $printer->sendTestToPrinter($printerid, 1);
198 if ($ret == 0) {
199 setEventMessages($langs->trans("TestSentToPrinter", $printername), null);
200 } else {
201 setEventMessages($printer->error, $printer->errors, 'errors');
202 }
203 }
204 $action = '';
205}
206
207if ($action == 'testtemplate' && $user->admin) {
208 $error = 0;
209 if (empty($printerid)) {
210 $ret = $printer->listPrinters();
211 if ($ret > 0) {
212 $error++;
213 setEventMessages($printer->error, $printer->errors, 'errors');
214 } elseif (!empty($printer->listprinters)) {
215 // Keep the historic first-printer behavior without assuming its rowid is 1.
216 $printerid = (int) min(array_column($printer->listprinters, 'rowid'));
217 }
218 }
219 if (!$error && empty($printerid)) {
220 $error++;
221 setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
222 }
223
224 if (!$error) {
225 // test
226 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
227 $object = new Facture($db);
228 $object->initAsSpecimen();
229 //$object->fetch(18);
230 //var_dump($object->lines);
231 $ret = $printer->sendToPrinter($object, $templateid, $printerid);
232 if ($ret == 0) {
233 setEventMessages($langs->trans("TestTemplateToPrinter", $printername), null);
234 } else {
235 setEventMessages($printer->error, $printer->errors, 'errors');
236 }
237 }
238 $action = '';
239}
240
241if ($action == 'updatetemplate' && $user->admin) {
242 $error = 0;
243 if (empty($templateid)) {
244 $error++;
245 setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors');
246 }
247
248 if (!$error) {
249 $db->begin();
250 $result = $printer->updateTemplate($templatename, $template, $templateid);
251 if ($result > 0) {
252 $error++;
253 }
254
255 if (!$error) {
256 $db->commit();
257 setEventMessages($langs->trans("TemplateUpdated", $templatename), null);
258 } else {
259 $db->rollback();
260 dol_print_error($db);
261 }
262 }
263 $action = '';
264}
265
266if ($action == 'addtemplate' && $user->admin) {
267 $error = 0;
268 if (empty($templatename)) {
269 $error++;
270 setEventMessages($langs->trans("TemplateNameEmpty"), null, 'errors');
271 }
272
273 if (!$error) {
274 $db->begin();
275 $result = $printer->addTemplate($templatename, $template);
276 if ($result > 0) {
277 $error++;
278 }
279
280 if (!$error) {
281 $db->commit();
282 setEventMessages($langs->trans("TemplateAdded", $templatename), null);
283 } else {
284 $db->rollback();
285 dol_print_error($db);
286 }
287 }
288 $action = '';
289}
290
291if ($action == 'deletetemplate' && $user->admin) {
292 $error = 0;
293 if (empty($templateid)) {
294 $error++;
295 setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors');
296 }
297
298 if (!$error) {
299 $db->begin();
300 $result = $printer->deleteTemplate($templateid);
301 if ($result > 0) {
302 $error++;
303 }
304
305 if (!$error) {
306 $db->commit();
307 setEventMessages($langs->trans("TemplateDeleted", $templatename), null);
308 } else {
309 $db->rollback();
310 dol_print_error($db);
311 }
312 }
313 $action = '';
314}
315
316
317/*
318 * View
319 */
320
321$form = new Form($db);
322
323llxHeader('', $langs->trans("ReceiptPrinterSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-receiptprinter');
324
325$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
326print load_fiche_titre($langs->trans("ReceiptPrinterSetup"), $linkback, 'title_setup');
327
329$line = -1;
330
331// mode = config
332if ($mode == 'config' && $user->admin) {
333 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=config" autocomplete="off">';
334 print '<input type="hidden" name="token" value="'.newToken().'">';
335 if ($action != 'editprinter') {
336 print '<input type="hidden" name="action" value="addprinter">';
337 } else {
338 print '<input type="hidden" name="action" value="updateprinter">';
339 }
340
341
342 print dol_get_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic');
343
344 //print info_admin($langs->trans("ThisFeatureIsForESCPOSPrintersOnly"));
345
346 print load_fiche_titre($langs->trans("ReceiptPrinterDesc"), '', '')."\n";
347
348 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
349 print '<table class="noborder centpercent">'."\n";
350 print '<tr class="liste_titre">';
351 print '<th>'.$langs->trans("Name").'</th>';
352 print '<th>'.$langs->trans("Type").'</th>';
353 print '<th>';
354 $htmltext = $langs->trans("PROFILE_DEFAULT").' = '.$langs->trans("PROFILE_DEFAULT_HELP").'<br>';
355 $htmltext .= $langs->trans("PROFILE_SIMPLE").' = '.$langs->trans("PROFILE_SIMPLE_HELP").'<br>';
356 $htmltext .= $langs->trans("PROFILE_EPOSTEP").' = '.$langs->trans("PROFILE_EPOSTEP_HELP").'<br>';
357 $htmltext .= $langs->trans("PROFILE_P822D").' = '.$langs->trans("PROFILE_P822D_HELP").'<br>';
358 $htmltext .= $langs->trans("PROFILE_STAR").' = '.$langs->trans("PROFILE_STAR_HELP").'<br>';
359
360 print $form->textwithpicto($langs->trans("Profile"), $htmltext);
361 print '</th>';
362 print '<th>'.$langs->trans("Parameters").'</th>';
363 print '<th></th>';
364 print "</tr>\n";
365
366 $ret = $printer->listprinters();
367 $nbofprinters = count($printer->listprinters);
368
369 if ($action != 'editprinter') {
370 print '<tr>';
371 print '<td><input class="minwidth100" type="text" name="printername"></td>';
372 $ret = $printer->selectTypePrinter();
373 print '<td>'.$printer->resprint.'</td>';
374 $ret = $printer->selectProfilePrinter();
375 print '<td>'.$printer->profileresprint.'</td>';
376 print '<td><input class="minwidth150" type="text" name="parameter"></td>';
377 print '<td class="right">';
378 if ($action != 'editprinter') {
379 print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
380 }
381 print '</td>';
382 print '</tr>';
383 }
384
385 if ($ret > 0) {
386 setEventMessages($printer->error, $printer->errors, 'errors');
387 } else {
388 for ($line = 0; $line < $nbofprinters; $line++) {
389 print '<tr class="oddeven">';
390 if ($action == 'editprinter' && $printer->listprinters[$line]['rowid'] == $printerid) {
391 print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">';
392 print '<td><input type="text" class="minwidth200" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
393 $ret = $printer->selectTypePrinter((string) $printer->listprinters[$line]['fk_type']);
394 print '<td>'.$printer->resprint.'</td>';
395 $ret = $printer->selectProfilePrinter((string) $printer->listprinters[$line]['fk_profile']);
396 print '<td>'.$printer->profileresprint.'</td>';
397 print '<td><input class="minwidth150" type="text" name="parameter" value="'.$printer->listprinters[$line]['parameter'].'"></td>';
398 print '<td>';
399 print $form->buttonsSaveCancel("Save", '');
400 print '</td>';
401 print '</tr>';
402 } else {
403 print '<td>'.$printer->listprinters[$line]['name'].'</td>';
404 print '<td>'.$langs->trans($printer->listprinters[$line]['fk_type_name']).'</td>';
405 print '<td>'.$langs->trans($printer->listprinters[$line]['fk_profile_name']).'</td>';
406 print '<td>'.$printer->listprinters[$line]['parameter'].'</td>';
407 // edit icon
408 print '<td class="center">';
409 print '<a class="editfielda marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=config&action=editprinter&token='.newToken().'&printerid='.$printer->listprinters[$line]['rowid'].'">';
410 print img_picto($langs->trans("Edit"), 'edit', 'class="paddingright"');
411 print '</a>';
412 // delete icon
413 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']).'">';
414 print img_picto($langs->trans("Delete"), 'delete', 'class="paddingright"');
415 print '</a>';
416 // test icon
417 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']).'">';
418 print img_picto($langs->trans("TestPrinterDesc"), 'printer', 'class="paddingright paddingleft"').'TXT';
419 print '</a>';
420 // test icon
421 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']).'">';
422 print img_picto($langs->trans("TestPrinterDesc2"), 'printer', 'class="paddingright paddingleft"').'IMG';
423 print '</a>';
424 print '</td>';
425 print '</tr>';
426 }
427 }
428 }
429
430 print '</table>';
431 print '</div>';
432
433 print dol_get_fiche_end();
434
435 print '</form>';
436
437 print '<br>';
438
439
440 print '<span class="opacitymedium">'.$langs->trans("ReceiptPrinterTypeDesc").'...</span><br><br>'."\n";
441
442 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
443 print '<table class="noborder centpercent">'."\n";
444 print '<tr class="oddeven"><td class="minwidth100">'.$langs->trans("CONNECTOR_DUMMY").'</td><td>'.$langs->trans("CONNECTOR_DUMMY_HELP").'</td></tr>';
445 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>';
446 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>';
447 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>';
448 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>';
449 print '</table>';
450 print '</div>';
451
452 print '<br>';
453}
454
455// mode = template
456if ($mode == 'template' && $user->admin) {
457 print dol_get_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic');
458
459 //print info_admin($langs->trans("ThisFeatureIsForESCPOSPrintersOnly"));
460
461 print '<br>';
462
463 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">';
464 print '<input type="hidden" name="token" value="'.newToken().'">';
465 if ($action != 'edittemplate') {
466 print '<input type="hidden" name="action" value="addtemplate">';
467 } else {
468 print '<input type="hidden" name="action" value="updatetemplate">';
469 }
470
471 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
472 print '<table class="noborder centpercent">'."\n";
473 print '<tr class="liste_titre">';
474 print '<th>'.$langs->trans("Name").'</th>';
475 print '<th>'.$langs->trans("Template").'</th>';
476 print '<th></th>';
477 print "</tr>\n";
478 $ret = $printer->listPrintersTemplates();
479 //print '<pre>'.print_r($printer->listprinterstemplates, true).'</pre>';
480 if ($ret > 0) {
481 setEventMessages($printer->error, $printer->errors, 'errors');
482 } else {
483 $max = count($printer->listprinterstemplates);
484 for ($line = 0; $line < $max; $line++) {
485 print '<tr class="oddeven">';
486 if (!is_array($printer->listprinterstemplates[$line])) {
487 continue;
488 }
489 if ($action == 'edittemplate' && !empty($printer->listprinterstemplates[$line]) && !empty($printer->listprinterstemplates[$line]['rowid']) && $printer->listprinterstemplates[$line]['rowid'] == $templateid) {
490 print '<input type="hidden" name="templateid" value="'.($printer->listprinterstemplates[$line]['rowid'] ?? '').'">';
491 print '<td><input type="text" class="minwidth200" name="templatename" value="'.($printer->listprinterstemplates[$line]['name'] ?? '').'"></td>';
492 print '<td class="wordbreak">';
493 print '<textarea name="template" wrap="soft" cols="120" rows="12">'.($printer->listprinterstemplates[$line]['template'] ?? '').'</textarea>';
494 print '</td>';
495 print '<td>';
496 print $form->buttonsSaveCancel("Save", '');
497 print '</td>';
498 } else {
499 print '<td>'.($printer->listprinterstemplates[$line]['name'] ?? '').'</td>';
500 print '<td class="wordbreak">'.dol_htmlentitiesbr($printer->listprinterstemplates[$line]['template'] ?? '').'</td>';
501 // edit icon
502 print '<td class="center"><a class="editfielda paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=edittemplate&token='.newToken().'&templateid='.($printer->listprinterstemplates[$line]['rowid'] ?? '').'">';
503 print img_picto($langs->trans("Edit"), 'edit');
504 print '</a>';
505 // delete icon
506 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'] ?? '').'">';
507 print img_picto($langs->trans("Delete"), 'delete');
508 print '</a>';
509 // test icon
510 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'] ?? '').'">';
511 print img_picto($langs->trans("TestPrinterTemplate"), 'printer');
512 print '</a></td>';
513 }
514 print '</tr>';
515 }
516 }
517
518 if ($action != 'edittemplate') {
519 print '<tr>';
520 print '<td><input type="text" class="minwidth200" name="templatename" value="'.($printer->listprinterstemplates[$line]['name'] ?? '').'"></td>';
521 print '<td class="wordbreak">';
522 print '<textarea name="template" wrap="soft" cols="120" rows="12">';
523 print '</textarea>';
524 print '</td>';
525 print '<td>';
526 print '<input type="hidden" name="templateid" value="'.($printer->listprinterstemplates[$line]['rowid'] ?? '').'">';
527 print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
528 print '</td>';
529 print '</tr>';
530 }
531
532 print '</table>';
533 print '</div>';
534
535 print '</form>';
536
537 print dol_get_fiche_end();
538
539 print '<br>';
540
541 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
542 print '<table class="noborder centpercent">'."\n";
543 print '<tr class="liste_titre">';
544 print '<th>'.$langs->trans("Tag").'</th>';
545 print '<th>'.$langs->trans("Description").'</th>';
546 print "</tr>\n";
547
548 $langs->loadLangs(array("bills", "companies"));
549 foreach ($printer->tags as $key => $val) {
550 print '<tr class="oddeven">';
551 print '<td>{'.$key.'}</td><td>'.$langs->trans($val).'</td>';
552 print '</tr>';
553 }
554 $reshook = $hookmanager->executeHooks('listReceiptPrinterTags', array(), $printer, $action); // Note that $action and $object may have been modified by some hooks
555 if ($reshook < 0) {
556 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
557 }
558 print '</table>';
559 print '</div>';
560}
561
562// End of page
563llxFooter();
564$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:67
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 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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
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, $morecssdiv='')
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.
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.