diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 1d2df6c04ab..786814d30fc 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2061,7 +2061,7 @@ class Adherent extends CommonObject $err = 0; // mailman - if (!empty($conf->global->ADHERENT_USE_MAILMAN) && !empty($conf->mailmanspip->enabled)) { + if (!empty($conf->global->ADHERENT_USE_MAILMAN) && isModEnabled('mailmanspip')) { $result = $mailmanspip->add_to_mailman($this); if ($result < 0) { @@ -2081,7 +2081,7 @@ class Adherent extends CommonObject } // spip - if (!empty($conf->global->ADHERENT_USE_SPIP) && !empty($conf->mailmanspip->enabled)) { + if (!empty($conf->global->ADHERENT_USE_SPIP) && isModEnabled('mailmanspip')) { $result = $mailmanspip->add_to_spip($this); if ($result < 0) { $this->errors[] = $mailmanspip->error; @@ -2132,7 +2132,7 @@ class Adherent extends CommonObject } } - if ($conf->global->ADHERENT_USE_SPIP && !empty($conf->mailmanspip->enabled)) { + if ($conf->global->ADHERENT_USE_SPIP && isModEnabled('mailmanspip')) { $result = $mailmanspip->del_to_spip($this); if ($result < 0) { $this->errors[] = $mailmanspip->error; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index eec8bb16417..4bffad16ee3 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -644,7 +644,7 @@ if ($conf->banque->enabled) { print ''; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; - if (! empty($conf->use_javascript_ajax)) { + if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER'); } else { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) { @@ -664,7 +664,7 @@ if ($conf->banque->enabled) { if (isModEnabled('stock')) { print ''; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; - if (! empty($conf->use_javascript_ajax)) { + if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); } else { if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index d215125d51e..7bb291d521e 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -146,7 +146,7 @@ print "\n"; print ' '.$langs->trans('OptionModeTrue').''; print ''.nl2br($langs->trans('OptionModeTrueDesc')); // Write info on way to count VAT -//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) +//if (!empty($conf->global->MAIN_MODULE_COMPTABILITE)) //{ // // print "
\n"; // // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite')); diff --git a/htdocs/modulebuilder/template/mymoduleindex.php b/htdocs/modulebuilder/template/mymoduleindex.php index 15f3d83ac54..a5620a45966 100644 --- a/htdocs/modulebuilder/template/mymoduleindex.php +++ b/htdocs/modulebuilder/template/mymoduleindex.php @@ -100,7 +100,7 @@ print '
'; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read) +if (isModEnabled('mymodule') && $user->rights->mymodule->read) { $langs->load("orders"); @@ -181,7 +181,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject -if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read) +if (isModEnabled('mymodule') && $user->rights->mymodule->read) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."mymodule_myobject as s"; diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 78d20a1863a..173bea760a0 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -190,7 +190,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; @@ -211,7 +211,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 261839940e5..39e6e10e3d7 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -223,7 +223,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; @@ -245,7 +245,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref.=''; diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index e40ed6aa2e7..891eaf05b99 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -86,7 +86,7 @@ class FactureTest extends PHPUnit\Framework\TestCase if (!isModEnabled('facture')) { print __METHOD__." module customer invoice must be enabled.\n"; die(1); } - if (! empty($conf->ecotaxdeee->enabled)) { + if (!empty($conf->ecotaxdeee->enabled)) { print __METHOD__." ecotaxdeee module must not be enabled.\n"; die(1); } diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index 1845bf05149..de847e68411 100644 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -38,7 +38,7 @@ if (empty($user->id)) { } $conf->global->MAIN_DISABLE_ALL_MAILS=1; -if (! empty($conf->global->MAIN_ROUNDING_RULE_TOT)) { +if (!empty($conf->global->MAIN_ROUNDING_RULE_TOT)) { print "Parameter MAIN_ROUNDING_RULE_TOT must be set to 0 or not set.\n"; exit(1); } diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 73363140acd..1a93fb5d21f 100644 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -87,7 +87,7 @@ class SocieteTest extends PHPUnit\Framework\TestCase print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '".$conf->global->SOCIETE_CODECLIENT_ADDON."'.\n"; die(1); } - if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) { + if (!empty($conf->global->MAIN_DISABLEPROFIDRULES)) { print "\n".__METHOD__." constant MAIN_DISABLEPROFIDRULES must be empty (if a module set it, disable module).\n"; die(1); } diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index ea7090f2b54..d6bc1093258 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -82,7 +82,7 @@ class UserTest extends PHPUnit\Framework\TestCase { global $conf,$user,$langs,$db; - if (! empty($conf->global->MAIN_MODULE_LDAP)) { + if (!empty($conf->global->MAIN_MODULE_LDAP)) { print "\n".__METHOD__." module LDAP must be disabled.\n"; die(1); }