Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-09-25 06:30:51 +02:00
parent fc9e6c541e
commit 9e957edc3b
5 changed files with 5 additions and 5 deletions

View File

@ -138,7 +138,7 @@ if ($id > 0) {
} }
llxHeader('', $title); llxHeader('', $title);
if (!empty($conf->notification->enabled)) { if (isModEnabled('notification')) {
$langs->load("mails"); $langs->load("mails");
} }
$head = contract_prepare_head($object); $head = contract_prepare_head($object);

View File

@ -547,7 +547,7 @@ function show_stats_for_company($product, $socid)
} }
// BOM // BOM
if (!empty($conf->bom->enabled) && $user->rights->bom->read) { if (isModEnabled('bom') && $user->rights->bom->read) {
$nblines++; $nblines++;
$ret = $product->load_stats_bom($socid); $ret = $product->load_stats_bom($socid);
if ($ret < 0) { if ($ret < 0) {

View File

@ -107,7 +107,7 @@ function user_prepare_head(User $object)
} }
// Notifications // Notifications
if ($user->socid == 0 && !empty($conf->notification->enabled)) { if ($user->socid == 0 && isModEnabled('notification')) {
$nbNote = 0; $nbNote = 0;
$sql = "SELECT COUNT(n.rowid) as nb"; $sql = "SELECT COUNT(n.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."notify_def as n"; $sql .= " FROM ".MAIN_DB_PREFIX."notify_def as n";

View File

@ -66,7 +66,7 @@ class InterfaceNotification extends DolibarrTriggers
*/ */
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) 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 return 0; // Module not active, we do nothing
} }

View File

@ -1693,7 +1693,7 @@ if ($action == 'create') {
$text = $langs->trans("ConfirmValidateSending", $numref); $text = $langs->trans("ConfirmValidateSending", $numref);
if (!empty($conf->notification->enabled)) { if (isModEnabled('notification')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
$text .= '<br>'; $text .= '<br>';