diff --git a/htdocs/core/lib/takepos.lib.php b/htdocs/core/lib/takepos.lib.php index d04fa5f77ef..1a8ace36d0b 100644 --- a/htdocs/core/lib/takepos.lib.php +++ b/htdocs/core/lib/takepos.lib.php @@ -37,6 +37,11 @@ function takepos_prepare_head() $head[$h][1] = $langs->trans("Parameters"); $head[$h][2] = 'setup'; $h++; + + $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/appearance.php'; + $head[$h][1] = $langs->trans("Appearance"); + $head[$h][2] = 'appearance'; + $h++; $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/receipt.php'; $head[$h][1] = $langs->trans("Receipt"); diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 71a2a992e19..55044a00cec 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -111,4 +111,8 @@ AutoOrder=Order by the customer himself RestaurantMenu=Menu CustomerMenu=Customer menu ScanToMenu=Scan QR code to see the menu -ScanToOrder=Scan QR code to order \ No newline at end of file +ScanToOrder=Scan QR code to order +Appearance=Appearance +HideCategoryImages=Hide Category Images +HideProductImages=Hide Product Images +NumberOfLinesToShow=Number of lines to show in image box \ No newline at end of file diff --git a/htdocs/takepos/admin/appearance.php b/htdocs/takepos/admin/appearance.php new file mode 100644 index 00000000000..1c395fdbb29 --- /dev/null +++ b/htdocs/takepos/admin/appearance.php @@ -0,0 +1,130 @@ + + * Copyright (C) 2011-2017 Juanjo Menent + * Copyright (C) 2019 Andreu Bisquerra Gaya + * + * 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/terminal.php + * \ingroup takepos + * \brief Setup page for TakePos module + */ + +require '../../main.inc.php'; // Load $user and permissions +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; +require_once DOL_DOCUMENT_ROOT."/core/lib/takepos.lib.php"; + +// Security check +if (!$user->admin) accessforbidden(); + +$langs->loadLangs(array("admin", "cashdesk", "commercial")); + +/* + * Actions + */ + +if (GETPOST('action', 'alpha') == 'set') +{ + $db->begin(); + + $res = dolibarr_set_const($db, "TAKEPOS_COLOR_THEME", GETPOST('TAKEPOS_COLOR_THEME', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_LINES_TO_SHOW", GETPOST('TAKEPOS_LINES_TO_SHOW', 'alpha'), 'chaine', 0, '', $conf->entity); + + dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha')); + + if (!$res > 0) $error++; + + if (!$error) + { + $db->commit(); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + $db->rollback(); + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} elseif (GETPOST('action', 'alpha') == 'setmethod') +{ + dolibarr_set_const($db, "TAKEPOS_PRINT_METHOD", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity); +} + + +/* + * View + */ + +$form = new Form($db); +$formproduct = new FormProduct($db); + +llxHeader('', $langs->trans("CashDeskSetup")); + +$linkback = ''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup'); +$head = takepos_prepare_head(); +dol_fiche_head($head, 'appearance', 'TakePOS', -1, 'cash-register'); + +print '
'; +print ''; +print ''; + +print ''; +print ''; +print ''; +print "\n"; + +// Color theme +print '\n"; + +// Hide category images to speed up +print '\n"; + +// Hide category images to speed up +print '\n"; + +// Terminals +print '\n"; + +print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; +print $langs->trans("ColorTheme"); +print ''; +$array = array(0=>"Eldy", 1=>$langs->trans("Colorful")); +print $form->selectarray('TAKEPOS_COLOR_THEME', $array, (empty($conf->global->TAKEPOS_COLOR_THEME) ? '0' : $conf->global->TAKEPOS_COLOR_THEME), 0); +print "
'; +print $langs->trans('HideCategoryImages'); +print ''; +print ajax_constantonoff("TAKEPOS_HIDE_CATEGORY_IMAGES", array(), $conf->entity, 0, 0, 1, 0); +print "
'; +print $langs->trans('HideProductImages'); +print ''; +print ajax_constantonoff("TAKEPOS_HIDE_PRODUCT_IMAGES", array(), $conf->entity, 0, 0, 1, 0); +print "
'; +print $langs->trans("NumberOfLinesToShow"); +print ''; +$array = array(1=>"1", 2=>"2", 3=>"3", 4=>"4", 5=>"5", 6=>"6"); +print $form->selectarray('TAKEPOS_LINES_TO_SHOW', $array, (empty($conf->global->TAKEPOS_LINES_TO_SHOW) ? '2' : $conf->global->TAKEPOS_LINES_TO_SHOW), 0); +print "
'; + +print '
'; + +print '
'; + +print "
\n"; + +print '
'; + +llxFooter(); +$db->close(); diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 541c34e4e12..79f3b729bc4 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -75,7 +75,6 @@ if ($action == 'set') $res = dolibarr_set_const($db, "TAKEPOS_SUPPLEMENTS_CATEGORY", GETPOST('TAKEPOS_SUPPLEMENTS_CATEGORY', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_NUMPAD", GETPOST('TAKEPOS_NUMPAD', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_SORTPRODUCTFIELD", GETPOST('TAKEPOS_SORTPRODUCTFIELD', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_COLOR_THEME", GETPOST('TAKEPOS_COLOR_THEME', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_NUM_TERMINALS", GETPOST('TAKEPOS_NUM_TERMINALS', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_ADDON", GETPOST('TAKEPOS_ADDON', 'alpha'), 'int', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity); @@ -303,14 +302,6 @@ $htmltext = ''.$langs->trans("AvailableVariables").':
'; foreach ($substitutionarray as $key => $val) $htmltext .= $key.'
'; $htmltext .= '
'; -// Color theme -print ''; -print $langs->trans("ColorTheme"); -print ''; -$array = array(0=>"Eldy", 1=>$langs->trans("Colorful")); -print $form->selectarray('TAKEPOS_COLOR_THEME', $array, (empty($conf->global->TAKEPOS_COLOR_THEME) ? '0' : $conf->global->TAKEPOS_COLOR_THEME), 0); -print "\n"; - // Payment numpad print ''; print $langs->trans("Paymentnumpad"); diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index 4c92fe888d2..80271e8bdb3 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -429,7 +429,7 @@ p.description_content{ div.description_content { display: -webkit-box; -webkit-box-orient: vertical; - -webkit-line-clamp: 2; + -webkit-line-clamp: global->TAKEPOS_LINES_TO_SHOW;?>; overflow: hidden; padding-left: 2px; padding-right: 2px; diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 135723de966..0b81aa51391 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -982,7 +982,7 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { //echo ''; echo ''; } else { - echo ''; + if (!$conf->global->TAKEPOS_HIDE_CATEGORY_IMAGES) echo ''; } ?> @@ -1015,7 +1015,7 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { print ''; } else { print '
'; - print ''; + if (!$conf->global->TAKEPOS_HIDE_PRODUCT_IMAGES) print ''; } ?>