From 3c1d78948233825885ae25e23917de487d1a8f35 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Thu, 16 Jan 2020 08:25:36 +0100 Subject: [PATCH 1/2] Visible receipt printer settings without stock module in TakePOS --- htdocs/takepos/admin/terminal.php | 53 ++++++++++++++++--------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index d2769d77afb..b30cb4e7032 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -207,33 +207,34 @@ if (!empty($conf->stock->enabled)) print ''.$langs->trans("StockDecreaseForPointOfSaleDisabled").''; } print ''; - if ($conf->receiptprinter->enabled) { - // Select printer to use with terminal - require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; - $printer = new dolReceiptPrinter($db); - $printer->listprinters(); - $printers = array(); - foreach ($printer->listprinters as $key => $value) { - $printers[$value['rowid']] = $value['name']; - } - print ''.$langs->trans("TakeposTerminalPrinterToUse").''; - print ''; - print $form->selectarray('TAKEPOS_PRINTER_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}), 1); - print ''; - $printer->listPrintersTemplates(); - $templates = array(); - foreach ($printer->listprinterstemplates as $key => $value) { - $templates[$value['rowid']] = $value['name']; - } - print ''.$langs->trans("TakeposTerminalTemplateToUseForInvoicesTicket").''; - print ''; - print $form->selectarray('TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal, $templates, (empty($conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal}), 1); - print ''; - print ''.$langs->trans("TakeposTerminalTemplateToUseForOrdersTicket").''; - print ''; - print $form->selectarray('TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal, $templates, (empty($conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal}), 1); - print ''; +} + +if ($conf->receiptprinter->enabled) { + // Select printer to use with terminal + require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; + $printer = new dolReceiptPrinter($db); + $printer->listprinters(); + $printers = array(); + foreach ($printer->listprinters as $key => $value) { + $printers[$value['rowid']] = $value['name']; } + print ''.$langs->trans("TakeposTerminalPrinterToUse").''; + print ''; + print $form->selectarray('TAKEPOS_PRINTER_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}), 1); + print ''; + $printer->listPrintersTemplates(); + $templates = array(); + foreach ($printer->listprinterstemplates as $key => $value) { + $templates[$value['rowid']] = $value['name']; + } + print ''.$langs->trans("TakeposTerminalTemplateToUseForInvoicesTicket").''; + print ''; + print $form->selectarray('TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal, $templates, (empty($conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal}), 1); + print ''; + print ''.$langs->trans("TakeposTerminalTemplateToUseForOrdersTicket").''; + print ''; + print $form->selectarray('TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal, $templates, (empty($conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal}), 1); + print ''; } print ''; From 8744f6ab7bc497dbe3650e57b415516b3a1f02a4 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Sat, 18 Jan 2020 15:17:07 +0000 Subject: [PATCH 2/2] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- htdocs/admin/tools/dolibarr_export.php | 84 +- htdocs/comm/propal/list.php | 50 +- htdocs/commande/list.php | 34 +- htdocs/compta/bank/various_payment/list.php | 166 +- htdocs/compta/facture/list.php | 24 +- htdocs/core/class/dolgraph.class.php | 2 +- htdocs/core/class/html.form.class.php | 86 +- htdocs/core/class/utils.class.php | 2 +- htdocs/core/modules/DolibarrModules.class.php | 856 ++++----- htdocs/core/modules/modAgenda.class.php | 28 +- htdocs/core/modules/modUser.class.php | 166 +- htdocs/expedition/list.php | 24 +- htdocs/exports/class/export.class.php | 394 ++--- .../fourn/class/fournisseur.facture.class.php | 690 ++++---- htdocs/holiday/card.php | 22 +- htdocs/loan/list.php | 2 +- htdocs/salaries/list.php | 28 +- .../class/supplier_proposal.class.php | 1524 ++++++++--------- 18 files changed, 2091 insertions(+), 2091 deletions(-) diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index e5f6dae4852..854fd130bc5 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -29,18 +29,18 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $langs->load("admin"); -$action=GETPOST('action', 'alpha'); +$action = GETPOST('action', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); $page = GETPOST('page', 'int'); -if (! $sortorder) $sortorder="DESC"; -if (! $sortfield) $sortfield="date"; +if (!$sortorder) $sortorder = "DESC"; +if (!$sortfield) $sortfield = "date"; if (empty($page) || $page == -1) { $page = 0; } -$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $offset = $limit * $page; -if (! $user->admin) +if (!$user->admin) accessforbidden(); @@ -52,33 +52,33 @@ if ($action == 'delete') { if (preg_match('/^backup\//', GETPOST('urlfile', 'alpha'))) { - $file=$conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha')); - $ret=dol_delete_file($file, 1); + $file = $conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha')); + $ret = dol_delete_file($file, 1); if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); } else { - $file=$conf->admin->dir_output.'/documents/'.basename(GETPOST('urlfile', 'alpha')); - $ret=dol_delete_file($file, 1); + $file = $conf->admin->dir_output.'/documents/'.basename(GETPOST('urlfile', 'alpha')); + $ret = dol_delete_file($file, 1); if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); } - $action=''; + $action = ''; } /* * View */ -$form=new Form($db); +$form = new Form($db); $formfile = new FormFile($db); -$label=$db::LABEL; -$type=$db->type; +$label = $db::LABEL; +$type = $db->type; //var_dump($db); -$help_url='EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad'; +$help_url = 'EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad'; llxHeader('', '', $help_url); print '