mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Use isModEnabled
This commit is contained in:
parent
ef94f2af70
commit
70e313f16e
|
|
@ -110,10 +110,10 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
if (!isModEnabled('facture') || empty($user->rights->facture->lire)) {
|
||||
$showinvoicenb = 0;
|
||||
}
|
||||
if (empty($conf->propal->enabled) || empty($user->rights->propale->lire)) {
|
||||
if (isModEnabled('propal') || empty($user->rights->propale->lire)) {
|
||||
$showpropalnb = 0;
|
||||
}
|
||||
if (empty($conf->commande->enabled) || empty($user->rights->commande->lire)) {
|
||||
if (!isModEnabled('commande') || empty($user->rights->commande->lire)) {
|
||||
$showordernb = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3550,7 +3550,7 @@ abstract class CommonObject
|
|||
if (!empty($conf->global->$MODULE)) {
|
||||
$modsactivated = explode(',', $conf->global->$MODULE);
|
||||
foreach ($modsactivated as $mod) {
|
||||
if ($conf->$mod->enabled) {
|
||||
if (!isModEnabled($mod->enabled) {
|
||||
return 1; // update was disabled by specific setup
|
||||
}
|
||||
}
|
||||
|
|
@ -4883,7 +4883,7 @@ abstract class CommonObject
|
|||
|
||||
// Define usemargins
|
||||
$usemargins = 0;
|
||||
if (!empty($conf->margin->enabled) && !empty($this->element) && in_array($this->element, array('facture', 'facturerec', 'propal', 'commande'))) {
|
||||
if (isModEnabled('margin') && !empty($this->element) && in_array($this->element, array('facture', 'facturerec', 'propal', 'commande'))) {
|
||||
$usemargins = 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ class Utils
|
|||
}
|
||||
|
||||
// Update cachenbofdoc
|
||||
if (!empty($conf->ecm->enabled) && $choice == 'allfiles') {
|
||||
if (isModEnabled('ecm') && $choice == 'allfiles') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
|
||||
$ecmdirstatic = new EcmDirectory($this->db);
|
||||
$result = $ecmdirstatic->refreshcachenboffile(1);
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@ function product_prepare_head($object)
|
|||
$h++;
|
||||
}
|
||||
|
||||
if (!empty($object->status_buy) || (!empty($conf->margin->enabled) && !empty($object->status))) { // If margin is on and product on sell, we may need the cost price even if product os not on purchase
|
||||
if (!empty($object->status_buy) || (isModEnabled('margin') && !empty($object->status))) { // If margin is on and product on sell, we may need the cost price even if product os not on purchase
|
||||
if ((((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $user->rights->fournisseur->lire)
|
||||
|| (!empty($conf->margin->enabled) && $user->rights->margin->liretous)
|
||||
|| (isModEnabled('margin') && $user->rights->margin->liretous)
|
||||
) {
|
||||
if ($usercancreadprice) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id;
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ class modProduct extends DolibarrModules
|
|||
if (is_object($mysoc) && $usenpr) {
|
||||
$this->export_fields_array[$r]['p.recuperableonly'] = 'NPR';
|
||||
}
|
||||
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") || !empty($conf->margin->enabled)) {
|
||||
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") || isModEnabled('margin')) {
|
||||
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice'));
|
||||
}
|
||||
if (isModEnabled('stock')) {
|
||||
|
|
@ -625,7 +625,7 @@ class modProduct extends DolibarrModules
|
|||
));
|
||||
}
|
||||
|
||||
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") || !empty($conf->margin->enabled)) {
|
||||
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") || isModEnabled('margin')) {
|
||||
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.cost_price'=>'CostPrice'));
|
||||
}
|
||||
if (is_object($mysoc) && $usenpr) {
|
||||
|
|
@ -718,7 +718,7 @@ class modProduct extends DolibarrModules
|
|||
'p.desiredstock' => ''
|
||||
));
|
||||
}
|
||||
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") || !empty($conf->margin->enabled)) {
|
||||
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") || isModEnabled('margin')) {
|
||||
$import_sample = array_merge($import_sample, array('p.cost_price'=>'90'));
|
||||
}
|
||||
if (is_object($mysoc) && $usenpr) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user