From b7280f652414fb41a3d35880c30f0db489ff4389 Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Thu, 8 Apr 2021 15:15:58 +0200 Subject: [PATCH] product masks are relevant only if we are in advanced mode --- htdocs/product/admin/product_lot.php | 120 ++++++++++++++------------- 1 file changed, 62 insertions(+), 58 deletions(-) diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php index 2ae8ef9810e..874f4b9e8a9 100644 --- a/htdocs/product/admin/product_lot.php +++ b/htdocs/product/admin/product_lot.php @@ -182,38 +182,40 @@ foreach ($dirmodels as $reldir) { } } closedir($handle); - print 'Option'."\n"; - print $langs->trans('CustomMasks'); - print ''; + if ($conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') { + print 'Option'."\n"; + print $langs->trans('CustomMasks'); + print ''; - // Show example of numbering model - print ''; - $tmp = 'NoExample'; - if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); - else print $langs->trans($tmp); - print ''."\n"; + // Show example of numbering model + print ''; + $tmp = 'NoExample'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; + elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + else print $langs->trans($tmp); + print ''."\n"; - print ''; - if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; + print ''; + if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; + + // Info + $htmltooltip = $langs->trans("LotProductTooltip"); + + print ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print ''; + + print "\n"; } - print ''; - - // Info - $htmltooltip = $langs->trans("LotProductTooltip"); - - print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); - print ''; - - print "\n"; } } } @@ -306,38 +308,40 @@ foreach ($dirmodels as $reldir) { } } closedir($handle); - print 'Option'."\n"; - print $langs->trans('CustomMasks'); - print ''; + if ($conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced') { + print 'Option'."\n"; + print $langs->trans('CustomMasks'); + print ''; - // Show example of numbering model - print ''; - $tmp = 'NoExample'; - if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); - else print $langs->trans($tmp); - print ''."\n"; + // Show example of numbering model + print ''; + $tmp = 'NoExample'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; + elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + else print $langs->trans($tmp); + print ''."\n"; - print ''; - if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; + print ''; + if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; + + // Info + $htmltooltip = $langs->trans("SNProductTooltip"); + + print ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print ''; + + print "\n"; } - print ''; - - // Info - $htmltooltip = $langs->trans("SNProductTooltip"); - - print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); - print ''; - - print "\n"; } } }