* Copyright (C) 2011-2017 Juanjo Menent * Copyright (C) 2019-2020 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/appearance.php * \ingroup takepos * \brief Setup page for TakePos module */ // Load Dolibarr environment 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); if (GETPOSTISSET('TAKEPOS_SHOW_PRODUCT_REFERENCE')) { $res = dolibarr_set_const($db, "TAKEPOS_SHOW_PRODUCT_REFERENCE", GETPOST('TAKEPOS_SHOW_PRODUCT_REFERENCE', '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'); } } /* * View */ $form = new Form($db); $formproduct = new FormProduct($db); llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, '', '', '', 'mod-takepos page-admin_appearance'); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup'); $head = takepos_admin_prepare_head(); print dol_get_fiche_head($head, 'appearance', 'TakePOS', -1, 'cash-register'); print '
'; print ''; print ''; print '
'; print ''; print ''; print ''; print "\n"; // Color theme print '\n"; // Don't display category section print '\n"; // Hide category images to speed up if (!getDolGlobalString('TAKEPOS_HIDE_CATEGORIES')) { print '\n"; } // Hide category images to speed up print '\n"; // View reference or label of products print '\n"; // Lines to show print '\n"; // Hide stock on line print '\n"; // Only the products in stock print '\n"; // View description of the categories print '\n"; print '
'.$langs->trans("Parameters").'
'; print $langs->trans("ColorTheme"); print ''; $array = array(0=>"Eldy", 1=>$langs->trans("Colorful")); print $form->selectarray('TAKEPOS_COLOR_THEME', $array, (!getDolGlobalString('TAKEPOS_COLOR_THEME') ? '0' : $conf->global->TAKEPOS_COLOR_THEME), 0); print "
'; print $langs->trans('HideCategories'); print ''; print ajax_constantonoff("TAKEPOS_HIDE_CATEGORIES", array(), $conf->entity, 0, 0, 1, 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('ShowProductReference'); print ''; $array = array("0"=>$langs->trans("Label"), 1=>$langs->trans("Ref").'+'.$langs->trans("Label"), 2=>$langs->trans("Ref")); print $form->selectarray('TAKEPOS_SHOW_PRODUCT_REFERENCE', $array, getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE', 2), 0); //print ajax_constantonoff("TAKEPOS_SHOW_PRODUCT_REFERENCE", 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, getDolGlobalInt('TAKEPOS_LINES_TO_SHOW', 2), 0); print "
'; print $langs->trans('HideStockOnLine'); print ''; print ajax_constantonoff("TAKEPOS_HIDE_STOCK_ON_LINE", array(), $conf->entity, 0, 0, 1, 0); print "
'; print $langs->trans('ShowOnlyProductInStock'); print ''; print ajax_constantonoff("TAKEPOS_PRODUCT_IN_STOCK", array(), $conf->entity, 0, 0, 1, 0); print "
'; print $langs->trans('ShowCategoryDescription'); print ''; print ajax_constantonoff("TAKEPOS_SHOW_CATEGORY_DESCRIPTION", array(), $conf->entity, 0, 0, 1, 0); print "
'; print $form->buttonsSaveCancel("Save", ''); print "
\n"; print '
'; llxFooter(); $db->close();