dolibarr 21.0.0-alpha
takepos.lib.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
4 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 * or see https://www.gnu.org/
19 */
20
32{
33 global $langs, $conf;
34
35 $h = 0;
36 $head = array();
37
38 $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/setup.php';
39 $head[$h][1] = $langs->trans("Parameters");
40 $head[$h][2] = 'setup';
41 $h++;
42
43 $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/appearance.php';
44 $head[$h][1] = $langs->trans("Appearance");
45 $head[$h][2] = 'appearance';
46 $h++;
47
48 $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/receipt.php';
49 $head[$h][1] = $langs->trans("Printers").' / '.$langs->trans("Receipt");
50 $head[$h][2] = 'receipt';
51 $h++;
52
53 $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/bar.php';
54 $head[$h][1] = $langs->trans("BarRestaurant");
55 $head[$h][2] = 'bar';
56 $h++;
57
58 $numterminals = max(1, getDolGlobalInt('TAKEPOS_NUM_TERMINALS', 1));
59 for ($i = 1; $i <= $numterminals; $i++) {
60 $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/terminal.php?terminal='.$i;
61 $head[$h][1] = getDolGlobalString('TAKEPOS_TERMINAL_NAME_'.$i, $langs->trans("TerminalName", $i));
62 $head[$h][2] = 'terminal'.$i;
63 $h++;
64 }
65
66 $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/other.php';
67 $head[$h][1] = $langs->trans("About");
68 $head[$h][2] = 'other';
69 $h++;
70
71 complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos_admin');
72
73 complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos_admin', 'remove');
74
75 return $head;
76}
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
takepos_admin_prepare_head()
Prepare array with list of tabs.