diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 2a9429ffeaa..edb8e48405e 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -312,7 +312,7 @@ if (isModEnabled("propal") && $user->rights->propale->lire) { */ /* -if (!empty($conf->propal->enabled)) +if (isModEnabled('propal')) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as name, s.rowid as socid"; $sql.=" FROM ".MAIN_DB_PREFIX."propal as c"; @@ -387,7 +387,7 @@ if (!empty($conf->propal->enabled)) */ /* -if (!empty($conf->propal->enabled)) +if (isModEnabled('propal')) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 50ce856dec2..c43f4b53f34 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9425,7 +9425,7 @@ class Form } } - if (!empty($conf->gravatar->enabled) && $email && empty($noexternsourceoverwrite)) { + if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) { // see https://gravatar.com/site/implement/images/php/ $ret .= ''; $ret .= ''; // gravatar need md5 hash diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index db48100867f..fc4a8408e43 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -962,7 +962,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $sortfield = "t.lastname"; } - if (!empty($conf->clicktodial->enabled)) { + if (isModEnabled('clicktodial')) { $user->fetch_clicktodial(); // lecture des infos de clicktodial du user } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3610a470118..869ad6da96a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3385,11 +3385,11 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli } } if (!empty($addlink)) { // Link on phone number (+ link to add action if conf->global->AGENDA_ADDACTIONFORPHONE set) - if ($conf->browser->layout == 'phone' || (!empty($conf->clicktodial->enabled) && !empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) { // If phone or option for, we use link of phone + if ($conf->browser->layout == 'phone' || (isModEnabled('clicktodial') && !empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) { // If phone or option for, we use link of phone $newphoneform = $newphone; $newphone = ''; - } elseif (!empty($conf->clicktodial->enabled) && $addlink == 'AC_TEL') { // If click to dial, we use click to dial url + } elseif (isModEnabled('clicktodial') && $addlink == 'AC_TEL') { // If click to dial, we use click to dial url if (empty($user->clicktodial_loaded)) { $user->fetch_clicktodial(); } diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 5f497377798..1461ee96c58 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2236,7 +2236,7 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '') $module='facture'; } - if (!empty($conf->$module->enabled)) { + if (isModEnabled($module)) { $res = dol_include_once('/'.$classpath.'/'.$classfile.'.class.php'); if ($res) { if (class_exists($classname)) { diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 0b91188b47f..9d1401ea47a 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -181,7 +181,7 @@ function getCustomerProposalPieChart($socid = 0) $result= ''; - if (empty($conf->propal->enabled) || empty($user->rights->propal->lire)) { + if (!isModEnabled('propal') || empty($user->rights->propal->lire)) { return ''; } diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 9eb65532afc..47913be455d 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -99,7 +99,7 @@ function user_prepare_head(User $object) $h++; } - if (!empty($conf->clicktodial->enabled)) { + if (!isModEnabled('clicktodial')) { $head[$h][0] = DOL_URL_ROOT.'/user/clicktodial.php?id='.$object->id; $head[$h][1] = $langs->trans("ClickToDial"); $head[$h][2] = 'clicktodial';