Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-09-25 23:06:42 +02:00
parent e170da3fda
commit a415fcfe4c
7 changed files with 9 additions and 9 deletions

View File

@ -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";

View File

@ -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 .= '<!-- Put link to gravatar -->';
$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.md5(strtolower(trim($email))).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash

View File

@ -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
}

View File

@ -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 = '<a href="tel:'.$phone.'"';
$newphone .= '>'.$newphoneform.'</a>';
} 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();
}

View File

@ -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)) {

View File

@ -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 '';
}

View File

@ -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';