Use isModEnabled

This commit is contained in:
Alexandre SPANGARO
2022-09-25 06:22:58 +02:00
parent e707f1c03c
commit b3d156728b
5 changed files with 7 additions and 7 deletions

View File

@@ -133,7 +133,7 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION'=>array(
'family'=>'classify_supplier_order',
'position'=>63,
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))),
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order'))),
'picto'=>'supplier_order',
'warning'=>''
),
@@ -141,7 +141,7 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED'=>array(
'family'=>'classify_supplier_order',
'position'=>64,
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))),
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order'))),
'picto'=>'supplier_order',
'warning'=>''
),

View File

@@ -1026,7 +1026,7 @@ class FormCompany extends Form
public function selectProspectCustomerType($selected, $htmlname = 'client', $htmlidname = 'customerprospect', $typeinput = 'form', $morecss = '', $allowempty = '')
{
global $conf, $langs;
if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->fournisseur->enabled)) {
if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && !isModEnabled('fournisseur')) {
return '' ;
}

View File

@@ -162,7 +162,7 @@ class modBanque extends DolibarrModules
"s.nom"=>"company", "s.code_compta"=>"company", "s.code_compta_fournisseur"=>"company"
);
$this->export_special_array[$r] = array('-b.amount'=>'NULLIFNEG', 'b.amount'=>'NULLIFNEG');
if ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled) || empty($conf->supplier_invoice->enabled)) {
if ((!isModEnabled('fournisseur') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order') || !isModEnabled('supplier_invoice')) {
unset($this->export_fields_array[$r]['s.code_compta_fournisseur']);
unset($this->export_entities_array[$r]['s.code_compta_fournisseur']);
}

View File

@@ -413,7 +413,7 @@ class modSociete extends DolibarrModules
't.libelle'=>"company",
's.entity'=>'company',
); // We define here only fields that use another picto
if (empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
if (!isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
unset($this->export_fields_array[$r]['s.code_fournisseur']);
unset($this->export_entities_array[$r]['s.code_fournisseur']);
}

View File

@@ -135,9 +135,9 @@ class InterfaceNotification extends DolibarrTriggers
$element = $obj->elementtype;
// Exclude events if related module is disabled
if ($element == 'order_supplier' && ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))) {
if ($element == 'order_supplier' && ((!isModEnabled('fournisseur') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order'))) {
$qualified = 0;
} elseif ($element == 'invoice_supplier' && ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_invoice->enabled))) {
} elseif ($element == 'invoice_supplier' && ((!isModEnabled('fournisseur') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_invoice'))) {
$qualified = 0;
} elseif ($element == 'withdraw' && empty($conf->prelevement->enabled)) {
$qualified = 0;