Use isModEnabled
This commit is contained in:
parent
fc9e6c541e
commit
9e957edc3b
@ -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);
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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 .= '<br>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user