| ';
print $langs->trans('CustomerDisplay');
print ' | ';
diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php
index 849c5c56481..cfa4e281e06 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
@@ -78,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);
}
@@ -142,13 +143,13 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
print load_fiche_titre($langs->trans('CashDeskRefNumberingModules'), '', '');
-print '';
+print '';
print '';
print '| '.$langs->trans("Name")." | \n";
print ''.$langs->trans("Description")." | \n";
print ''.$langs->trans("Example")." | \n";
-print ''.$langs->trans("Status").' | ';
-print ''.$langs->trans("ShortInfo").' | ';
+print ''.$langs->trans("Status").' | ';
+print ''.$langs->trans("ShortInfo").' | ';
print ' '."\n";
clearstatcache();
@@ -195,8 +196,8 @@ foreach ($dirmodels as $reldir) {
}
print ''."\n";
- print '';
- if ($conf->global->TAKEPOS_REF_ADDON == "$file") {
+ print ' | ';
+ if (getDolGlobalString('TAKEPOS_REF_ADDON') == "$file") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
print '';
@@ -276,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 " | \n";
@@ -458,7 +459,7 @@ print '';
// Sumup options
-if ($conf->global->TAKEPOS_ENABLE_SUMUP) {
+if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
print ' ';
print '';
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 '| '.$langs->trans("CashDeskThirdPartyForSell").' | ';
print '';
-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 ' | ';
$atleastonefound = 0;
@@ -153,33 +154,33 @@ if (!empty($conf->banque->enabled)) {
print '| '.$langs->trans("CashDeskBankAccountForSell").' | ';
print '';
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 ' | ';
print '| '.$langs->trans("CashDeskBankAccountForCheque").' | ';
print '';
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 ' | ';
print '| '.$langs->trans("CashDeskBankAccountForCB").' | ';
print '';
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 ' | ';
- if ($conf->global->TAKEPOS_ENABLE_SUMUP) {
+ if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
print '| '.$langs->trans("CashDeskBankAccountForSumup").' | ';
print '';
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 ' | ';
@@ -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 '| '.$langs->trans("CashDeskDoNotDecreaseStock").' | '; // Force warehouse (this is not a default value)
print '';
- 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 ' | ';
// Numbering module
-if ($conf->global->TAKEPOS_ADDON == "terminal") {
+if (getDolGlobalString('TAKEPOS_ADDON') == "terminal") {
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 ' | ';
@@ -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 '';
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 {
|