diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index c3a1f934e2d..a77554afd9e 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -2,6 +2,7 @@ /* Copyright (C) 2018 Andreu Bisquerra * Copyright (C) 2019 Josep LluĂ­s Amador * Copyright (C) 2020 Thibault FOUCART + * Copyright (C) 2024 MDW * * 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 @@ -65,7 +66,7 @@ if (empty($_SESSION["takeposterminal"])) { if ($setterminal > 0) { $_SESSION["takeposterminal"] = $setterminal; - setcookie("takeposterminal", $setterminal, (time() + (86400 * 354)), '/', null, (empty($dolibarr_main_force_https) ? false : true), true); // Permanent takeposterminal var in a cookie + setcookie("takeposterminal", $setterminal, (time() + (86400 * 354)), '/', '', (empty($dolibarr_main_force_https) ? false : true), true); // Permanent takeposterminal var in a cookie } if ($setcurrency != "") { @@ -96,7 +97,7 @@ if ($conf->browser->layout == 'phone') { $MAXCATEG = (!getDolGlobalString('TAKEPOS_NB_MAXCATEG') ? $maxcategbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXCATEG); $MAXPRODUCT = (!getDolGlobalString('TAKEPOS_NB_MAXPRODUCT') ? $maxproductbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXPRODUCT); -$term = empty($_SESSION['takeposterminal']) ? 1: $_SESSION['takeposterminal']; +$term = empty($_SESSION['takeposterminal']) ? 1 : $_SESSION['takeposterminal']; /* $constforcompanyid = 'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]; @@ -377,7 +378,7 @@ function LoadProducts(position, issubcat) { } else { transnoentities('Ref').': ')."' + data[idata]['ref']"; - $titlestring .= " + ' - ".dol_escape_js($langs->trans("Barcode").': ')."' + data[idata]['barcode']"; + $titlestring .= " + ' - ".dol_escape_js($langs->trans("Barcode").': ')."' + data[idata]['barcode']"; ?> var titlestring = ; executeHooks('completeJSProductDisplay', $parameters); print $hookmanager->resPrint; @@ -541,7 +542,7 @@ function ClickProduct(position, qty = 1) { // Call page invoice.php to generate the section with product lines $("#poslines").load("invoice.php?action=addline&token=&place="+place+"&idproduct="+idproduct+"&qty="+qty, function() { }); } @@ -773,7 +774,7 @@ function Search2(keyCodeForEnter, moreorless) { executeHooks('completeJSProductDisplay', $parameters); print $hookmanager->resPrint; @@ -1256,7 +1257,7 @@ if (!getDolGlobalString('TAKEPOS_HIDE_HEAD_BAR')) {
@@ -1331,38 +1332,38 @@ $menus = array(); $r = 0; if (!getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) { - $menus[$r++] = array('title'=>'
'.$langs->trans("New").'
', 'action'=>'New();'); + $menus[$r++] = array('title' => '
'.$langs->trans("New").'
', 'action' => 'New();'); } else { // BAR RESTAURANT specific menu - $menus[$r++] = array('title'=>'
'.$langs->trans("Place").'
', 'action'=>'Floors();'); + $menus[$r++] = array('title' => '
'.$langs->trans("Place").'
', 'action' => 'Floors();'); } if (getDolGlobalString('TAKEPOS_HIDE_HEAD_BAR')) { if (getDolGlobalString('TAKEPOS_CHOOSE_CONTACT')) { - $menus[$r++] = array('title'=>'
'.$langs->trans("Contact").'
', 'action'=>'Contact();'); + $menus[$r++] = array('title' => '
'.$langs->trans("Contact").'
', 'action' => 'Contact();'); } else { - $menus[$r++] = array('title'=>'
'.$langs->trans("Customer").'
', 'action'=>'Customer();'); + $menus[$r++] = array('title' => '
'.$langs->trans("Customer").'
', 'action' => 'Customer();'); } } if (! getDolGlobalString('TAKEPOS_HIDE_HISTORY')) { - $menus[$r++] = array('title'=>'
'.$langs->trans("History").'
', 'action'=>'History();'); + $menus[$r++] = array('title' => '
'.$langs->trans("History").'
', 'action' => 'History();'); } -$menus[$r++] = array('title'=>'
'.$langs->trans("FreeZone").'
', 'action'=>'FreeZone();'); -$menus[$r++] = array('title'=>'
'.$langs->trans("InvoiceDiscountShort").'
', 'action'=>'Reduction();'); +$menus[$r++] = array('title' => '
'.$langs->trans("FreeZone").'
', 'action' => 'FreeZone();'); +$menus[$r++] = array('title' => '
'.$langs->trans("InvoiceDiscountShort").'
', 'action' => 'Reduction();'); -$menus[$r++] = array('title'=>'
'.$langs->trans("SplitSale").'
', 'action'=>'Split();'); +$menus[$r++] = array('title' => '
'.$langs->trans("SplitSale").'
', 'action' => 'Split();'); // BAR RESTAURANT specific menu if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) { if (getDolGlobalString('TAKEPOS_ORDER_PRINTERS')) { - $menus[$r++] = array('title'=>'
'.$langs->trans("Order").'', 'action'=>'TakeposPrintingOrder();'); + $menus[$r++] = array('title' => '
'.$langs->trans("Order").'', 'action' => 'TakeposPrintingOrder();'); } } // Last action that close the sell (payments) -$menus[$r++] = array('title'=>'
'.$langs->trans("Payment").'
', 'action'=>'CloseBill();'); +$menus[$r++] = array('title' => '
'.$langs->trans("Payment").'
', 'action' => 'CloseBill();'); if (getDolGlobalString('TAKEPOS_DIRECT_PAYMENT')) { - $menus[$r++] = array('title'=>'
'.$langs->trans("DirectPayment").' ('.$langs->trans("Cash").')
', 'action'=>'DirectPayment();'); + $menus[$r++] = array('title' => '
'.$langs->trans("DirectPayment").' ('.$langs->trans("Cash").')
', 'action' => 'DirectPayment();'); } // BAR RESTAURANT specific menu @@ -1371,26 +1372,26 @@ if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) { if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) { if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { - $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposConnector(placeid);'); + $menus[$r++] = array('title' => '
'.$langs->trans("Receipt").'
', 'action' => 'TakeposConnector(placeid);'); } else { - $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposPrinting(placeid);'); + $menus[$r++] = array('title' => '
'.$langs->trans("Receipt").'
', 'action' => 'TakeposPrinting(placeid);'); } } elseif ((isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { - $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'DolibarrTakeposPrinting(placeid);'); + $menus[$r++] = array('title' => '
'.$langs->trans("Receipt").'
', 'action' => 'DolibarrTakeposPrinting(placeid);'); } else { - $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'Print(placeid);'); + $menus[$r++] = array('title' => '
'.$langs->trans("Receipt").'
', 'action' => 'Print(placeid);'); } } if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector" && getDolGlobalString('TAKEPOS_ORDER_NOTES') == 1) { - $menus[$r++] = array('title'=>'
'.$langs->trans("OrderNotes").'
', 'action'=>'TakeposOrderNotes();'); + $menus[$r++] = array('title' => '
'.$langs->trans("OrderNotes").'
', 'action' => 'TakeposOrderNotes();'); } if (getDolGlobalString('TAKEPOS_SUPPLEMENTS')) { - $menus[$r++] = array('title'=>'
'.$langs->trans("ProductSupplements").'
', 'action'=>'LoadProducts(\'supplements\');'); + $menus[$r++] = array('title' => '
'.$langs->trans("ProductSupplements").'
', 'action' => 'LoadProducts(\'supplements\');'); } } if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { - $menus[$r++] = array('title'=>'
'.$langs->trans("DOL_OPEN_DRAWER").'
', 'action'=>'OpenDrawer();'); + $menus[$r++] = array('title' => '
'.$langs->trans("DOL_OPEN_DRAWER").'
', 'action' => 'OpenDrawer();'); } if (getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0 || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { $menus[$r++] = array( @@ -1409,14 +1410,14 @@ if ($resql) { $num = $db->num_rows($resql); if ($num) { $obj = $db->fetch_object($resql); - $menus[$r++] = array('title'=>'
'.$langs->trans("CashReport").'
', 'action'=>'CashReport('.$obj->rowid.');'); + $menus[$r++] = array('title' => '
'.$langs->trans("CashReport").'
', 'action' => 'CashReport('.$obj->rowid.');'); if ($obj->status == 0) { - $menus[$r++] = array('title'=>'
'.$langs->trans("CloseCashFence").'
', 'action'=>'CloseCashFence('.$obj->rowid.');'); + $menus[$r++] = array('title' => '
'.$langs->trans("CloseCashFence").'
', 'action' => 'CloseCashFence('.$obj->rowid.');'); } } } -$parameters = array('menus'=>$menus); +$parameters = array('menus' => $menus); $reshook = $hookmanager->executeHooks('ActionButtons', $parameters); if ($reshook == 0) { //add buttons if (is_array($hookmanager->resArray)) { @@ -1438,15 +1439,15 @@ if ($reshook == 0) { //add buttons } if ($r % 3 == 2) { - $menus[$r++] = array('title'=>'', 'style'=>'visibility: hidden;'); + $menus[$r++] = array('title' => '', 'style' => 'visibility: hidden;'); } if (getDolGlobalString('TAKEPOS_HIDE_HEAD_BAR')) { - $menus[$r++] = array('title'=>'
'.$langs->trans("Logout").'
', 'action'=>'window.location.href=\''.DOL_URL_ROOT.'/user/logout.php?token='.newToken().'\';'); + $menus[$r++] = array('title' => '
'.$langs->trans("Logout").'
', 'action' => 'window.location.href=\''.DOL_URL_ROOT.'/user/logout.php?token='.newToken().'\';'); } if (getDolGlobalString('TAKEPOS_WEIGHING_SCALE')) { - $menus[$r++] = array('title'=>'
'.$langs->trans("WeighingScale").'
', 'action'=>'WeighingScale();'); + $menus[$r++] = array('title' => '
'.$langs->trans("WeighingScale").'
', 'action' => 'WeighingScale();'); } ?> @@ -1478,7 +1479,7 @@ if (getDolGlobalString('TAKEPOS_WEIGHING_SCALE')) {
@@ -1511,15 +1512,15 @@ if (getDolGlobalString('TAKEPOS_WEIGHING_SCALE')) { echo ''; } } ?> - +
- +
...
-
@@ -1532,21 +1533,21 @@ if (getDolGlobalString('TAKEPOS_WEIGHING_SCALE')) { $count = 0; while ($count < $MAXPRODUCT) { print '
- onclick="MoreProducts('less')" onclick="MoreProducts('more')" > + onclick="MoreProducts('less')" onclick="MoreProducts('more')" > '; - print ''; + //echo ''; + print ''; } elseif ($count == ($MAXPRODUCT - 1)) { - //echo ''; - print ''; + //echo ''; + print ''; } else { if (!getDolGlobalString('TAKEPOS_HIDE_PRODUCT_PRICES')) { print '
'; @@ -1564,8 +1565,8 @@ if (getDolGlobalString('TAKEPOS_WEIGHING_SCALE')) {
...
-