FIX|Fix #Hide mandatory DLC/DLUO options when disabled in product configuration (#34790)
* Hide DLC/DLUO mandatory options in product form when disabled by configuration * fix using constant * Update card.php --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
parent
0a40502fae
commit
5d22b46c68
1 changed files with 12 additions and 0 deletions
|
|
@ -1330,6 +1330,18 @@ if (isModEnabled('accounting')) {
|
|||
$sellOrEatByMandatoryList = null;
|
||||
if (isModEnabled('productbatch')) {
|
||||
$sellOrEatByMandatoryList = Product::getSellOrEatByMandatoryList();
|
||||
|
||||
$disableSellBy = getDolGlobalString('PRODUCT_DISABLE_SELLBY');
|
||||
$disableEatBy = getDolGlobalString('PRODUCT_DISABLE_EATBY');
|
||||
|
||||
if ($disableSellBy) {
|
||||
unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_BY]);
|
||||
unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT]);
|
||||
}
|
||||
if ($disableEatBy) {
|
||||
unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_EAT_BY]);
|
||||
unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT]);
|
||||
}
|
||||
}
|
||||
|
||||
$title = $langs->trans('ProductServiceCard');
|
||||
|
|
|
|||
Loading…
Reference in a new issue