product masks are relevant only if we are in advanced mode

This commit is contained in:
altairis-noe 2021-04-08 15:15:58 +02:00
parent c5a0bc1f52
commit b7280f6524

View File

@ -182,38 +182,40 @@ foreach ($dirmodels as $reldir) {
}
}
closedir($handle);
print '<tr class="oddeven"><td>Option</td><td>'."\n";
print $langs->trans('CustomMasks');
print '</td>';
if ($conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') {
print '<tr class="oddeven"><td>Option</td><td>'."\n";
print $langs->trans('CustomMasks');
print '</td>';
// Show example of numbering model
print '<td class="nowrap">';
$tmp = 'NoExample';
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
else print $langs->trans($tmp);
print '</td>'."\n";
// Show example of numbering model
print '<td class="nowrap">';
$tmp = 'NoExample';
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
else print $langs->trans($tmp);
print '</td>'."\n";
print '<td class="center">';
if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmaskslot&amp;value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a>';
} else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmaskslot&amp;value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
print '<td class="center">';
if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmaskslot&amp;value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a>';
} else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmaskslot&amp;value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
}
print '</td>';
// Info
$htmltooltip = $langs->trans("LotProductTooltip");
print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>';
print "</tr>\n";
}
print '</td>';
// Info
$htmltooltip = $langs->trans("LotProductTooltip");
print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>';
print "</tr>\n";
}
}
}
@ -306,38 +308,40 @@ foreach ($dirmodels as $reldir) {
}
}
closedir($handle);
print '<tr class="oddeven"><td>Option</td><td>'."\n";
print $langs->trans('CustomMasks');
print '</td>';
if ($conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced') {
print '<tr class="oddeven"><td>Option</td><td>'."\n";
print $langs->trans('CustomMasks');
print '</td>';
// Show example of numbering model
print '<td class="nowrap">';
$tmp = 'NoExample';
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
else print $langs->trans($tmp);
print '</td>'."\n";
// Show example of numbering model
print '<td class="nowrap">';
$tmp = 'NoExample';
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
else print $langs->trans($tmp);
print '</td>'."\n";
print '<td class="center">';
if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmaskssn&amp;value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a>';
} else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmaskssn&amp;value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
print '<td class="center">';
if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmaskssn&amp;value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a>';
} else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmaskssn&amp;value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
}
print '</td>';
// Info
$htmltooltip = $langs->trans("SNProductTooltip");
print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>';
print "</tr>\n";
}
print '</td>';
// Info
$htmltooltip = $langs->trans("SNProductTooltip");
print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>';
print "</tr>\n";
}
}
}