diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 928dff1aea6..d46f2cb24a7 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -138,7 +138,7 @@ if ($id > 0) { } llxHeader('', $title); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = contract_prepare_head($object); diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 59373e39cd3..da6a6c5e1f8 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -547,7 +547,7 @@ function show_stats_for_company($product, $socid) } // BOM - if (!empty($conf->bom->enabled) && $user->rights->bom->read) { + if (isModEnabled('bom') && $user->rights->bom->read) { $nblines++; $ret = $product->load_stats_bom($socid); if ($ret < 0) { diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index f6690935416..9eb65532afc 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -107,7 +107,7 @@ function user_prepare_head(User $object) } // Notifications - if ($user->socid == 0 && !empty($conf->notification->enabled)) { + if ($user->socid == 0 && isModEnabled('notification')) { $nbNote = 0; $sql = "SELECT COUNT(n.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."notify_def as n"; diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index caf7c238d79..f25aabee871 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -66,7 +66,7 @@ class InterfaceNotification extends DolibarrTriggers */ public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { - if (empty($conf->notification) || empty($conf->notification->enabled)) { + if (empty($conf->notification) || !isModEnabled('notification')) { return 0; // Module not active, we do nothing } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 6b819f58e83..ef47a95186d 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1693,7 +1693,7 @@ if ($action == 'create') { $text = $langs->trans("ConfirmValidateSending", $numref); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
';