qual: use getDolGlobalString() for product/list.php (#30111)

* qual: use getDolGlobalString() for product/list.php

* fix phan warning

Avoid function calls in a FOR loop test part
This commit is contained in:
thibdrev 2024-06-22 19:30:35 +02:00 committed by GitHub
parent 162fc23c6f
commit ded570e23a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -208,9 +208,9 @@ if (isModEnabled('barcode')) {
$fieldstosearchall['p.barcode'] = 'Gencod';
$fieldstosearchall['pfp.barcode'] = 'GencodBuyPrice';
}
// Personalized search criteria. Example: $conf->global->PRODUCT_QUICKSEARCH_ON_FIELDS = 'p.ref=ProductRef;p.label=ProductLabel;p.description=Description;p.note=Note;'
// Personalized search criteria. Example: getDolGlobalString('PRODUCT_QUICKSEARCH_ON_FIELDS') = 'p.ref=ProductRef;p.label=ProductLabel;p.description=Description;p.note=Note;'
if (getDolGlobalString('PRODUCT_QUICKSEARCH_ON_FIELDS')) {
$fieldstosearchall = dolExplodeIntoArray($conf->global->PRODUCT_QUICKSEARCH_ON_FIELDS);
$fieldstosearchall = dolExplodeIntoArray(getDolGlobalString('PRODUCT_QUICKSEARCH_ON_FIELDS'));
}
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
@ -293,10 +293,11 @@ $arrayfields = array(
// MultiPrices
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
$produit_multiprices_limit = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT');
for ($i = 1; $i <= $produit_multiprices_limit; $i++) {
$keyforlabel = 'PRODUIT_MULTIPRICES_LABEL'.$i;
if (!empty($conf->global->$keyforlabel)) {
$labelp = $i.' - '.$langs->transnoentitiesnoconv($conf->global->$keyforlabel);
if (!empty(getDolGlobalString('$keyforlabel'))) {
$labelp = $i.' - '.$langs->transnoentitiesnoconv(getDolGlobalString('$keyforlabel'));
} else {
$labelp = $langs->transnoentitiesnoconv("SellingPrice")." ".$i;
}