Clean code

This commit is contained in:
Laurent Destailleur 2024-06-28 18:18:57 +02:00
parent de4ebc34cc
commit 5ddf992838
4 changed files with 4 additions and 4 deletions

View File

@ -233,7 +233,7 @@ if (isModEnabled('product')) {
print '</td>';
print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";
if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM') && $conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") {
if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM') == "$file") {
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&token='.newToken().'&amp;value='.urlencode($file).'">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';

View File

@ -184,7 +184,7 @@ if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
if (preg_match('/^mod_barcode_product_.*php$/', $file)) {
$file = substr($file, 0, dol_strlen($file) - 4);
if ($file == $conf->global->BARCODE_PRODUCT_ADDON_NUM) {
if ($file == getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
try {
dol_include_once($dirroot.$file.'.php');
} catch (Exception $e) {

View File

@ -1279,7 +1279,7 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-card');
// Load object modBarCodeProduct
$res = 0;
if (isModEnabled('barcode') && getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
$module = strtolower($conf->global->BARCODE_PRODUCT_ADDON_NUM);
$module = strtolower(getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM'));
$dirbarcode = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
foreach ($dirbarcode as $dirroot) {
$res = dol_include_once($dirroot.$module.'.php');

View File

@ -1036,7 +1036,7 @@ class Product extends CommonObject
// phpcs:enable
global $conf;
if (isModEnabled('barcode') && getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
$module = strtolower($conf->global->BARCODE_PRODUCT_ADDON_NUM);
$module = strtolower(getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM'));
$dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
foreach ($dirsociete as $dirroot) {