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)) {
|
if (!isModEnabled('facture') || empty($user->rights->facture->lire)) {
|
||||||
$showinvoicenb = 0;
|
$showinvoicenb = 0;
|
||||||
}
|
}
|
||||||
if (empty($conf->propal->enabled) || empty($user->rights->propale->lire)) {
|
if (isModEnabled('propal') || empty($user->rights->propale->lire)) {
|
||||||
$showpropalnb = 0;
|
$showpropalnb = 0;
|
||||||
}
|
}
|
||||||
if (empty($conf->commande->enabled) || empty($user->rights->commande->lire)) {
|
if (!isModEnabled('commande') || empty($user->rights->commande->lire)) {
|
||||||
$showordernb = 0;
|
$showordernb = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3550,7 +3550,7 @@ abstract class CommonObject
|
|||||||
if (!empty($conf->global->$MODULE)) {
|
if (!empty($conf->global->$MODULE)) {
|
||||||
$modsactivated = explode(',', $conf->global->$MODULE);
|
$modsactivated = explode(',', $conf->global->$MODULE);
|
||||||
foreach ($modsactivated as $mod) {
|
foreach ($modsactivated as $mod) {
|
||||||
if ($conf->$mod->enabled) {
|
if (!isModEnabled($mod->enabled) {
|
||||||
return 1; // update was disabled by specific setup
|
return 1; // update was disabled by specific setup
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4883,7 +4883,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
// Define usemargins
|
// Define usemargins
|
||||||
$usemargins = 0;
|
$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;
|
$usemargins = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -164,7 +164,7 @@ class Utils
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update cachenbofdoc
|
// Update cachenbofdoc
|
||||||
if (!empty($conf->ecm->enabled) && $choice == 'allfiles') {
|
if (isModEnabled('ecm') && $choice == 'allfiles') {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
|
||||||
$ecmdirstatic = new EcmDirectory($this->db);
|
$ecmdirstatic = new EcmDirectory($this->db);
|
||||||
$result = $ecmdirstatic->refreshcachenboffile(1);
|
$result = $ecmdirstatic->refreshcachenboffile(1);
|
||||||
|
|||||||
@ -60,9 +60,9 @@ function product_prepare_head($object)
|
|||||||
$h++;
|
$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)
|
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) {
|
if ($usercancreadprice) {
|
||||||
$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id;
|
$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) {
|
if (is_object($mysoc) && $usenpr) {
|
||||||
$this->export_fields_array[$r]['p.recuperableonly'] = 'NPR';
|
$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'));
|
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice'));
|
||||||
}
|
}
|
||||||
if (isModEnabled('stock')) {
|
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'));
|
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.cost_price'=>'CostPrice'));
|
||||||
}
|
}
|
||||||
if (is_object($mysoc) && $usenpr) {
|
if (is_object($mysoc) && $usenpr) {
|
||||||
@ -718,7 +718,7 @@ class modProduct extends DolibarrModules
|
|||||||
'p.desiredstock' => ''
|
'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'));
|
$import_sample = array_merge($import_sample, array('p.cost_price'=>'90'));
|
||||||
}
|
}
|
||||||
if (is_object($mysoc) && $usenpr) {
|
if (is_object($mysoc) && $usenpr) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user