diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 318fc26c662..fc5e47ce31a 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -103,7 +103,7 @@ class AccountancyExport $this->db = $db; $this->separator = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; - $this->end_line = empty($conf->global->ACCOUNTING_EXPORT_ENDLINE) ? "\n" : ($conf->global->ACCOUNTING_EXPORT_ENDLINE == 1 ? "\n" : "\r\n"); + $this->end_line = empty($conf->global->ACCOUNTING_EXPORT_ENDLINE) ? "\n" : (getDolGlobalInt('ACCOUNTING_EXPORT_ENDLINE') == 1 ? "\n" : "\r\n"); $hookmanager->initHooks(array('accountancyexport')); } diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 28982da4e86..6b3a833f2d1 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -110,7 +110,7 @@ if (isModEnabled('accounting')) { print load_fiche_titre($langs->trans("AccountancyArea"), $resultboxes['selectboxlist'], 'accountancy', 0, '', '', $showtutorial); - if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_SITUATION == 1) { + if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) { print info_admin($langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices")); print "
"; } diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 6b091db2cb8..e64904b8045 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -1262,7 +1262,7 @@ if (empty($action) || $action == 'view') { if (empty($accounttoshow) || $accounttoshow == 'NotDefined') { if ($tabtype[$key] == 'unknown') { // We will accept writing, but into a waiting account - if (empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) || $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE == '-1') { + if (empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) || getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE') == '-1') { $accounttoshow = ''.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').''; } else { $accounttoshow = ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).''; // We will use a waiting account diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 2e8e68526db..66f07edc718 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -529,7 +529,7 @@ if (empty($action) || $action == 'view') { journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); // Button to write into Ledger - if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') { + if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == '-1') { print '
'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); $desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}'); $desc = str_replace('{link}', ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'', $desc); @@ -541,7 +541,7 @@ if (empty($action) || $action == 'view') { if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') { print ''; } - if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') { + if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == '-1') { print ''; } else { if ($in_bookkeeping == 'notyet') { diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php index a2e9d362aad..dee43a02cfe 100644 --- a/htdocs/accountancy/journal/variousjournal.php +++ b/htdocs/accountancy/journal/variousjournal.php @@ -165,20 +165,20 @@ if ($reload) { $form = new Form($db); if ($object->nature == 2) { - $some_mandatory_steps_of_setup_were_not_done = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "" || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'; - $account_accounting_not_defined = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "" || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'; + $some_mandatory_steps_of_setup_were_not_done = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == '-1'; + $account_accounting_not_defined = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == '-1'; } elseif ($object->nature == 3) { - $some_mandatory_steps_of_setup_were_not_done = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "" || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1'; - $account_accounting_not_defined = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "" || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1'; + $some_mandatory_steps_of_setup_were_not_done = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == '-1'; + $account_accounting_not_defined = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == '-1'; } elseif ($object->nature == 4) { - $some_mandatory_steps_of_setup_were_not_done = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "" || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1' - || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "" || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1' - || empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1'; - $account_accounting_not_defined = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "" || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1' - || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "" || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1'; + $some_mandatory_steps_of_setup_were_not_done = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == '-1' + || getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == '-1' + || empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == '-1'; + $account_accounting_not_defined = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == '-1' + || getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == '-1'; } elseif ($object->nature == 5) { - $some_mandatory_steps_of_setup_were_not_done = empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1'; - $account_accounting_not_defined = empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1'; + $some_mandatory_steps_of_setup_were_not_done = empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == '-1'; + $account_accounting_not_defined = empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == '-1'; } else { $title = $object->getLibType(); $some_mandatory_steps_of_setup_were_not_done = false; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 9b6dd8b9468..0f72d81398f 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1825,7 +1825,7 @@ class Adherent extends CommonObject } $vattouse = 0; - if (isset($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) && $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS == 'defaultforfoundationcountry') { + if (getDolGlobalString('ADHERENT_VAT_FOR_SUBSCRIPTIONS') == 'defaultforfoundationcountry') { $vattouse = get_default_tva($mysoc, $mysoc, $idprodsubscription); } //print xx".$vattouse." - ".$mysoc." - ".$customer;exit; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index eb07c7ab048..5e816aae5c4 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -854,11 +854,11 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h $bankviainvoice = 1; } } else { - if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) { + if (getDolGlobalString('ADHERENT_BANK_USE') == 'bankviainvoice' && isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) { $bankviainvoice = 1; - } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && isModEnabled('banque')) { + } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'bankdirect' && isModEnabled('banque')) { $bankdirect = 1; - } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) { + } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'invoiceonly' && isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) { $invoiceonly = 1; } } diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 0a7770bcc3d..ff9f7de4715 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -753,7 +753,7 @@ print "\n"; if ($mysoc->useLocalTax(1)) { // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print 'global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "").'> "; + print ' "; print ''; print '
'; $tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code); @@ -771,7 +771,7 @@ if ($mysoc->useLocalTax(1)) { print "
"; print "\n"; - print 'global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "").'> "; + print 'global->FACTURE_LOCAL_TAX1_OPTION) || getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') == "localtax1off") ? " checked" : "").'> "; print ''; $tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code); $tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."\n" : ""); @@ -797,7 +797,7 @@ print "\n"; if ($mysoc->useLocalTax(2)) { // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print 'global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "").'> "; + print ' "; print ''; print '
'; print '"; @@ -812,7 +812,7 @@ if ($mysoc->useLocalTax(2)) { print "
"; print "\n"; - print 'global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "").'> "; + print 'global->FACTURE_LOCAL_TAX2_OPTION) || getDolGlobalString('FACTURE_LOCAL_TAX2_OPTION') == "localtax2off") ? " checked" : "").'> "; print ''; print "
"; $tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code); diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index 78fde3d095e..0d47b80c846 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -109,7 +109,7 @@ print ''.$langs->trans("GeoIPLibVersion").''; print ''; $arrayofvalues = array('php' => 'Native PHP functions', '1' => 'Embedded GeoIP v1', '2' => 'Embedded GeoIP v2'); print $form->selectarray('geoipversion', $arrayofvalues, (isset($conf->global->GEOIP_VERSION) ? $conf->global->GEOIP_VERSION : '2')); -if ($conf->global->GEOIP_VERSION == 'php') { +if (getDolGlobalString('GEOIP_VERSION') == 'php') { if ($geoip) { $version = $geoip->getVersion(); } @@ -126,7 +126,7 @@ $gimcdf = getDolGlobalString('GEOIPMAXMIND_COUNTRY_DATAFILE'); // Path to database file print ''.$langs->trans("PathToGeoIPMaxmindCountryDataFile").''; print ''; -if ($conf->global->GEOIP_VERSION == 'php') { +if (getDolGlobalString('GEOIP_VERSION') == 'php') { print 'Using geoip PHP internal functions. Value must be '.geoip_db_filename(GEOIP_COUNTRY_EDITION).' or '.geoip_db_filename(GEOIP_CITY_EDITION_REV1).' or /pathtodatafile/GeoLite2-Country.mmdb
'; } print ''; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index c4b3bc05333..12f2bb7a097 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -780,7 +780,7 @@ if ($action == 'edit') { print ''; - if ($conf->global->MAIN_MAIL_SENDMODE == 'swiftmailer') { + if (getDolGlobalString('MAIN_MAIL_SENDMODE') == 'swiftmailer') { // DKIM print ''.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").''; if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('swiftmailer'))) { diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 8a276d68e27..80eeb37e2f4 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -334,7 +334,7 @@ if ($action == 'edit') { // Host server print ''; - if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') { + if (!$conf->use_javascript_ajax && $linuxlike && getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'mail') { print ''; print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); print ''; @@ -369,7 +369,7 @@ if ($action == 'edit') { // Port print ''; - if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') { + if (!$conf->use_javascript_ajax && $linuxlike && getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'mail') { print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; @@ -536,14 +536,14 @@ if ($action == 'edit') { if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') { // Host server - if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail')) { + if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'mail')) { print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : '').''; } // Port - if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail')) { + if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'mail')) { print ''.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : '').''; @@ -622,7 +622,7 @@ if ($action == 'edit') { print dol_get_fiche_end(); - if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) { + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) { print '
'; /* // Warning 1 @@ -662,7 +662,7 @@ if ($action == 'edit') { print '
'; - if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail' && !in_array($action, array('testconnect', 'test', 'testhtml'))) { + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'mail' && !in_array($action, array('testconnect', 'test', 'testhtml'))) { $text = $langs->trans("WarningPHPMail"); print info_admin($text); } diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index 05d66516cde..704bb72c4cf 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -323,7 +323,7 @@ if ($action == 'edit') { // Host server print ''; - if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_TICKET == 'mail') { + if (!$conf->use_javascript_ajax && $linuxlike && getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'mail') { print ''; print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); print ''; @@ -357,7 +357,7 @@ if ($action == 'edit') { // Port print ''; - if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_TICKET == 'mail') { + if (!$conf->use_javascript_ajax && $linuxlike && getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'mail') { print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; @@ -510,14 +510,14 @@ if ($action == 'edit') { if (!empty($conf->global->MAIN_MAIL_SENDMODE_TICKET) && $conf->global->MAIN_MAIL_SENDMODE_TICKET != 'default') { // Host server - if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && $conf->global->MAIN_MAIL_SENDMODE_TICKET == 'mail')) { + if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'mail')) { print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER_TICKET) ? $conf->global->MAIN_MAIL_SMTP_SERVER_TICKET : '').''; } // Port - if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && $conf->global->MAIN_MAIL_SENDMODE_TICKET == 'mail')) { + if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'mail')) { print ''.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_PORT_TICKET) ? $conf->global->MAIN_MAIL_SMTP_PORT_TICKET : '').''; @@ -581,7 +581,7 @@ if ($action == 'edit') { print dol_get_fiche_end(); - if ($conf->global->MAIN_MAIL_SENDMODE_TICKET == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) { + if (getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) { print '
'; /* // Warning 1 @@ -623,7 +623,7 @@ if ($action == 'edit') { print '
'; - if ($conf->global->MAIN_MAIL_SENDMODE_TICKET == 'mail' && !in_array($action, array('testconnect', 'test', 'testhtml'))) { + if (getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'mail' && !in_array($action, array('testconnect', 'test', 'testhtml'))) { $text = $langs->trans("WarningPHPMail"); print info_admin($text); } diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 166d8d420dc..584df5c3f1e 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -274,7 +274,7 @@ print ''; // Pattern for Password Perso -if ($conf->global->USER_PASSWORD_GENERATED == "Perso") { +if (getDolGlobalString('USER_PASSWORD_GENERATED') == "Perso") { print '
'; print '
'; diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index 6c68864f3ee..4f029e9a942 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -97,7 +97,7 @@ if (!isset($conf->global->ASTERISK_INDICATIF)) { if (!isset($conf->global->ASTERISK_PORT)) { $conf->global->ASTERISK_PORT = 5038; } -if ($conf->global->ASTERISK_INDICATIF == 'NONE') { +if (getDolGlobalString('ASTERISK_INDICATIF') == 'NONE') { $conf->global->ASTERISK_INDICATIF = ''; } if (!isset($conf->global->ASTERISK_CONTEXT)) { diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 916a12d0564..e962f6ac3af 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1777,7 +1777,7 @@ class Account extends CommonObject if (!empty($conf->global->BANK_SHOW_ORDER_OPTION)) { if (is_numeric($conf->global->BANK_SHOW_ORDER_OPTION)) { - if ($conf->global->BANK_SHOW_ORDER_OPTION == '1') { + if (getDolGlobalString('BANK_SHOW_ORDER_OPTION') == '1') { $fieldlists = array( 'BankCode', 'DeskCode', diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 0adeb9d2c2f..a46f61fccf4 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -422,7 +422,7 @@ if ($action == "create" || $action == "start" || $action == 'close') { } $selectedposnumber = 0; $showempty = 1; - if ($conf->global->TAKEPOS_NUM_TERMINALS == '1') { + if (getDolGlobalString('TAKEPOS_NUM_TERMINALS') == '1') { $selectedposnumber = 1; $showempty = 0; } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 76fdb80f966..a75a5f5f606 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1014,9 +1014,9 @@ class Facture extends CommonInvoice // If margin module defined on costprice, we try the costprice // If not defined or if module margin defined and pmp and stock module enabled, we try pmp price // else we get the best supplier price - if ($conf->global->MARGIN_TYPE == 'costprice' && !empty($producttmp->cost_price)) { + if (getDolGlobalString('MARGIN_TYPE') == 'costprice' && !empty($producttmp->cost_price)) { $buyprice = $producttmp->cost_price; - } elseif (isModEnabled('stock') && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) { + } elseif (isModEnabled('stock') && (getDolGlobalString('MARGIN_TYPE') == 'costprice' || getDolGlobalString('MARGIN_TYPE') == 'pmp') && !empty($producttmp->pmp)) { $buyprice = $producttmp->pmp; } else { if ($producttmp->find_min_price_product_fournisseur($_facrec->lines[$i]->fk_product) > 0) { @@ -4569,9 +4569,9 @@ class Facture extends CommonInvoice // Clean parameters (if not defined or using deprecated value) if (empty($conf->global->FACTURE_ADDON)) { $conf->global->FACTURE_ADDON = 'mod_facture_terre'; - } elseif ($conf->global->FACTURE_ADDON == 'terre') { + } elseif (getDolGlobalString('FACTURE_ADDON') == 'terre') { $conf->global->FACTURE_ADDON = 'mod_facture_terre'; - } elseif ($conf->global->FACTURE_ADDON == 'mercure') { + } elseif (getDolGlobalString('FACTURE_ADDON') == 'mercure') { $conf->global->FACTURE_ADDON = 'mod_facture_mercure'; } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 252d10e731f..03f6afde02e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -247,7 +247,7 @@ $arrayfields = array( 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>292), 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>295), 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>296), // Not enabled by default because slow - 'total_pa' => array('label' => ((isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == '1') ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) ? 0 : 1)), + 'total_pa' => array('label' => ((getDolGlobalString('MARGIN_TYPE') == '1') ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) ? 0 : 1)), 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) ? 0 : 1)), 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 8873fd26b88..1966312d7f2 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -56,11 +56,11 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e $date_end = dol_get_last_day($year_start, GETPOST("month"), false); } else { $date_start = dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START, false); - if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { + if (empty($conf->global->MAIN_INFO_VAT_RETURN) || getDolGlobalInt('MAIN_INFO_VAT_RETURN') == 2) { $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; - } elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) { + } elseif (getDolGlobalInt('MAIN_INFO_VAT_RETURN') == 3) { $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; - } elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) { + } elseif (getDolGlobalInt('MAIN_INFO_VAT_RETURN') == 1) { $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; } } diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index f8e5e12e8c8..8cf68332e43 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -66,11 +66,11 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } else { $date_start = dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START, false); - if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { + if (empty($conf->global->MAIN_INFO_VAT_RETURN) || getDolGlobalInt('MAIN_INFO_VAT_RETURN') == 2) { $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; - } elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) { + } elseif (getDolGlobalInt('MAIN_INFO_VAT_RETURN') == 3) { $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; - } elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) { + } elseif (getDolGlobalInt('MAIN_INFO_VAT_RETURN') == 1) { $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; } } diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 1341f0c4efb..734887bc9be 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -401,9 +401,9 @@ class RemiseCheque extends CommonObject // Clean parameters (if not defined or using deprecated value) if (empty($conf->global->CHEQUERECEIPTS_ADDON)) { $conf->global->CHEQUERECEIPTS_ADDON = 'mod_chequereceipt_mint'; - } elseif ($conf->global->CHEQUERECEIPTS_ADDON == 'thyme') { + } elseif (getDolGlobalString('CHEQUERECEIPTS_ADDON') == 'thyme') { $conf->global->CHEQUERECEIPTS_ADDON = 'mod_chequereceipt_thyme'; - } elseif ($conf->global->CHEQUERECEIPTS_ADDON == 'mint') { + } elseif (getDolGlobalString('CHEQUERECEIPTS_ADDON') == 'mint') { $conf->global->CHEQUERECEIPTS_ADDON = 'mod_chequereceipt_mint'; } diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 54f9f455134..f0f4c22b96a 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -1114,9 +1114,9 @@ class Paiement extends CommonObject // Clean parameters (if not defined or using deprecated value) if (empty($conf->global->PAYMENT_ADDON)) { $conf->global->PAYMENT_ADDON = 'mod_payment_cicada'; - } elseif ($conf->global->PAYMENT_ADDON == 'ant') { + } elseif (getDolGlobalString('PAYMENT_ADDON') == 'ant') { $conf->global->PAYMENT_ADDON = 'mod_payment_ant'; - } elseif ($conf->global->PAYMENT_ADDON == 'cicada') { + } elseif (getDolGlobalString('PAYMENT_ADDON') == 'cicada') { $conf->global->PAYMENT_ADDON = 'mod_payment_cicada'; } diff --git a/htdocs/compta/tva/initdatesforvat.inc.php b/htdocs/compta/tva/initdatesforvat.inc.php index 8039fce728f..93695edcdf1 100644 --- a/htdocs/compta/tva/initdatesforvat.inc.php +++ b/htdocs/compta/tva/initdatesforvat.inc.php @@ -46,10 +46,10 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e $date_start = dol_get_first_day($year_start, GETPOST("month", 'int'), 'tzserver'); $date_end = dol_get_last_day($year_start, GETPOST("month", 'int'), 'tzserver'); } else { - if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { // quaterly vat, we take last past complete quarter + if (empty($conf->global->MAIN_INFO_VAT_RETURN) || getDolGlobalInt('MAIN_INFO_VAT_RETURN') == 2) { // quaterly vat, we take last past complete quarter $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; - } elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) { // yearly vat + } elseif (getDolGlobalInt('MAIN_INFO_VAT_RETURN') == 3) { // yearly vat if ($current_date['mon'] < $conf->global->SOCIETE_FISCAL_MONTH_START) { if (($conf->global->SOCIETE_FISCAL_MONTH_START - $current_date['mon']) > 6) { // If period started from less than 6 years, we show past year $year_start--; @@ -61,7 +61,7 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e } $date_start = dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START, 'tzserver'); $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; - } elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) { // monthly vat, we take last past complete month + } elseif (getDolGlobalInt('MAIN_INFO_VAT_RETURN') == 1) { // monthly vat, we take last past complete month $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -1, 'm'); $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index bba9ced4ad6..647b397f9dd 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -248,7 +248,7 @@ if (empty($reshook)) { $action = 'create'; } - if (isModEnabled('mailing') && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && $object->no_email == -1 && !empty($object->email)) { + if (isModEnabled('mailing') && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && $object->no_email == -1 && !empty($object->email)) { $error++; $errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")); $action = 'create'; @@ -338,7 +338,7 @@ if (empty($reshook)) { $action = 'edit'; } - if (isModEnabled('mailing') && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && GETPOST("no_email", "int") == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (isModEnabled('mailing') && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && GETPOST("no_email", "int") == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $error++; $errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")); $action = 'edit'; @@ -759,7 +759,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { + if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1 || getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 2)) { print ''; } else { print ''; @@ -821,7 +821,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Unsubscribe if (isModEnabled('mailing')) { - if ($conf->use_javascript_ajax && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2) { + if ($conf->use_javascript_ajax && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2) { print "\n".''."\n"; } // Chart - if (empty($disableforlogin) && (empty($conf->global->MAIN_JS_GRAPH) || $conf->global->MAIN_JS_GRAPH == 'chart') && !defined('DISABLE_JS_GRAPH')) { + if (empty($disableforlogin) && (empty($conf->global->MAIN_JS_GRAPH) || getDolGlobalString('MAIN_JS_GRAPH') == 'chart') && !defined('DISABLE_JS_GRAPH')) { print ''."\n"; } @@ -1936,7 +1936,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr if (!$disablejs && !empty($conf->use_javascript_ajax)) { // CKEditor - if (empty($disableforlogin) && (isModEnabled('fckeditor') && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR')) { + if (empty($disableforlogin) && (isModEnabled('fckeditor') && (empty($conf->global->FCKEDITOR_EDITORNAME) || getDolGlobalString('FCKEDITOR_EDITORNAME') == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR')) { print ''."\n"; $pathckeditor = DOL_URL_ROOT.'/includes/ckeditor/ckeditor/'; $jsckeditor = 'ckeditor.js'; @@ -3235,7 +3235,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ if (!empty($conf->global->MAIN_BUGTRACK_ENABLELINK)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - if ($conf->global->MAIN_BUGTRACK_ENABLELINK == 'github') { + if (getDolGlobalString('MAIN_BUGTRACK_ENABLELINK') == 'github') { $bugbaseurl = 'https://github.com/Dolibarr/dolibarr/issues/new?labels=Bug'; $bugbaseurl .= '&title='; $bugbaseurl .= urlencode("Bug: "); diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index b87131a4135..ed28bc7d8b3 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -119,21 +119,21 @@ print ''; print ''.$langs->trans("MARGIN_TYPE").''; print ''; print ' global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == '1') { +if (getDolGlobalString('MARGIN_TYPE') == '1') { print 'checked '; } print '/> '; print $langs->trans('MargeType1'); print '
'; print ' global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == 'pmp') { +if (getDolGlobalString('MARGIN_TYPE') == 'pmp') { print 'checked '; } print '/> '; print $langs->trans('MargeType2'); print '
'; print ' global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == 'costprice') { +if (getDolGlobalString('MARGIN_TYPE') == 'costprice') { print 'checked '; } print '/> '; diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index f369f1889c2..7d893cbdf22 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -189,7 +189,7 @@ if (!empty($enddate)) { $sql .= " AND d.buy_price_ht IS NOT NULL"; // We should not use this here. Option ForceBuyingPriceIfNull should have effect only when inserting data. Once data is recorded, it must be used as it is for report. // We keep it with value ForceBuyingPriceIfNull = 2 for retroactive effect but results are unpredicable. -if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 2) { +if (getDolGlobalInt('ForceBuyingPriceIfNull') == 2) { $sql .= " AND d.buy_price_ht <> 0"; } //if ($agentid > 0) $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, u.rowid, u.login, u.lastname, u.firstname"; @@ -235,7 +235,7 @@ if ($result) { print '
'; print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1); - if ($conf->global->MARGIN_TYPE == "1") { + if (getDolGlobalString('MARGIN_TYPE') == "1") { $labelcostprice = 'BuyingPrice'; } else { // value is 'costprice' or 'pmp' $labelcostprice = 'CostPrice'; diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index 50b911ae036..f642e785b96 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -249,7 +249,7 @@ if ($result) { print '
'; print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit); - if ($conf->global->MARGIN_TYPE == "1") { + if (getDolGlobalString('MARGIN_TYPE') == "1") { $labelcostprice = 'BuyingPrice'; } else { // value is 'costprice' or 'pmp' $labelcostprice = 'CostPrice'; diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 93850b8ec10..33796bdb0d5 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -261,7 +261,7 @@ if (!empty($enddate)) { $sql .= " AND d.buy_price_ht IS NOT NULL"; // We should not use this here. Option ForceBuyingPriceIfNull should have effect only when inserting data. Once data is recorded, it must be used as it is for report. // We keep it with value ForceBuyingPriceIfNull = 2 for retroactive effect but results are unpredicable. -if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 2) { +if (getDolGlobalInt('ForceBuyingPriceIfNull') == 2) { $sql .= " AND d.buy_price_ht <> 0"; } if ($client) { @@ -305,7 +305,7 @@ if ($result) { print '
'; print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1); - if ($conf->global->MARGIN_TYPE == "1") { + if (getDolGlobalString('MARGIN_TYPE') == "1") { $labelcostprice = 'BuyingPrice'; } else { // value is 'costprice' or 'pmp' $labelcostprice = 'CostPrice'; diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 32cb3c9292d..12f932596da 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -217,7 +217,7 @@ if (!empty($enddate)) { $sql .= " AND d.buy_price_ht IS NOT NULL"; // We should not use this here. Option ForceBuyingPriceIfNull should have effect only when inserting data. Once data is recorded, it must be used as it is for report. // We keep it with value ForceBuyingPriceIfNull = 2 for retroactive effect but results are unpredicable. -if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 2) { +if (getDolGlobalInt('ForceBuyingPriceIfNull') == 2) { $sql .= " AND d.buy_price_ht <> 0"; } if ($id > 0) { @@ -256,7 +256,7 @@ if ($result) { print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1); //var_dump($conf->global->MARGIN_TYPE); - if ($conf->global->MARGIN_TYPE == "1") { + if (getDolGlobalString('MARGIN_TYPE') == "1") { $labelcostprice = 'BuyingPrice'; } else { // value is 'costprice' or 'pmp' $labelcostprice = 'CostPrice'; diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 1bda53b5c5d..1885ffbe2fb 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -169,7 +169,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " AND d.buy_price_ht IS NOT NULL"; // We should not use this here. Option ForceBuyingPriceIfNull should have effect only when inserting data. Once data is recorded, it must be used as it is for report. // We keep it with value ForceBuyingPriceIfNull = 2 for retroactive effect but results are unpredicable. - if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 2) { + if (getDolGlobalInt('ForceBuyingPriceIfNull') == 2) { $sql .= " AND d.buy_price_ht <> 0"; } $sql .= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.ref, f.total_ht, f.datef, f.paye, f.fk_statut, f.type"; diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 3202dcb93ce..975a927763b 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -186,7 +186,7 @@ if ($socid > 0) { $sql .= " AND d.buy_price_ht IS NOT NULL"; // We should not use this here. Option ForceBuyingPriceIfNull should have effect only when inserting data. Once data is recorded, it must be used as it is for report. // We keep it with value ForceBuyingPriceIfNull = 2 for retroactive effect but results are unpredicable. - if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 2) { + if (getDolGlobalInt('ForceBuyingPriceIfNull') == 2) { $sql .= " AND d.buy_price_ht <> 0"; } $sql .= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.ref, f.total_ht, f.datef, f.paye, f.fk_statut, f.type"; diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index db949620440..dae50bd07e2 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -89,17 +89,17 @@ function print_paypal_redirect($paymentAmount, $currencyCodeType, $paymentType, $solutionType = 'Sole'; $landingPage = 'Billing'; // For payment with Paypal only - if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'paypalonly') { + if (getDolGlobalString('PAYPAL_API_INTEGRAL_OR_PAYPALONLY') == 'paypalonly') { $solutionType = 'Mark'; $landingPage = 'Login'; } // For payment with Credit card or Paypal - if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'integral') { + if (getDolGlobalString('PAYPAL_API_INTEGRAL_OR_PAYPALONLY') == 'integral') { $solutionType = 'Sole'; $landingPage = 'Billing'; } // For payment with Credit card - if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'cconly') { + if (getDolGlobalString('PAYPAL_API_INTEGRAL_OR_PAYPALONLY') == 'cconly') { $solutionType = 'Sole'; $landingPage = 'Billing'; } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index dd8d06de73b..653b8e2b6d8 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1406,8 +1406,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $tooltip .= '
'.$langs->trans("GenericMaskCodes3"); $tooltip .= '
'.$langs->trans("GenericMaskCodes4a", $langs->transnoentities("Batch"), $langs->transnoentities("Batch")); $tooltip .= '
'.$langs->trans("GenericMaskCodes5"); - if ((!empty($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') - || (!empty($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced')) { + if ((getDolGlobalString('PRODUCTBATCH_LOT_ADDON') == 'mod_lot_advanced') + || (getDolGlobalString('PRODUCTBATCH_SN_ADDON') == 'mod_sn_advanced')) { print ''.$langs->trans("ManageLotMask").''; $inherited_mask_lot = getDolGlobalString('LOT_ADVANCED_MASK'); $inherited_mask_sn = getDolGlobalString('SN_ADVANCED_MASK'); @@ -1626,7 +1626,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // State if (empty($conf->global->PRODUCT_DISABLE_STATE)) { print ''; - if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { + if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1 || getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 2)) { print ''.$form->editfieldkey('RegionStateOrigin', 'state_id', '', $object, 0).''; } else { print ''.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).''; @@ -2189,7 +2189,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // State if (empty($conf->global->PRODUCT_DISABLE_STATE)) { print ''; - if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { + if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1 || getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 2)) { print ''.$form->editfieldkey('RegionStateOrigin', 'state_id', '', $object, 0).''; } else { print ''.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).''; @@ -2441,8 +2441,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("ManageLotSerial").''; print $object->getLibStatut(0, 2); print ''; - if ((($object->status_batch == '1' && !empty($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') - || ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced' && !empty($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS)))) { + if ((($object->status_batch == '1' && !empty($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) && getDolGlobalString('PRODUCTBATCH_LOT_ADDON') == 'mod_lot_advanced') + || ($object->status_batch == '2' && getDolGlobalString('PRODUCTBATCH_SN_ADDON') == 'mod_sn_advanced' && !empty($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS)))) { print ''.$langs->trans("ManageLotMask").''; print $object->batch_mask; print ''; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 748db4d1701..945d5303198 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -394,7 +394,7 @@ $title = $langs->trans("LeadsOrProjects"); if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $title = $langs->trans("Projects"); } -if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only +if (getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') == 2) { // 2 = leads only $title = $langs->trans("Leads"); } $morejs = array(); diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 0a304bb7aed..157248cb0b7 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -2135,12 +2135,12 @@ if ($action != 'dopayment') { print '
 
'; } print ' '; - if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'integral') { + if (getDolGlobalString('PAYPAL_API_INTEGRAL_OR_PAYPALONLY') == 'integral') { print '
'; print ''.$langs->trans("CreditOrDebitCard").' - '; print ''.$langs->trans("PayPalBalance").''; } - if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'paypalonly') { + if (getDolGlobalString('PAYPAL_API_INTEGRAL_OR_PAYPALONLY') == 'paypalonly') { //print '
'; //print ''.$langs->trans("PayPalBalance").'">'; } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 6b59c71d473..614d7fe99c4 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -571,11 +571,11 @@ if ($ispaymentok) { $emetteur_banque = ''; // Define default choice for complementary actions $option = ''; - if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) { + if (getDolGlobalString('ADHERENT_BANK_USE') == 'bankviainvoice' && isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) { $option = 'bankviainvoice'; - } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && isModEnabled("banque")) { + } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'bankdirect' && isModEnabled("banque")) { $option = 'bankdirect'; - } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) { + } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'invoiceonly' && isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) { $option = 'invoiceonly'; } if (empty($option)) { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 69960414e0b..eb3796b8730 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1307,7 +1307,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { document.formsoc.action.value="create"; document.formsoc.submit(); });'; - if ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2) { + if (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2) { print ' function init_check_no_email(input) { if (input.val()!="") { @@ -1653,7 +1653,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Unsubscribe if (isModEnabled('mailing')) { - if ($conf->use_javascript_ajax && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2) { + if ($conf->use_javascript_ajax && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2) { print "\n".'