dolibarr  20.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  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  * or see https://www.gnu.org/
18  */
19 
31 {
32  global $langs, $conf;
33 
34  $h = 0;
35  $head = array();
36 
37  $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/setup.php';
38  $head[$h][1] = $langs->trans("Parameters");
39  $head[$h][2] = 'setup';
40  $h++;
41 
42  $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/appearance.php';
43  $head[$h][1] = $langs->trans("Appearance");
44  $head[$h][2] = 'appearance';
45  $h++;
46 
47  $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/receipt.php';
48  $head[$h][1] = $langs->trans("Printers").' / '.$langs->trans("Receipt");
49  $head[$h][2] = 'receipt';
50  $h++;
51 
52  $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/bar.php';
53  $head[$h][1] = $langs->trans("BarRestaurant");
54  $head[$h][2] = 'bar';
55  $h++;
56 
57  $numterminals = max(1, getDolGlobalInt('TAKEPOS_NUM_TERMINALS', 1));
58  for ($i = 1; $i <= $numterminals; $i++) {
59  $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/terminal.php?terminal='.$i;
60  $head[$h][1] = getDolGlobalString('TAKEPOS_TERMINAL_NAME_'.$i, $langs->trans("TerminalName", $i));
61  $head[$h][2] = 'terminal'.$i;
62  $h++;
63  }
64 
65  $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/other.php';
66  $head[$h][1] = $langs->trans("About");
67  $head[$h][2] = 'other';
68  $h++;
69 
70  complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos_admin');
71 
72  complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos_admin', 'remove');
73 
74  return $head;
75 }
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 dolibarr global constant string value.
takepos_admin_prepare_head()
Prepare array with list of tabs.
Definition: takepos.lib.php:30