From 8476c6c2c697a2e191b3104ceb5641b8b5249193 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Sun, 14 Jun 2020 23:39:49 +0200 Subject: [PATCH 1/3] Printable QR --- htdocs/langs/en_US/cashdesk.lang | 4 ++- htdocs/takepos/admin/bar.php | 4 +-- htdocs/takepos/admin/printqr.php | 49 ++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 htdocs/takepos/admin/printqr.php diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 8d1f50007ea..fd6e14694be 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -109,4 +109,6 @@ OrderTemplateToUse=Order template to use BarRestaurant=Bar Restaurant AutoOrder=Customer auto order RestaurantMenu=Menu -CustomerMenu=Customer menu \ No newline at end of file +CustomerMenu=Customer menu +ScanToMenu=Scan QR code to see the menu +ScanToOrder=Scan QR code to order \ No newline at end of file diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php index 0f47990cb4a..97f651efdb2 100644 --- a/htdocs/takepos/admin/bar.php +++ b/htdocs/takepos/admin/bar.php @@ -161,7 +161,7 @@ if ($conf->global->TAKEPOS_AUTO_ORDER) print ''; print "".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid']).""; print ''; - print ""; + print ""; print ''; } @@ -180,7 +180,7 @@ if ($conf->global->TAKEPOS_QR_MENU) print ''; print "".$urlwithroot."/takepos/public/menu.php"; print ''; - print ""; + print ""; print ''; print ''; } diff --git a/htdocs/takepos/admin/printqr.php b/htdocs/takepos/admin/printqr.php new file mode 100644 index 00000000000..b646eaa7f1d --- /dev/null +++ b/htdocs/takepos/admin/printqr.php @@ -0,0 +1,49 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/takepos/admin/printqr.php + * \ingroup takepos + * \brief Print QR Menu + */ + +require '../../main.inc.php'; + +$langs->load("cashdesk"); + +$id = GETPOST('id', 'int'); + +$_GET['optioncss'] = "print"; + +print '
'; + +if (GETPOSTISSET("id")) { + print '

'.$langs->trans("ScanToOrder").'

'; + print ""; +} +else { + print '

'.$langs->trans("ScanToMenu").'

'; + print ""; +} + +print '

'.$mysoc->name.'

'; + +print '
'; + +llxFooter(); + +$db->close(); From ff018effc33739b5f0ad3455a24ab40b787e84e3 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 14 Jun 2020 23:56:57 +0200 Subject: [PATCH 2/3] Fix travis --- htdocs/takepos/admin/printqr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/admin/printqr.php b/htdocs/takepos/admin/printqr.php index b646eaa7f1d..1348a905608 100644 --- a/htdocs/takepos/admin/printqr.php +++ b/htdocs/takepos/admin/printqr.php @@ -35,7 +35,7 @@ if (GETPOSTISSET("id")) { print '

'.$langs->trans("ScanToOrder").'

'; print ""; } -else { +else { print '

'.$langs->trans("ScanToMenu").'

'; print ""; } From 7de9aa2398d7767db3a9aa8a558d9464b29c0535 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sat, 20 Jun 2020 11:25:54 +0200 Subject: [PATCH 3/3] Add security check --- htdocs/takepos/admin/printqr.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/takepos/admin/printqr.php b/htdocs/takepos/admin/printqr.php index 1348a905608..d459fedf58f 100644 --- a/htdocs/takepos/admin/printqr.php +++ b/htdocs/takepos/admin/printqr.php @@ -23,6 +23,9 @@ require '../../main.inc.php'; +// Security check +if (!$user->admin) accessforbidden(); + $langs->load("cashdesk"); $id = GETPOST('id', 'int');