diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php
index d1b87bf0b14..79e64940d8f 100644
--- a/htdocs/product/admin/product_lot.php
+++ b/htdocs/product/admin/product_lot.php
@@ -72,6 +72,12 @@ if ($action == 'updateMaskLot') {
dolibarr_set_const($db, "PRODUCTBATCH_LOT_ADDON", $value, 'chaine', 0, '', $conf->entity);
} elseif ($action == 'setmodsn') {
dolibarr_set_const($db, "PRODUCTBATCH_SN_ADDON", $value, 'chaine', 0, '', $conf->entity);
+}
+if ($action == 'setmaskslot') {
+ dolibarr_set_const($db, "PRODUCTBATCH_LOT_USE_PRODUCT_MASKS", $value, 'chaine', 0, '', $conf->entity);
+}
+if ($action == 'setmaskssn') {
+ dolibarr_set_const($db, "PRODUCTBATCH_SN_USE_PRODUCT_MASKS", $value, 'chaine', 0, '', $conf->entity);
}
/*
@@ -176,6 +182,50 @@ foreach ($dirmodels as $reldir) {
}
}
closedir($handle);
+ print '
| lot_product | '."\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";
+
+ print '';
+ if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS == 'true') {
+ print '';
+ print img_picto($langs->trans("Activated"), 'switch_on');
+ print '';
+ } else {
+ print '';
+ print img_picto($langs->trans("Disabled"), 'switch_off');
+ print '';
+ }
+ print ' | ';
+
+ // Info
+ $htmltooltip = '';
+ $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
';
+ $nextval = $module->getNextValue($mysoc, $batch);
+ if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
+ $htmltooltip .= ''.$langs->trans("NextValue").': ';
+ if ($nextval) {
+ if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured')
+ $nextval = $langs->trans($nextval);
+ $htmltooltip .= $nextval.'
';
+ } else {
+ $htmltooltip .= $langs->trans($module->error).'
';
+ }
+ }
+
+ print '';
+ print $form->textwithpicto('', $htmltooltip, 1, 0);
+ print ' | ';
+
+ print "
\n";
}
}
}
@@ -268,6 +318,50 @@ foreach ($dirmodels as $reldir) {
}
}
closedir($handle);
+ print '| sn_product | '."\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";
+
+ print '';
+ if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS == 'true') {
+ print '';
+ print img_picto($langs->trans("Activated"), 'switch_on');
+ print '';
+ } else {
+ print '';
+ print img_picto($langs->trans("Disabled"), 'switch_off');
+ print '';
+ }
+ print ' | ';
+
+ // Info
+ $htmltooltip = '';
+ $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
';
+ $nextval = $module->getNextValue($mysoc, $batch);
+ if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
+ $htmltooltip .= ''.$langs->trans("NextValue").': ';
+ if ($nextval) {
+ if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured')
+ $nextval = $langs->trans($nextval);
+ $htmltooltip .= $nextval.'
';
+ } else {
+ $htmltooltip .= $langs->trans($module->error).'
';
+ }
+ }
+
+ print '';
+ print $form->textwithpicto('', $htmltooltip, 1, 0);
+ print ' | ';
+
+ print "
\n";
}
}
}