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