From f5e19ea1b9947b59d236f09e7212453f79ee364e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 27 Aug 2022 06:33:33 +0200 Subject: [PATCH 1/8] PHP8 Warnings --- htdocs/takepos/admin/bar.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php index db6d6c8c67d..2f37de1a1b0 100644 --- a/htdocs/takepos/admin/bar.php +++ b/htdocs/takepos/admin/bar.php @@ -1,6 +1,7 @@ - * Copyright (C) 2011-2017 Juanjo Menent +/* Copyright (C) 2008-2011 Laurent Destailleur + * Copyright (C) 2011-2017 Juanjo Menent + * Copyright (C) 2022 Alexandre Spangaro * * 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 @@ -67,7 +68,7 @@ if (GETPOST('action', 'alpha') == 'set') { } } -if ($conf->global->TAKEPOS_ORDER_NOTES == 1) { +if (getDolGlobalInt('TAKEPOS_ORDER_NOTES') == 1) { $extrafields = new ExtraFields($db); $extrafields->addExtraField('order_notes', 'Order notes', 'varchar', 0, 255, 'facturedet', 0, 0, '', '', 0, '', 0, 1); } @@ -79,6 +80,7 @@ if ($conf->global->TAKEPOS_ORDER_NOTES == 1) { $form = new Form($db); $formproduct = new FormProduct($db); +$arrayofjs = array(); $arrayofcss = array("/takepos/css/colorbox.css"); llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, $arrayofjs, $arrayofcss); @@ -112,7 +114,7 @@ print ''; print '
'; -if ($conf->global->TAKEPOS_BAR_RESTAURANT) { +if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) { print '
'; print ' '.$langs->trans("DefineTablePlan").'
'; print '

'; @@ -171,12 +173,12 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) { print ajax_constantonoff("TAKEPOS_SUPPLEMENTS", array(), $conf->entity, 0, 0, 1, 0); print ''; - if ($conf->global->TAKEPOS_SUPPLEMENTS) { + if (getDolGlobalInt('TAKEPOS_SUPPLEMENTS')) { print ''; print $langs->trans("SupplementCategory"); print ''; print ''; - print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_SUPPLEMENTS_CATEGORY, 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0); + print $form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalString('TAKEPOS_SUPPLEMENTS_CATEGORY'), 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0); print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY'); print "\n"; } @@ -203,8 +205,8 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) { print $form->buttonsSaveCancel("Save", ''); } -if (!empty($conf->global->TAKEPOS_BAR_RESTAURANT)) { - if ($conf->global->TAKEPOS_QR_MENU) { +if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) { + if (getDolGlobalInt('TAKEPOS_QR_MENU')) { $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file print '
'; @@ -221,7 +223,7 @@ if (!empty($conf->global->TAKEPOS_BAR_RESTAURANT)) { print ''; } - if ($conf->global->TAKEPOS_AUTO_ORDER) { + if (getDolGlobalInt('TAKEPOS_AUTO_ORDER')) { print '
'; print ''; print ''; From ad788abdb853b7e2224c20fb04aeab33c3761332 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 27 Aug 2022 06:35:19 +0200 Subject: [PATCH 2/8] Review Use Ajax constantonoff --- htdocs/takepos/admin/receipt.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index bf5f5e8b931..6c390aabe73 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -1,8 +1,9 @@ - * Copyright (C) 2011-2017 Juanjo Menent - * Copyright (C) 2019 Andreu Bisquerra Gaya - * Copyright (C) 2021 Nicolas ZABOURI +/* Copyright (C) 2008-2011 Laurent Destailleur + * Copyright (C) 2011-2017 Juanjo Menent + * Copyright (C) 2019 Andreu Bisquerra Gaya + * Copyright (C) 2021 Nicolas ZABOURI + * Copyright (C) 2022 Alexandre Spangaro * * 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 @@ -47,10 +48,7 @@ if (GETPOST('action', 'alpha') == 'set') { $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'restricthtml'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'restricthtml'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_RECEIPT_NAME", GETPOST('TAKEPOS_RECEIPT_NAME', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_SHOW_CUSTOMER", GETPOST('TAKEPOS_SHOW_CUSTOMER', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_PRINT_PAYMENT_METHOD", GETPOST('TAKEPOS_PRINT_PAYMENT_METHOD', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, 'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT', GETPOST('TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT', 'alphanohtml'), 'chaine', 0, '', $conf->entity); dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha')); @@ -221,14 +219,14 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P print '\n"; // Print payment method print '\n"; } @@ -236,7 +234,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P print '\n"; From b1662d535e8031195b5824fc60ad4c3a45627f63 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 27 Aug 2022 06:35:47 +0200 Subject: [PATCH 3/8] Class css --- htdocs/takepos/admin/setup.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 849c5c56481..c1e043e089a 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -1,7 +1,8 @@ - * Copyright (C) 2011-2017 Juanjo Menent - * Copyright (C) 2021 Nicolas ZABOURI +/* Copyright (C) 2008-2011 Laurent Destailleur + * Copyright (C) 2011-2017 Juanjo Menent + * Copyright (C) 2021 Nicolas ZABOURI + * Copyright (C) 2022 Alexandre Spangaro * * 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 @@ -142,13 +143,13 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); print load_fiche_titre($langs->trans('CashDeskRefNumberingModules'), '', ''); -print '
'; print $langs->trans('PrintCustomerOnReceipts'); print ''; - print $form->selectyesno("TAKEPOS_SHOW_CUSTOMER", $conf->global->TAKEPOS_SHOW_CUSTOMER, 1); + print ajax_constantonoff("TAKEPOS_SHOW_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0); print "
'; print $langs->trans('PrintPaymentMethodOnReceipts'); print ''; - print $form->selectyesno("TAKEPOS_PRINT_PAYMENT_METHOD", $conf->global->TAKEPOS_PRINT_PAYMENT_METHOD, 1); + print ajax_constantonoff("TAKEPOS_PRINT_PAYMENT_METHOD", array(), $conf->entity, 0, 0, 1, 0); print "
'; print $langs->trans("AutoPrintTickets"); print ''; -print $form->selectyesno("TAKEPOS_AUTO_PRINT_TICKETS", $conf->global->TAKEPOS_AUTO_PRINT_TICKETS, 1); +print ajax_constantonoff("TAKEPOS_AUTO_PRINT_TICKETS", array(), $conf->entity, 0, 0, 1, 0); print "
'; +print '
'; print ''; print '\n"; print '\n"; print '\n"; -print ''; -print ''; +print ''; +print ''; print ''."\n"; clearstatcache(); From e36cc581ee97267955effe00d8afaa53b1acc2b2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 27 Aug 2022 08:19:33 +0200 Subject: [PATCH 4/8] PHP8 Warnings --- htdocs/takepos/admin/setup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index c1e043e089a..a7a3183fa33 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -79,7 +79,7 @@ if ($action == 'set') { $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); - if (!empty($conf->global->TAKEPOS_ENABLE_SUMUP)) { + if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) { $res = dolibarr_set_const($db, "TAKEPOS_SUMUP_AFFILIATE", GETPOST('TAKEPOS_SUMUP_AFFILIATE', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_SUMUP_APPID", GETPOST('TAKEPOS_SUMUP_APPID', 'alpha'), 'chaine', 0, '', $conf->entity); } @@ -459,7 +459,7 @@ print ''; // Sumup options -if ($conf->global->TAKEPOS_ENABLE_SUMUP) { +if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) { print '
'; print '
'; From 612bedb03960cc18c42325ea0e8b01ebbb107eff Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 27 Aug 2022 08:19:39 +0200 Subject: [PATCH 5/8] PHP8 Warnings --- htdocs/takepos/admin/terminal.php | 43 ++++++++++++++++--------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index f6562d81693..5a3bc212f05 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -1,6 +1,7 @@ - * Copyright (C) 2011-2017 Juanjo Menent +/* Copyright (C) 2008-2011 Laurent Destailleur + * Copyright (C) 2011-2017 Juanjo Menent + * Copyright (C) 2022 Alexandre Spangaro * * 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 @@ -73,7 +74,7 @@ if (GETPOST('action', 'alpha') == 'set') { $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); - if (!empty($conf->global->TAKEPOS_ENABLE_SUMUP)) { + if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) { $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_SUMUP".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); } foreach ($paiements as $modep) { @@ -145,7 +146,7 @@ print "\n"; print '
'; print ''; $atleastonefound = 0; @@ -153,33 +154,33 @@ if (!empty($conf->banque->enabled)) { print ''; print ''; print ''; print ''; print ''; print ''; - if ($conf->global->TAKEPOS_ENABLE_SUMUP) { + if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) { print ''; print ''; @@ -197,7 +198,7 @@ if (!empty($conf->banque->enabled)) { } $cour = preg_match('/^LIQ.*/', $modep->code) ? 2 : 1; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); - $form->select_comptes($conf->global->$name, $name, 0, "courant=".$cour, 1); + $form->select_comptes(getDolGlobalInt($name), $name, 0, "courant=".$cour, 1); print ''; } } @@ -205,10 +206,10 @@ if (!empty($conf->banque->enabled)) { if (!empty($conf->stock->enabled)) { print ''; // Force warehouse (this is not a default value) print ''; print ''; // Numbering module -if ($conf->global->TAKEPOS_ADDON == "terminal") { +if (getDolGlobalString('TAKEPOS_ADDON') == "terminal") { print ''; @@ -395,7 +396,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor($variablename, $conf->global->{$variablename}, '', 80, 'dolibarr_notes'); + $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''; From 4543aeeff04ac999b0915a243024cebef05d34a4 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 27 Aug 2022 08:19:49 +0200 Subject: [PATCH 6/8] PHP8 Warnings --- htdocs/takepos/pay.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 40d873654c6..a1b01867a3f 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -425,7 +425,7 @@ while ($i < count($arrayOfValidPaymentModes)) { } $keyforsumupbank = "CASHDESK_ID_BANKACCOUNT_SUMUP".$_SESSION["takeposterminal"]; -if ($conf->global->TAKEPOS_ENABLE_SUMUP) { +if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) { if (!empty($conf->global->$keyforsumupbank)) { print ''; } else { From 375f400565da72d9cf0a4f80abf94cfc36582c1d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 27 Aug 2022 08:28:39 +0200 Subject: [PATCH 7/8] PHP8 Warnings --- htdocs/takepos/admin/receipt.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 6c390aabe73..47a23262b3b 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -118,14 +118,14 @@ print $langs->trans('DolibarrReceiptPrinter'); print '\n"; -if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { +if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector" && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) { print '\n"; } -if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { +if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) { print ''; - $texte .= ''; + $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; @@ -121,12 +121,12 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos */ public function getNextValue($objsoc = null, $invoice = null, $mode = 'next') { - global $db, $conf; + global $db; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // On defini critere recherche compteur - $mask = $conf->global->TAKEPOS_REF_UNIVERSAL_MASK; + $mask = getDolGlobalString('TAKEPOS_REF_UNIVERSAL_MASK'); if (!$mask) { $this->error = 'NotConfigured'; @@ -136,9 +136,10 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos // Get entities $entity = getEntity('invoicenumber', 1, $invoice); + $date = (empty($invoice->date) ? dol_now() : $invoice->date); $pos_source = is_object($invoice) && $invoice->pos_source > 0 ? $invoice->pos_source : 0; $mask = str_replace('{TN}', $pos_source, $mask); - $numFinal = get_next_value($db, $mask, 'facture', 'ref', '', $objsoc, $invoice->date, $mode, false, null, $entity); + $numFinal = get_next_value($db, $mask, 'facture', 'ref', '', $objsoc, $date, $mode, false, null, $entity); return $numFinal; } diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index a7a3183fa33..cfa4e281e06 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -196,8 +196,8 @@ foreach ($dirmodels as $reldir) { } print ''."\n"; - print '\n";
'.$langs->trans("Name")."'.$langs->trans("Description")."'.$langs->trans("Example")."'.$langs->trans("Status").''.$langs->trans("ShortInfo").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
'.$langs->trans("CashDeskThirdPartyForSell").''; -print $form->select_company($conf->global->{'CASHDESK_ID_THIRDPARTY'.$terminaltouse}, 'socid', '(s.client IN (1, 3) AND s.status = 1)', 1, 0, 0, array(), 0); +print $form->select_company(getDolGlobalInt('CASHDESK_ID_THIRDPARTY'.$terminaltouse), 'socid', '(s.client IN (1, 3) AND s.status = 1)', 1, 0, 0, array(), 0); print '
'.$langs->trans("CashDeskBankAccountForSell").''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); - $form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 0, "courant=2", 1); - if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse})) { + $form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 0, "courant=2", 1); + if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse)) { $atleastonefound++; } print '
'.$langs->trans("CashDeskBankAccountForCheque").''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); - $form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 0, "courant=1", 1); - if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse})) { + $form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 0, "courant=1", 1); + if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse)) { $atleastonefound++; } print '
'.$langs->trans("CashDeskBankAccountForCB").''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); - $form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 0, "courant=1", 1); - if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse})) { + $form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 0, "courant=1", 1); + if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse)) { $atleastonefound++; } print '
'.$langs->trans("CashDeskBankAccountForSumup").''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); - $form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 0, "courant=1", 1); - if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse})) { + $form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 0, "courant=1", 1); + if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse)) { $atleastonefound++; } print '
'.$langs->trans("CashDeskDoNotDecreaseStock").''; - if (empty($conf->productbatch->enabled) || !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) { - print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}, 1); + if (empty($conf->productbatch->enabled) || getDolGlobalInt('CASHDESK_FORCE_DECREASE_STOCK')) { + print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, getDolGlobalInt('CASHDESK_NO_DECREASE_STOCK'.$terminal), 1); } else { - if (!$conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}) { + if (getDolGlobalInt('CASHDESK_NO_DECREASE_STOCK'.$terminal)) { $res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminal, 1, 'chaine', 0, '', $conf->entity); } print $langs->trans("Yes").'
'; @@ -286,11 +287,11 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" || $conf->global->TA print '
'.$langs->trans('CashDeskReaderKeyCodeForEnter').''; -print ''; +print ''; print '
'; print $langs->trans("BillsNumberingModule"); print ''; @@ -379,7 +380,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor($variablename, $conf->global->{$variablename}, '', 80, 'dolibarr_notes'); + $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print '
'; print $langs->trans('ReceiptPrinterMethodDescription'); if ($conf->receiptprinter->enabled) { - if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { + if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { print '
'; print img_picto('', 'printer', 'class="paddingright"').''.$langs->trans("Setup").''; } } print '
'; if ($conf->receiptprinter->enabled) { - if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { + if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; @@ -146,7 +146,7 @@ print $langs->trans('TakeposConnectorMethodDescription'); if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { print '
'; print $langs->trans("URL")." / ".$langs->trans("IPAddress").' ('.$langs->trans("TakeposConnectorNecesary").')'; - print ' '; + print ' '; } print '
'; @@ -245,7 +245,7 @@ print ''; print ajax_constantonoff("TAKEPOS_SHOW_HT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0); print "
'; print $langs->trans('WeighingScale'); print ''; @@ -253,7 +253,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($con print "
'; print $langs->trans('CustomerDisplay'); print ''; From 4470a78c6eea6490ac9bc8ffe536ca1c089d8802 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 28 Aug 2022 05:17:43 +0200 Subject: [PATCH 8/8] PHP8 Warnings --- .../modules/takepos/mod_takepos_ref_universal.php | 15 ++++++++------- htdocs/takepos/admin/setup.php | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php index 7e46c10a341..5d35bfd1214 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php @@ -57,11 +57,11 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos */ public function info() { - global $conf, $langs; + global $db, $langs; $langs->load('cashdesk@cashdesk'); - $form = new Form($this->db); + $form = new Form($db); $texte = $langs->trans('GenericNumRefModelDesc')."
\n"; $texte .= '
'; @@ -79,9 +79,9 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos // Parametrage du prefix $texte .= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'   
'; - if ($conf->global->TAKEPOS_REF_ADDON == "$file") { + print ''; + if (getDolGlobalString('TAKEPOS_REF_ADDON') == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''; @@ -277,7 +277,7 @@ if (!empty($conf->service->enabled)) { print '
'; print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc")); print ''; -print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_ROOT_CATEGORY_ID, 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0); +print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID'), 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0); print ajax_combobox('TAKEPOS_ROOT_CATEGORY_ID'); print "