dolibarr 21.0.0-beta
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
45// Load translation files required by the page
46$langs->loadLangs(array("admin", "receiptprinter"));
47
48if (!$user->admin) {
50}
51
52$action = GETPOST('action', 'aZ09');
53$mode = GETPOST('mode', 'alpha');
54
55$printername = GETPOST('printername', 'alpha');
56$printerid = GETPOSTINT('printerid');
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' && $user->admin) {
90 $error = 0;
91 if (empty($printername)) {
92 $error++;
93 setEventMessages($langs->trans("PrinterNameEmpty"), null, 'errors');
94 }
95
96 if (empty($parameter)) {
97 setEventMessages($langs->trans("PrinterParameterEmpty"), null, 'warnings');
98 }
99
100 if (!$error) {
101 $db->begin();
102 $result = $printer->addPrinter($printername, GETPOSTINT('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 dol_print_error($db);
113 }
114 }
115 $action = '';
116}
117
118if ($action == 'deleteprinter' && $user->admin) {
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' && $user->admin) {
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' && $user->admin) {
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' && $user->admin) {
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' && $user->admin) {
207 $error = 0;
208 // if (empty($printerid)) {
209 // $error++;
210 // setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
211 // }
212
213 // if (! $error) {
214 // test
215 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
216 $object = new Facture($db);
217 $object->initAsSpecimen();
218 //$object->fetch(18);
219 //var_dump($object->lines);
220 $ret = $printer->sendToPrinter($object, $templateid, 1);
221 if ($ret == 0) {
222 setEventMessages($langs->trans("TestTemplateToPrinter", $printername), null);
223 } else {
224 setEventMessages($printer->error, $printer->errors, 'errors');
225 }
226 //}
227 $action = '';
228}
229
230if ($action == 'updatetemplate' && $user->admin) {
231 $error = 0;
232 if (empty($templateid)) {
233 $error++;
234 setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors');
235 }
236
237 if (!$error) {
238 $db->begin();
239 $result = $printer->updateTemplate($templatename, $template, $templateid);
240 if ($result > 0) {
241 $error++;
242 }
243
244 if (!$error) {
245 $db->commit();
246 setEventMessages($langs->trans("TemplateUpdated", $templatename), null);
247 } else {
248 $db->rollback();
249 dol_print_error($db);
250 }
251 }
252 $action = '';
253}
254
255if ($action == 'addtemplate' && $user->admin) {
256 $error = 0;
257 if (empty($templatename)) {
258 $error++;
259 setEventMessages($langs->trans("TemplateNameEmpty"), null, 'errors');
260 }
261
262 if (!$error) {
263 $db->begin();
264 $result = $printer->addTemplate($templatename, $template);
265 if ($result > 0) {
266 $error++;
267 }
268
269 if (!$error) {
270 $db->commit();
271 setEventMessages($langs->trans("TemplateAdded", $templatename), null);
272 } else {
273 $db->rollback();
274 dol_print_error($db);
275 }
276 }
277 $action = '';
278}
279
280if ($action == 'deletetemplate' && $user->admin) {
281 $error = 0;
282 if (empty($templateid)) {
283 $error++;
284 setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors');
285 }
286
287 if (!$error) {
288 $db->begin();
289 $result = $printer->deleteTemplate($templateid);
290 if ($result > 0) {
291 $error++;
292 }
293
294 if (!$error) {
295 $db->commit();
296 setEventMessages($langs->trans("TemplateDeleted", $templatename), null);
297 } else {
298 $db->rollback();
299 dol_print_error($db);
300 }
301 }
302 $action = '';
303}
304
305
306/*
307 * View
308 */
309
310$form = new Form($db);
311
312llxHeader('', $langs->trans("ReceiptPrinterSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-receiptprinter');
313
314$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
315print load_fiche_titre($langs->trans("ReceiptPrinterSetup"), $linkback, 'title_setup');
316
318$line = -1;
319
320// mode = config
321if ($mode == 'config' && $user->admin) {
322 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=config" autocomplete="off">';
323 print '<input type="hidden" name="token" value="'.newToken().'">';
324 if ($action != 'editprinter') {
325 print '<input type="hidden" name="action" value="addprinter">';
326 } else {
327 print '<input type="hidden" name="action" value="updateprinter">';
328 }
329
330
331 print dol_get_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic');
332
333 //print info_admin($langs->trans("ThisFeatureIsForESCPOSPrintersOnly"));
334
335 print load_fiche_titre($langs->trans("ReceiptPrinterDesc"), '', '')."\n";
336
337 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
338 print '<table class="noborder centpercent">'."\n";
339 print '<tr class="liste_titre">';
340 print '<th>'.$langs->trans("Name").'</th>';
341 print '<th>'.$langs->trans("Type").'</th>';
342 print '<th>';
343 $htmltext = $langs->trans("PROFILE_DEFAULT").' = '.$langs->trans("PROFILE_DEFAULT_HELP").'<br>';
344 $htmltext .= $langs->trans("PROFILE_SIMPLE").' = '.$langs->trans("PROFILE_SIMPLE_HELP").'<br>';
345 $htmltext .= $langs->trans("PROFILE_EPOSTEP").' = '.$langs->trans("PROFILE_EPOSTEP_HELP").'<br>';
346 $htmltext .= $langs->trans("PROFILE_P822D").' = '.$langs->trans("PROFILE_P822D_HELP").'<br>';
347 $htmltext .= $langs->trans("PROFILE_STAR").' = '.$langs->trans("PROFILE_STAR_HELP").'<br>';
348
349 print $form->textwithpicto($langs->trans("Profile"), $htmltext);
350 print '</th>';
351 print '<th>'.$langs->trans("Parameters").'</th>';
352 print '<th></th>';
353 print "</tr>\n";
354
355 $ret = $printer->listprinters();
356 $nbofprinters = count($printer->listprinters);
357
358 if ($action != 'editprinter') {
359 print '<tr>';
360 print '<td><input class="minwidth200" type="text" name="printername"></td>';
361 $ret = $printer->selectTypePrinter();
362 print '<td>'.$printer->resprint.'</td>';
363 $ret = $printer->selectProfilePrinter();
364 print '<td>'.$printer->profileresprint.'</td>';
365 print '<td><input size="60" type="text" name="parameter"></td>';
366 print '<td class="right">';
367 if ($action != 'editprinter') {
368 print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
369 }
370 print '</td>';
371 print '</tr>';
372 }
373
374 if ($ret > 0) {
375 setEventMessages($printer->error, $printer->errors, 'errors');
376 } else {
377 for ($line = 0; $line < $nbofprinters; $line++) {
378 print '<tr class="oddeven">';
379 if ($action == 'editprinter' && $printer->listprinters[$line]['rowid'] == $printerid) {
380 print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">';
381 print '<td><input type="text" class="minwidth200" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
382 $ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']);
383 print '<td>'.$printer->resprint.'</td>';
384 $ret = $printer->selectProfilePrinter($printer->listprinters[$line]['fk_profile']);
385 print '<td>'.$printer->profileresprint.'</td>';
386 print '<td><input size="60" type="text" name="parameter" value="'.$printer->listprinters[$line]['parameter'].'"></td>';
387 print '<td>';
388 print $form->buttonsSaveCancel("Save", '');
389 print '</td>';
390 print '</tr>';
391 } else {
392 print '<td>'.$printer->listprinters[$line]['name'].'</td>';
393 print '<td>'.$langs->trans($printer->listprinters[$line]['fk_type_name']).'</td>';
394 print '<td>'.$langs->trans($printer->listprinters[$line]['fk_profile_name']).'</td>';
395 print '<td>'.$printer->listprinters[$line]['parameter'].'</td>';
396 // edit icon
397 print '<td class="center">';
398 print '<a class="editfielda marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=config&action=editprinter&token='.newToken().'&printerid='.$printer->listprinters[$line]['rowid'].'">';
399 print img_picto($langs->trans("Edit"), 'edit', 'class="paddingright"');
400 print '</a>';
401 // delete icon
402 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']).'">';
403 print img_picto($langs->trans("Delete"), 'delete', 'class="paddingright"');
404 print '</a>';
405 // test icon
406 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']).'">';
407 print img_picto($langs->trans("TestPrinterDesc"), 'printer', 'class="paddingright paddingleft"').'TXT';
408 print '</a>';
409 // test icon
410 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']).'">';
411 print img_picto($langs->trans("TestPrinterDesc2"), 'printer', 'class="paddingright paddingleft"').'IMG';
412 print '</a>';
413 print '</td>';
414 print '</tr>';
415 }
416 }
417 }
418
419 print '</table>';
420 print '</div>';
421
422 print dol_get_fiche_end();
423
424 print '</form>';
425
426 print '<br>';
427
428
429 print '<span class="opacitymedium">'.$langs->trans("ReceiptPrinterTypeDesc").'...</span><br><br>'."\n";
430
431 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
432 print '<table class="noborder centpercent">'."\n";
433 print '<tr class="oddeven"><td>'.$langs->trans("CONNECTOR_DUMMY").'</td><td>'.$langs->trans("CONNECTOR_DUMMY_HELP").'</td></tr>';
434 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>';
435 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>';
436 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>';
437 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>';
438 print '</table>';
439 print '</div>';
440
441 print '<br>';
442}
443
444// mode = template
445if ($mode == 'template' && $user->admin) {
446 print dol_get_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic');
447
448 //print info_admin($langs->trans("ThisFeatureIsForESCPOSPrintersOnly"));
449
450 print '<br>';
451
452 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">';
453 print '<input type="hidden" name="token" value="'.newToken().'">';
454 if ($action != 'edittemplate') {
455 print '<input type="hidden" name="action" value="addtemplate">';
456 } else {
457 print '<input type="hidden" name="action" value="updatetemplate">';
458 }
459
460 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
461 print '<table class="noborder centpercent">'."\n";
462 print '<tr class="liste_titre">';
463 print '<th>'.$langs->trans("Name").'</th>';
464 print '<th>'.$langs->trans("Template").'</th>';
465 print '<th></th>';
466 print "</tr>\n";
467 $ret = $printer->listPrintersTemplates();
468 //print '<pre>'.print_r($printer->listprinterstemplates, true).'</pre>';
469 if ($ret > 0) {
470 setEventMessages($printer->error, $printer->errors, 'errors');
471 } else {
472 $max = count($printer->listprinterstemplates);
473 for ($line = 0; $line < $max; $line++) {
474 print '<tr class="oddeven">';
475 if (!is_array($printer->listprinterstemplates[$line])) {
476 continue;
477 }
478 if ($action == 'edittemplate' && !empty($printer->listprinterstemplates[$line]) && !empty($printer->listprinterstemplates[$line]['rowid']) && $printer->listprinterstemplates[$line]['rowid'] == $templateid) {
479 print '<input type="hidden" name="templateid" value="'.($printer->listprinterstemplates[$line]['rowid'] ?? '').'">';
480 print '<td><input type="text" class="minwidth200" name="templatename" value="'.($printer->listprinterstemplates[$line]['name'] ?? '').'"></td>';
481 print '<td class="wordbreak">';
482 print '<textarea name="template" wrap="soft" cols="120" rows="12">'.($printer->listprinterstemplates[$line]['template'] ?? '').'</textarea>';
483 print '</td>';
484 print '<td>';
485 print $form->buttonsSaveCancel("Save", '');
486 print '</td>';
487 } else {
488 print '<td>'.($printer->listprinterstemplates[$line]['name'] ?? '').'</td>';
489 print '<td class="wordbreak">'.dol_htmlentitiesbr($printer->listprinterstemplates[$line]['template'] ?? '').'</td>';
490 // edit icon
491 print '<td class="center"><a class="editfielda paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=edittemplate&token='.newToken().'&templateid='.($printer->listprinterstemplates[$line]['rowid'] ?? '').'">';
492 print img_picto($langs->trans("Edit"), 'edit');
493 print '</a>';
494 // delete icon
495 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'] ?? '').'">';
496 print img_picto($langs->trans("Delete"), 'delete');
497 print '</a>';
498 // test icon
499 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'] ?? '').'">';
500 print img_picto($langs->trans("TestPrinterTemplate"), 'printer');
501 print '</a></td>';
502 }
503 print '</tr>';
504 }
505 }
506
507 if ($action != 'edittemplate') {
508 print '<tr>';
509 print '<td><input type="text" class="minwidth200" name="templatename" value="'.($printer->listprinterstemplates[$line]['name'] ?? '').'"></td>';
510 print '<td class="wordbreak">';
511 print '<textarea name="template" wrap="soft" cols="120" rows="12">';
512 print '</textarea>';
513 print '</td>';
514 print '<td>';
515 print '<input type="hidden" name="templateid" value="'.($printer->listprinterstemplates[$line]['rowid'] ?? '').'">';
516 print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
517 print '</td>';
518 print '</tr>';
519 }
520
521 print '</table>';
522 print '</div>';
523
524 print '</form>';
525
526 print dol_get_fiche_end();
527
528 print '<br>';
529
530 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
531 print '<table class="noborder centpercent">'."\n";
532 print '<tr class="liste_titre">';
533 print '<th>'.$langs->trans("Tag").'</th>';
534 print '<th>'.$langs->trans("Description").'</th>';
535 print "</tr>\n";
536
537 $langs->loadLangs(array("bills", "companies"));
538 foreach ($printer->tags as $key => $val) {
539 print '<tr class="oddeven">';
540 print '<td>{'.$key.'}</td><td>'.$langs->trans($val).'</td>';
541 print '</tr>';
542 }
543 $reshook = $hookmanager->executeHooks('listReceiptPrinterTags', array(), $printer, $action); // Note that $action and $object may have been modified by some hooks
544 if ($reshook < 0) {
545 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
546 }
547 print '</table>';
548 print '</div>';
549}
550
551// End of page
552llxFooter();
553$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
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:71
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.