dolibarr 21.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-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$line = -1;
311
312// mode = config
313if ($mode == 'config' && $user->admin) {
314 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=config" autocomplete="off">';
315 print '<input type="hidden" name="token" value="'.newToken().'">';
316 if ($action != 'editprinter') {
317 print '<input type="hidden" name="action" value="addprinter">';
318 } else {
319 print '<input type="hidden" name="action" value="updateprinter">';
320 }
321
322
323 print dol_get_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic');
324
325 //print info_admin($langs->trans("ThisFeatureIsForESCPOSPrintersOnly"));
326
327 print load_fiche_titre($langs->trans("ReceiptPrinterDesc"), '', '')."\n";
328
329 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
330 print '<table class="noborder centpercent">'."\n";
331 print '<tr class="liste_titre">';
332 print '<th>'.$langs->trans("Name").'</th>';
333 print '<th>'.$langs->trans("Type").'</th>';
334 print '<th>';
335 $htmltext = $langs->trans("PROFILE_DEFAULT").' = '.$langs->trans("PROFILE_DEFAULT_HELP").'<br>';
336 $htmltext .= $langs->trans("PROFILE_SIMPLE").' = '.$langs->trans("PROFILE_SIMPLE_HELP").'<br>';
337 $htmltext .= $langs->trans("PROFILE_EPOSTEP").' = '.$langs->trans("PROFILE_EPOSTEP_HELP").'<br>';
338 $htmltext .= $langs->trans("PROFILE_P822D").' = '.$langs->trans("PROFILE_P822D_HELP").'<br>';
339 $htmltext .= $langs->trans("PROFILE_STAR").' = '.$langs->trans("PROFILE_STAR_HELP").'<br>';
340
341 print $form->textwithpicto($langs->trans("Profile"), $htmltext);
342 print '</th>';
343 print '<th>'.$langs->trans("Parameters").'</th>';
344 print '<th></th>';
345 print "</tr>\n";
346
347 $ret = $printer->listprinters();
348 $nbofprinters = count($printer->listprinters);
349
350 if ($action != 'editprinter') {
351 print '<tr>';
352 print '<td><input class="minwidth200" type="text" name="printername"></td>';
353 $ret = $printer->selectTypePrinter();
354 print '<td>'.$printer->resprint.'</td>';
355 $ret = $printer->selectProfilePrinter();
356 print '<td>'.$printer->profileresprint.'</td>';
357 print '<td><input size="60" type="text" name="parameter"></td>';
358 print '<td class="right">';
359 if ($action != 'editprinter') {
360 print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
361 }
362 print '</td>';
363 print '</tr>';
364 }
365
366 if ($ret > 0) {
367 setEventMessages($printer->error, $printer->errors, 'errors');
368 } else {
369 for ($line = 0; $line < $nbofprinters; $line++) {
370 print '<tr class="oddeven">';
371 if ($action == 'editprinter' && $printer->listprinters[$line]['rowid'] == $printerid) {
372 print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">';
373 print '<td><input type="text" class="minwidth200" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
374 $ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']);
375 print '<td>'.$printer->resprint.'</td>';
376 $ret = $printer->selectProfilePrinter($printer->listprinters[$line]['fk_profile']);
377 print '<td>'.$printer->profileresprint.'</td>';
378 print '<td><input size="60" type="text" name="parameter" value="'.$printer->listprinters[$line]['parameter'].'"></td>';
379 print '<td>';
380 print $form->buttonsSaveCancel("Save", '');
381 print '</td>';
382 print '</tr>';
383 } else {
384 print '<td>'.$printer->listprinters[$line]['name'].'</td>';
385 print '<td>'.$langs->trans($printer->listprinters[$line]['fk_type_name']).'</td>';
386 print '<td>'.$langs->trans($printer->listprinters[$line]['fk_profile_name']).'</td>';
387 print '<td>'.$printer->listprinters[$line]['parameter'].'</td>';
388 // edit icon
389 print '<td class="center">';
390 print '<a class="editfielda marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=config&action=editprinter&token='.newToken().'&printerid='.$printer->listprinters[$line]['rowid'].'">';
391 print img_picto($langs->trans("Edit"), 'edit', 'class="paddingright"');
392 print '</a>';
393 // delete icon
394 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']).'">';
395 print img_picto($langs->trans("Delete"), 'delete', 'class="paddingright"');
396 print '</a>';
397 // test icon
398 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']).'">';
399 print img_picto($langs->trans("TestPrinterDesc"), 'printer', 'class="paddingright paddingleft"').'TXT';
400 print '</a>';
401 // test icon
402 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']).'">';
403 print img_picto($langs->trans("TestPrinterDesc2"), 'printer', 'class="paddingright paddingleft"').'IMG';
404 print '</a>';
405 print '</td>';
406 print '</tr>';
407 }
408 }
409 }
410
411 print '</table>';
412 print '</div>';
413
414 print dol_get_fiche_end();
415
416 print '</form>';
417
418 print '<br>';
419
420
421 print '<span class="opacitymedium">'.$langs->trans("ReceiptPrinterTypeDesc").'...</span><br><br>'."\n";
422
423 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
424 print '<table class="noborder centpercent">'."\n";
425 print '<tr class="oddeven"><td>'.$langs->trans("CONNECTOR_DUMMY").'</td><td>'.$langs->trans("CONNECTOR_DUMMY_HELP").'</td></tr>';
426 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>';
427 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>';
428 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>';
429 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>';
430 print '</table>';
431 print '</div>';
432
433 print '<br>';
434}
435
436// mode = template
437if ($mode == 'template' && $user->admin) {
438 print dol_get_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic');
439
440 //print info_admin($langs->trans("ThisFeatureIsForESCPOSPrintersOnly"));
441
442 print '<br>';
443
444 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">';
445 print '<input type="hidden" name="token" value="'.newToken().'">';
446 if ($action != 'edittemplate') {
447 print '<input type="hidden" name="action" value="addtemplate">';
448 } else {
449 print '<input type="hidden" name="action" value="updatetemplate">';
450 }
451
452 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
453 print '<table class="noborder centpercent">'."\n";
454 print '<tr class="liste_titre">';
455 print '<th>'.$langs->trans("Name").'</th>';
456 print '<th>'.$langs->trans("Template").'</th>';
457 print '<th></th>';
458 print "</tr>\n";
459 $ret = $printer->listPrintersTemplates();
460 //print '<pre>'.print_r($printer->listprinterstemplates, true).'</pre>';
461 if ($ret > 0) {
462 setEventMessages($printer->error, $printer->errors, 'errors');
463 } else {
464 $max = count($printer->listprinterstemplates);
465 for ($line = 0; $line < $max; $line++) {
466 print '<tr class="oddeven">';
467 if (!is_array($printer->listprinterstemplates[$line])) {
468 continue;
469 }
470 if ($action == 'edittemplate' && !empty($printer->listprinterstemplates[$line]) && !empty($printer->listprinterstemplates[$line]['rowid']) && $printer->listprinterstemplates[$line]['rowid'] == $templateid) {
471 print '<input type="hidden" name="templateid" value="'.($printer->listprinterstemplates[$line]['rowid'] ?? '').'">';
472 print '<td><input type="text" class="minwidth200" name="templatename" value="'.($printer->listprinterstemplates[$line]['name'] ?? '').'"></td>';
473 print '<td class="wordbreak">';
474 print '<textarea name="template" wrap="soft" cols="120" rows="12">'.($printer->listprinterstemplates[$line]['template'] ?? '').'</textarea>';
475 print '</td>';
476 print '<td>';
477 print $form->buttonsSaveCancel("Save", '');
478 print '</td>';
479 } else {
480 print '<td>'.($printer->listprinterstemplates[$line]['name'] ?? '').'</td>';
481 print '<td class="wordbreak">'.dol_htmlentitiesbr($printer->listprinterstemplates[$line]['template'] ?? '').'</td>';
482 // edit icon
483 print '<td class="center"><a class="editfielda paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=edittemplate&token='.newToken().'&templateid='.($printer->listprinterstemplates[$line]['rowid'] ?? '').'">';
484 print img_picto($langs->trans("Edit"), 'edit');
485 print '</a>';
486 // delete icon
487 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'] ?? '').'">';
488 print img_picto($langs->trans("Delete"), 'delete');
489 print '</a>';
490 // test icon
491 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'] ?? '').'">';
492 print img_picto($langs->trans("TestPrinterTemplate"), 'printer');
493 print '</a></td>';
494 }
495 print '</tr>';
496 }
497 }
498
499 if ($action != 'edittemplate') {
500 print '<tr>';
501 print '<td><input type="text" class="minwidth200" name="templatename" value="'.($printer->listprinterstemplates[$line]['name'] ?? '').'"></td>';
502 print '<td class="wordbreak">';
503 print '<textarea name="template" wrap="soft" cols="120" rows="12">';
504 print '</textarea>';
505 print '</td>';
506 print '<td>';
507 print '<input type="hidden" name="templateid" value="'.($printer->listprinterstemplates[$line]['rowid'] ?? '').'">';
508 print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
509 print '</td>';
510 print '</tr>';
511 }
512
513 print '</table>';
514 print '</div>';
515
516 print '</form>';
517
518 print dol_get_fiche_end();
519
520 print '<br>';
521
522 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
523 print '<table class="noborder centpercent">'."\n";
524 print '<tr class="liste_titre">';
525 print '<th>'.$langs->trans("Tag").'</th>';
526 print '<th>'.$langs->trans("Description").'</th>';
527 print "</tr>\n";
528
529 $langs->loadLangs(array("bills", "companies"));
530 foreach ($printer->tags as $key => $val) {
531 print '<tr class="oddeven">';
532 print '<td>{'.$key.'}</td><td>'.$langs->trans($val).'</td>';
533 print '</tr>';
534 }
535 $reshook = $hookmanager->executeHooks('listReceiptPrinterTags', array(), $printer, $action); // Note that $action and $object may have been modified by some hooks
536 if ($reshook < 0) {
537 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
538 }
539 print '</table>';
540 print '</div>';
541}
542
543// End of page
544llxFooter();
545$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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:70
Class to manage invoices.
Class to manage generation of HTML components Only common components must be here.
Class to manage Receipt Printers.
llxFooter()
Footer empty.
Definition document.php:107
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)
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.
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.