diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index afc23f3ff63..f6e3c633a74 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -146,17 +146,6 @@ print ''.$langs->trans('OptionMode').''.$langs->trans('Description' 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)) -//{ -// // print "
\n"; -// // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite')); -//} -//else -//{ -// // print "
\n"; -// // print nl2br($langs->trans('OptionModeTrueInfoExpert')); -//} print "\n"; print ' '.$langs->trans('OptionModeVirtual').''; print ''.nl2br($langs->trans('OptionModeVirtualDesc'))."\n"; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 080e457c5c9..8efd245c3ad 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -383,7 +383,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_SENDMODE").''; // SuperAdministrator access only - if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail')); } else { $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE')]; @@ -516,7 +516,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").''; // SuperAdministrator access only - if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE); } else { $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE')]; diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 211d1d13731..51d0e1a4926 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -318,7 +318,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_SENDMODE").''; // SuperAdministrator access only - if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_EMAILING); } else { $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')]; @@ -450,7 +450,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").''; // SuperAdministrator access only - if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING); } else { $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING')]; diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index f86761f9e69..d26c1e57505 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -307,7 +307,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_SENDMODE").''; // SuperAdministrator access only - if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print $form->selectarray('MAIN_MAIL_SENDMODE_TICKET', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_TICKET); } else { $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET')]; @@ -437,7 +437,7 @@ if ($action == 'edit') { if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").''; // SuperAdministrator access only - if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET); } else { $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET')]; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index af7327dcf68..f3b6dfcf5fb 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -404,13 +404,13 @@ foreach ($modulesdir as $dir) { // We discard modules according to features level (PS: if module is activated we always show it) $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod))); - if ($objMod->version == 'development' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2))) { + if ($objMod->version == 'development' && (!isModEnabled($const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2))) { $modulequalified = 0; } - if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1))) { + if ($objMod->version == 'experimental' && (!isModEnabled($const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1))) { $modulequalified = 0; } - if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) { + if (preg_match('/deprecated/', $objMod->version) && (!isModEnabled($const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) { $modulequalified = 0; } diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index eeabf022b46..e5fe6cc018c 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -379,7 +379,7 @@ print '
'; */ /* Disable this, there is no trigger with elementtype 'withdraw' -if (!empty($conf->global->MAIN_MODULE_NOTIFICATION)) +if (isModEnabled('notification')) { $langs->load("mails"); print load_fiche_titre($langs->trans("Notifications")); diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 5908680756c..ac196aae015 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -395,7 +395,7 @@ print '
'; */ /* Disable this, there is no trigger with elementtype 'withdraw' -if (!empty($conf->global->MAIN_MODULE_NOTIFICATION)) +if (isModEnabled('notification') ) { $langs->load("mails"); print load_fiche_titre($langs->trans("Notifications")); diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index cf07dd49539..843d6a95787 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -179,7 +179,7 @@ if (!$defaultsyslogfile) { $defaultsyslogfile = 'dolibarr.log'; } $optionmc = ''; -if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY) && $user->entity) { +if (isModEnabled('multicompany') && $user->entity) { print '
'.$langs->trans("ContactSuperAdminForChange").'
'; $optionmc = 'disabled'; } diff --git a/htdocs/api/admin/explorer_withredoc.php b/htdocs/api/admin/explorer_withredoc.php index 45dd31d57c9..0808a93a999 100644 --- a/htdocs/api/admin/explorer_withredoc.php +++ b/htdocs/api/admin/explorer_withredoc.php @@ -27,7 +27,7 @@ require_once '../../main.inc.php'; // Enable and test if module Api is enabled -if (empty($conf->global->MAIN_MODULE_API)) { +if (!isModEnabled('api') ) { $langs->load("admin"); dol_syslog("Call of Dolibarr API interfaces with module API REST are disabled"); print $langs->trans("WarningModuleNotActive", 'Api').'.

'; diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 0e2f615b3d7..ebf6c7e8091 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -112,7 +112,7 @@ if (!empty($conf->global->MAIN_NGINX_FIX)) { } // Enable and test if module Api is enabled -if (empty($conf->global->MAIN_MODULE_API)) { +if (!isModEnabled('api') ) { $langs->load("admin"); dol_syslog("Call of Dolibarr API interfaces with module API REST are disabled"); print $langs->trans("WarningModuleNotActive", 'Api').'.

'; diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 1966312d7f2..b3ea354bda7 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -147,7 +147,7 @@ if ($calc == 0 || $calc == 1) { // Calculate on invoice for goods and services $calcmode = $calc == 0 ? $langs->trans("CalcModeLT".$local) : $langs->trans("CalcModeLT".$local."Rec"); $calcmode .= ' ('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').')'; $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); - if (!empty($conf->global->MAIN_MODULE_COMPTABILITE)) { + if (isModEnabled('comptabilite')) { $description .= '
'.$langs->trans("WarningDepositsNotIncluded"); } $description .= $fsearch; @@ -165,7 +165,7 @@ if ($calc == 2) { // Invoice for goods, payment for services $calcmode = $langs->trans("CalcModeLT2Debt"); $calcmode .= ' ('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').')'; $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); - if (!empty($conf->global->MAIN_MODULE_COMPTABILITE)) { + if (isModEnabled('comptabilite')) { $description .= '
'.$langs->trans("WarningDepositsNotIncluded"); } $description .= $fsearch; diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index f5d1fe1f948..caa5173a13c 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -246,8 +246,6 @@ $description .= $langs->trans($LT); $calcmode = $langs->trans("LTReportBuildWithOptionDefinedInModule").' '; $calcmode .= ' ('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').')'; -//if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.='
'.$langs->trans("ThisIsAnEstimatedValue"); - $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); $builddate = dol_now(); diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 8cf68332e43..86d6e58f31f 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -199,7 +199,7 @@ if (! empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $description.='
'.$langs->trans("SupplierDepositsAreNotIncluded"); } */ -if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { +if (isModEnabled('accounting')) { $description .= $langs->trans("ThisIsAnEstimatedValue"); } diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index dce5ec2602e..7560439a4a5 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -207,7 +207,7 @@ if ($nextquarter < 4) { $description = $fsearch; $builddate = dol_now(); -if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { +if (isModEnabled('comptabilite')) { $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); } if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') { diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index c00da16c3be..af617959330 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -158,7 +158,7 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= $langs->trans("SupplierDepositsAreNotIncluded"); } -if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { +if (isModEnabled('accounting')) { $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); } diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 72366e6a7e2..b1365081432 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -216,7 +216,7 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= $langs->trans("SupplierDepositsAreNotIncluded"); } -if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { +if (isModEnabled('accounting')) { $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); } diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 5235b4211ff..9eb46427768 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -168,7 +168,7 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= $langs->trans("SupplierDepositsAreNotIncluded"); } -if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { +if (isModEnabled('accounting')) { $description .= '
' . $langs->trans("ThisIsAnEstimatedValue"); } diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index 632d751fa41..2f54c791c24 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.class.php @@ -282,7 +282,7 @@ class FormWebsite } if ($website->fk_default_home && $key == $website->fk_default_home) { //$valueforoption .= ' ('.$langs->trans("HomePage").')'; - $valueforoption .= ' '; + $valueforoption .= ' '; } $out .= '