';
@@ -2113,7 +2113,7 @@ if ($action == 'create' && $usercancreate) {
// It may also break step of creating an order when invoicing must be done from proposals and not from orders
$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
- if (!empty($deposit_percent_from_payment_terms) && !empty($conf->facture->enabled) && !empty($user->rights->facture->creer)) {
+ if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer)) {
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
$object->fetchObjectLinked();
@@ -2610,7 +2610,7 @@ if ($action == 'create' && $usercancreate) {
// TODO How record was recorded OrderMode (llx_c_input_method)
// Incoterms
- if (!empty($conf->incoterm->enabled)) {
+ if (isModEnabled('incoterm')) {
print '
';
$editenable = $usercancreate;
print $form->editfieldkey("IncotermLabel", 'incoterm', '', $object, $editenable);
@@ -2697,7 +2697,7 @@ if ($action == 'create' && $usercancreate) {
print '';
// Margin Infos
- if (!empty($conf->margin->enabled)) {
+ if (isModEnabled('margin')) {
$formmargin->displayMarginInfos($object);
}
@@ -2809,7 +2809,7 @@ if ($action == 'create' && $usercancreate) {
print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=modif&token='.newToken().'&id='.$object->id, '');
}
// Create event
- /*if ($conf->agenda->enabled && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD))
+ /*if (isModEnabled('agenda') && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD))
{
// Add hidden condition because this is not a
// "workflow" action so should appears somewhere else on
@@ -2937,7 +2937,7 @@ if ($action == 'create' && $usercancreate) {
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, $compatibleImportElementsList);
// Show online payment link
- $useonlinepayment = (!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled));
+ $useonlinepayment = (isModEnabled('paypal') || isModEnabled('stripe') || isModEnabled('paybox'));
if (!empty($conf->global->ORDER_HIDE_ONLINE_PAYMENT_ON_ORDER)) {
$useonlinepayment = 0;
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 7913c1d1ef7..50ce856dec2 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1105,7 +1105,7 @@ class Form
// If product & services are enabled or both disabled.
if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service"))
- || (empty($forceall) && empty($conf->product->enabled) && empty($conf->service->enabled))) {
+ || (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) {
if (empty($hidetext)) {
print $langs->trans("Type").': ';
}
@@ -1134,11 +1134,11 @@ class Form
print ajax_combobox('select_'.$htmlname);
//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
}
- if ((empty($forceall) && empty($conf->product->enabled) && isModEnabled("service")) || $forceall == 3) {
+ if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
print $langs->trans("Service");
print '';
}
- if ((empty($forceall) && isModEnabled("product") && empty($conf->service->enabled)) || $forceall == 2) {
+ if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
print $langs->trans("Product");
print '';
}
@@ -2280,9 +2280,9 @@ class Form
}
if (strval($filtertype) === '' && (isModEnabled("product") || isModEnabled("service"))) {
- if (isModEnabled("product") && empty($conf->service->enabled)) {
+ if (isModEnabled("product") && !isModEnabled('service')) {
$filtertype = '0';
- } elseif (empty($conf->product->enabled) && isModEnabled("service")) {
+ } elseif (!isModEnabled('product') && isModEnabled("service")) {
$filtertype = '1';
}
}
@@ -2299,9 +2299,9 @@ class Form
}
// handle case where product or service module is disabled + no filter specified
if ($filtertype == '') {
- if (empty($conf->product->enabled)) { // when product module is disabled, show services only
+ if (!isModEnabled('product')) { // when product module is disabled, show services only
$filtertype = 1;
- } elseif (empty($conf->service->enabled)) { // when service module is disabled, show products only
+ } elseif (!isModEnabled('service')) { // when service module is disabled, show products only
$filtertype = 0;
}
}
@@ -2647,9 +2647,9 @@ class Form
// Filter by product type
if (strval($filtertype) != '') {
$sql .= " AND p.fk_product_type = ".((int) $filtertype);
- } elseif (empty($conf->product->enabled)) { // when product module is disabled, show services only
+ } elseif (!isModEnabled('product')) { // when product module is disabled, show services only
$sql .= " AND p.fk_product_type = 1";
- } elseif (empty($conf->service->enabled)) { // when service module is disabled, show products only
+ } elseif (!isModEnabled('service')) { // when service module is disabled, show products only
$sql .= " AND p.fk_product_type = 0";
}
// Add where from hooks
@@ -2795,7 +2795,7 @@ class Form
}
}
} else {
- if (!empty($conf->dynamicprices->enabled) && !empty($objp->fk_price_expression)) {
+ if (isModEnabled('dynamicprices') && !empty($objp->fk_price_expression)) {
$price_product = new Product($this->db);
$price_product->fetch($objp->rowid, '', '', 1);
$priceparser = new PriceParser($this->db);
@@ -3424,7 +3424,7 @@ class Form
if (!empty($objp->idprodfournprice)) {
$outqty = $objp->quantity;
$outdiscount = $objp->remise_percent;
- if (!empty($conf->dynamicprices->enabled) && !empty($objp->fk_supplier_price_expression)) {
+ if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
$prod_supplier = new ProductFournisseur($this->db);
$prod_supplier->product_fourn_price_id = $objp->idprodfournprice;
$prod_supplier->id = $objp->fk_product;
@@ -3649,7 +3649,7 @@ class Form
}
$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
- if (!empty($conf->dynamicprices->enabled) && !empty($objp->fk_supplier_price_expression)) {
+ if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
$prod_supplier = new ProductFournisseur($this->db);
$prod_supplier->product_fourn_price_id = $objp->idprodfournprice;
$prod_supplier->id = $productid;
@@ -8590,26 +8590,26 @@ class Form
}
} elseif ($objecttype == 'propal') {
$tplpath = 'comm/'.$element;
- if (empty($conf->propal->enabled)) {
+ if (!isModEnabled('propal')) {
continue; // Do not show if module disabled
}
} elseif ($objecttype == 'supplier_proposal') {
- if (empty($conf->supplier_proposal->enabled)) {
+ if (!isModEnabled('supplier_proposal')) {
continue; // Do not show if module disabled
}
} elseif ($objecttype == 'shipping' || $objecttype == 'shipment' || $objecttype == 'expedition') {
$tplpath = 'expedition';
- if (empty($conf->expedition->enabled)) {
+ if (!isModEnabled('expedition')) {
continue; // Do not show if module disabled
}
} elseif ($objecttype == 'reception') {
$tplpath = 'reception';
- if (empty($conf->reception->enabled)) {
+ if (!isModEnabled('reception')) {
continue; // Do not show if module disabled
}
} elseif ($objecttype == 'delivery') {
$tplpath = 'delivery';
- if (empty($conf->expedition->enabled)) {
+ if (!isModEnabled('expedition')) {
continue; // Do not show if module disabled
}
} elseif ($objecttype == 'ficheinter') {
@@ -8631,7 +8631,7 @@ class Form
$tplpath = 'eventorganization';
} elseif ($objecttype == 'mo') {
$tplpath = 'mrp';
- if (empty($conf->mrp->enabled)) {
+ if (!isModEnabled('mrp')) {
continue; // Do not show if module disabled
}
}
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index 27fa6925e21..9d9ff5a463f 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -318,20 +318,20 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
$rowspan++; $sectionauto[] = array('position'=>20, 'level'=>1, 'module'=>'company', 'test'=>isModEnabled('societe'), 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
}
if (isModEnabled("propal")) {
- $rowspan++; $sectionauto[] = array('position'=>30, 'level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
+ $rowspan++; $sectionauto[] = array('position'=>30, 'level'=>1, 'module'=>'propal', 'test'=>isModEnabled('propal'), 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
}
if (isModEnabled('contrat')) {
- $rowspan++; $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
+ $rowspan++; $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contrat'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
}
if (isModEnabled('commande')) {
- $rowspan++; $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
+ $rowspan++; $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>isModEnabled('commande'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
}
if (isModEnabled('facture')) {
- $rowspan++; $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
+ $rowspan++; $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('facture'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
}
if (isModEnabled('supplier_proposal')) {
$langs->load("supplier_proposal");
- $rowspan++; $sectionauto[] = array('position'=>70, 'level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
+ $rowspan++; $sectionauto[] = array('position'=>70, 'level'=>1, 'module'=>'supplier_proposal', 'test'=>isModEnabled('supplier_proposal'), 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
}
if (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order")) {
$rowspan++; $sectionauto[] = array('position'=>80, 'level'=>1, 'module'=>'order_supplier', 'test'=>(isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order")), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders")));
@@ -341,12 +341,12 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
}
if (isModEnabled('tax')) {
$langs->load("compta");
- $rowspan++; $sectionauto[] = array('position'=>100, 'level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
- $rowspan++; $sectionauto[] = array('position'=>110, 'level'=>1, 'module'=>'tax-vat', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("VAT"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("VAT")));
+ $rowspan++; $sectionauto[] = array('position'=>100, 'level'=>1, 'module'=>'tax', 'test'=>isModEnabled('tax'), 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
+ $rowspan++; $sectionauto[] = array('position'=>110, 'level'=>1, 'module'=>'tax-vat', 'test'=>isModEnabled('tax'), 'label'=>$langs->trans("VAT"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("VAT")));
}
if (!empty($conf->salaries->enabled)) {
$langs->load("compta");
- $rowspan++; $sectionauto[] = array('position'=>120, 'level'=>1, 'module'=>'salaries', 'test'=>$conf->salaries->enabled, 'label'=>$langs->trans("Salaries"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Salaries")));
+ $rowspan++; $sectionauto[] = array('position'=>120, 'level'=>1, 'module'=>'salaries', 'test'=>isModEnabled('salaries'), 'label'=>$langs->trans("Salaries"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Salaries")));
}
if (isModEnabled('project')) {
$rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
@@ -354,28 +354,28 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
}
if (isModEnabled('ficheinter')) {
$langs->load("interventions");
- $rowspan++; $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
+ $rowspan++; $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('ficheinter'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
}
if (isModEnabled('expensereport')) {
$langs->load("trips");
- $rowspan++; $sectionauto[] = array('position'=>160, 'level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
+ $rowspan++; $sectionauto[] = array('position'=>160, 'level'=>1, 'module'=>'expensereport', 'test'=>isModEnabled('expensereport'), 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
}
if (isModEnabled('holiday')) {
$langs->load("holiday");
- $rowspan++; $sectionauto[] = array('position'=>170, 'level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays")));
+ $rowspan++; $sectionauto[] = array('position'=>170, 'level'=>1, 'module'=>'holiday', 'test'=>isModEnabled('holiday'), 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays")));
}
if (isModEnabled("banque")) {
$langs->load("banks");
- $rowspan++; $sectionauto[] = array('position'=>180, 'level'=>1, 'module'=>'banque', 'test'=>$conf->banque->enabled, 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount")));
- $rowspan++; $sectionauto[] = array('position'=>190, 'level'=>1, 'module'=>'chequereceipt', 'test'=>$conf->banque->enabled, 'label'=>$langs->trans("CheckReceipt"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("CheckReceipt")));
+ $rowspan++; $sectionauto[] = array('position'=>180, 'level'=>1, 'module'=>'banque', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount")));
+ $rowspan++; $sectionauto[] = array('position'=>190, 'level'=>1, 'module'=>'chequereceipt', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("CheckReceipt"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("CheckReceipt")));
}
- if (!empty($conf->mrp->enabled)) {
+ if (isModEnabled('mrp')) {
$langs->load("mrp");
- $rowspan++; $sectionauto[] = array('position'=>200, 'level'=>1, 'module'=>'mrp-mo', 'test'=>$conf->mrp->enabled, 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
+ $rowspan++; $sectionauto[] = array('position'=>200, 'level'=>1, 'module'=>'mrp-mo', 'test'=>isModEnabled('mrp'), 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
}
if (isModEnabled('recruitment')) {
$langs->load("recruitment");
- $rowspan++; $sectionauto[] = array('position'=>210, 'level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>$conf->recruitment->enabled, 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications")));
+ $rowspan++; $sectionauto[] = array('position'=>210, 'level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>isModEnabled('recruitment'), 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications")));
}
$rowspan++; $sectionauto[] = array('position'=>220, 'level'=>1, 'module'=>'user', 'test'=>1, 'label'=>$langs->trans("Users"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Users")));
diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php
index 1aa91371cee..e92a888f21b 100644
--- a/htdocs/ecm/search.php
+++ b/htdocs/ecm/search.php
@@ -121,19 +121,19 @@ if (isModEnabled("societe")) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'company', 'test'=>isModEnabled('societe'), 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
}
if (isModEnabled("propal")) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
+ $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>isModEnabled('propal'), 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
}
if (isModEnabled('contrat')) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
+ $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contrat'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
}
if (isModEnabled('commande')) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
+ $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>isModEnabled('commande'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
}
if (isModEnabled('facture')) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
+ $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('facture'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
}
if (isModEnabled('supplier_proposal')) {
- $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
+ $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>isModEnabled('supplier_proposal'), 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
}
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders")));
@@ -142,28 +142,28 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices")));
}
if (isModEnabled('tax')) {
- $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
+ $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>isModEnabled('tax'), 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
}
if (isModEnabled('project')) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
}
if (isModEnabled('ficheinter')) {
- $langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
+ $langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('ficheinter'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
}
if (isModEnabled('expensereport')) {
- $langs->load("trips"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
+ $langs->load("trips"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>isModEnabled('expensereport'), 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
}
if (isModEnabled('holiday')) {
- $langs->load("holiday"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays")));
+ $langs->load("holiday"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'holiday', 'test'=>isModEnabled('holiday'), 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays")));
}
if (isModEnabled("banque")) {
- $langs->load("banks"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>$conf->banque->enabled, 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount")));
+ $langs->load("banks"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount")));
}
if (!empty($conf->mrp->enabled)) {
- $langs->load("mrp"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>$conf->mrp->enabled, 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
+ $langs->load("mrp"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>isModEnabled('mrp'), 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
}
if (isModEnabled('recruitment')) {
- $langs->load("recruitment"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>$conf->recruitment->enabled, 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications")));
+ $langs->load("recruitment"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>isModEnabled('recruitment'), 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications")));
}
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 4fcb145d62a..0790b54daa3 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -1210,7 +1210,7 @@ class Expedition extends CommonObject
}
// Stock control
- if (!$error && $conf->stock->enabled &&
+ if (!$error && isModEnabled('stock') &&
(($conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT) ||
($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE && $this->statut == self::STATUS_CLOSED && $also_update_stock))) {
require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php";
@@ -1401,7 +1401,7 @@ class Expedition extends CommonObject
}
// Stock control
- if (!$error && $conf->stock->enabled &&
+ if (!$error && isModEnabled('stock') &&
(($conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT) ||
($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE && $this->statut == self::STATUS_CLOSED && $also_update_stock))) {
require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php";
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index f5be521dd3b..fa39dab1928 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -2382,7 +2382,7 @@ class CommandeFournisseur extends CommonOrder
dol_syslog(get_class($this)."::Livraison");
$usercanreceive = 0;
- if (empty($conf->reception->enabled)) {
+ if (!isModEnabled('reception')) {
$usercanreceive = $user->rights->fournisseur->commande->receptionner;
} else {
$usercanreceive = $user->rights->reception->creer;
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index 5524783e275..16bc43474d8 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -738,7 +738,7 @@ class ProductFournisseur extends Product
$prodfourn->supplier_fk_barcode_type = $record["fk_barcode_type"];
}
- if (!empty($conf->dynamicprices->enabled) && !empty($prodfourn->fk_supplier_price_expression)) {
+ if (isModEnabled('dynamicprices') && !empty($prodfourn->fk_supplier_price_expression)) {
$priceparser = new PriceParser($this->db);
$price_result = $priceparser->parseProductSupplier($prodfourn);
if ($price_result >= 0) {
@@ -844,7 +844,7 @@ class ProductFournisseur extends Product
$fourn_unitprice = $record["unitprice"];
$fourn_unitprice_with_discount = $record["unitprice"] * (1 - $record["remise_percent"] / 100);
- if (!empty($conf->dynamicprices->enabled) && !empty($record["fk_supplier_price_expression"])) {
+ if (isModEnabled('dynamicprices') && !empty($record["fk_supplier_price_expression"])) {
$prod_supplier = new ProductFournisseur($this->db);
$prod_supplier->product_fourn_price_id = $record["product_fourn_price_id"];
$prod_supplier->id = $prodid;
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 413c2c3f853..6e006704a83 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -839,7 +839,7 @@ if ($resql) {
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
);
- if (!empty($conf->paymentbybanktransfer->enabled) && !empty($user->rights->paymentbybanktransfer->create)) {
+ if (isModEnabled('paymentbybanktransfer') && !empty($user->rights->paymentbybanktransfer->create)) {
$langs->load('withdrawals');
$arrayofmassactions['banktransfertrequest'] = img_picto('', 'payment', 'class="pictofixedwidth"').$langs->trans("MakeBankTransferOrder");
}
diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php
index 00722526e9d..99212988488 100644
--- a/htdocs/hrm/admin/admin_establishment.php
+++ b/htdocs/hrm/admin/admin_establishment.php
@@ -40,7 +40,7 @@ $permissiontoadd = $user->admin;
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0);
-if (empty($conf->hrm->enabled)) accessforbidden();
+if (!isModEnabled('hrm')) accessforbidden();
if (empty($permissiontoread)) accessforbidden();
$sortorder = GETPOST('sortorder', 'aZ09comma');
diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php
index dc8d20403a3..ece067ce072 100644
--- a/htdocs/hrm/admin/admin_hrm.php
+++ b/htdocs/hrm/admin/admin_hrm.php
@@ -46,7 +46,7 @@ $permissiontoadd = $user->admin;
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0);
-if (empty($conf->hrm->enabled)) accessforbidden();
+if (!isModEnabled('hrm')) accessforbidden();
if (empty($permissiontoread)) accessforbidden();
diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php
index 14ae1364494..f1bddce44e4 100644
--- a/htdocs/hrm/establishment/card.php
+++ b/htdocs/hrm/establishment/card.php
@@ -61,7 +61,7 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0);
-if (empty($conf->hrm->enabled)) accessforbidden();
+if (!isModEnabled('hrm')) accessforbidden();
if (empty($permissiontoread)) accessforbidden();
diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php
index d5f7f8a6b36..641c53e0f70 100644
--- a/htdocs/hrm/establishment/info.php
+++ b/htdocs/hrm/establishment/info.php
@@ -86,7 +86,7 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->hrm->enabled)) accessforbidden();
+if (!isModEnabled('hrm')) accessforbidden();
if (empty($permissiontoread)) accessforbidden();
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 16e3f006d3d..6865e4b8bf4 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -2603,7 +2603,7 @@ function top_menu_bookmark()
$html = '';
// Define $bookmarks
- if (empty($conf->bookmark->enabled) || empty($user->rights->bookmark->lire)) {
+ if (!isModEnabled('bookmark') || empty($user->rights->bookmark->lire)) {
return $html;
}
@@ -3304,7 +3304,7 @@ if (!function_exists("llxFooter")) {
}
// Wrapper to add log when clicking on download or preview
- if (!empty($conf->blockedlog->enabled) && is_object($object) && !empty($object->id) && $object->id > 0 && $object->statut > 0) {
+ if (isModEnabled('blockedlog') && is_object($object) && !empty($object->id) && $object->id > 0 && $object->statut > 0) {
if (in_array($object->element, array('facture'))) { // Restrict for the moment to element 'facture'
print "\n\n";
?>
diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php
index d91735c592f..ac944acc066 100644
--- a/htdocs/mrp/mo_agenda.php
+++ b/htdocs/mrp/mo_agenda.php
@@ -153,7 +153,7 @@ if ($object->id > 0) {
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoadd) {
diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php
index e52c0860aa2..373dd7b6410 100644
--- a/htdocs/mrp/mo_card.php
+++ b/htdocs/mrp/mo_card.php
@@ -436,7 +436,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}*/
$formquestion = array();
- if (!empty($conf->mrp->enabled)) {
+ if (isModEnabled('mrp')) {
$langs->load("mrp");
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
@@ -487,7 +487,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref .= $langs->trans('ThirdParty').' ';
$morehtmlref .= ': '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoadd) {
diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php
index e19e0b391a2..4e8808012e1 100644
--- a/htdocs/mrp/mo_document.php
+++ b/htdocs/mrp/mo_document.php
@@ -131,7 +131,7 @@ if ($object->id) {
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoadd) {
diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php
index 303f5516d72..761a17f016d 100644
--- a/htdocs/mrp/mo_movements.php
+++ b/htdocs/mrp/mo_movements.php
@@ -327,7 +327,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoadd) {
@@ -605,7 +605,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (!empty($arrayfields['m.datem']['checked'])) {
print '
';
print '';
- if (empty($conf->productbatch->enabled)) {
+ if (!isModEnabled('productbatch')) {
print ' ';
}
//else print ' ';
diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php
index c32751b28d4..031018d0daa 100644
--- a/htdocs/mrp/mo_note.php
+++ b/htdocs/mrp/mo_note.php
@@ -107,7 +107,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoadd) {
diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php
index 25c43e46920..24b3516684e 100644
--- a/htdocs/mrp/mo_production.php
+++ b/htdocs/mrp/mo_production.php
@@ -482,7 +482,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}*/
$formquestion = array();
- if (!empty($conf->mrp->enabled)) {
+ if (isModEnabled('mrp')) {
$langs->load("mrp");
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
@@ -525,7 +525,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoadd) {
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index d28eca5252a..ca71ed3030b 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -313,7 +313,7 @@ if (empty($reshook)) {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
} else {
- if (!empty($conf->dynamicprices->enabled) && $price_expression !== '') {
+ if (isModEnabled('dynamicprices') && $price_expression !== '') {
//Check the expression validity by parsing it
$priceparser = new PriceParser($db);
$object->fk_supplier_price_expression = $price_expression;
@@ -323,7 +323,7 @@ if (empty($reshook)) {
setEventMessages($priceparser->translatedError(), null, 'errors');
}
}
- if (!$error && !empty($conf->dynamicprices->enabled)) {
+ if (!$error && isModEnabled('dynamicprices')) {
//Set the price expression for this supplier price
$ret = $object->setSupplierPriceExpression($price_expression);
if ($ret < 0) {
@@ -635,7 +635,7 @@ if ($id > 0 || $ref) {
print '';
print '
';
- if (!empty($conf->dynamicprices->enabled)) { //Only show price mode and expression selector if module is enabled
+ if (isModEnabled('dynamicprices')) { //Only show price mode and expression selector if module is enabled
// Price mode selector
print '
'.$langs->trans("PriceMode").'
';
$price_expression = new PriceExpression($db);
@@ -803,7 +803,7 @@ END;
// Option to define a transport cost on supplier price
if (!empty($conf->global->PRODUCT_CHARGES)) {
- if (!empty($conf->margin->enabled)) {
+ if (isModEnabled('margin')) {
print '
';
print '
'.$langs->trans("Charges").'
';
print '
';
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index 2eb281e734c..3561388709d 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -165,7 +165,7 @@ if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|| !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)
|| !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)
|| !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)
- || !empty($conf->mrp->enabled)) {
+ || isModEnabled('mrp')) {
$virtualdiffersfromphysical = 1; // According to increase/decrease stock options, virtual and physical stock may differs.
}