diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index e7688ecbde0..da6eb26976d 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -64,7 +64,7 @@ $accountid = GETPOST('accountid', 'int') > 0 ? GETPOST('accountid', 'int') : 0; if (GETPOSTISSET('auto_create_paiement') || $action === 'add') { $auto_create_paiement = GETPOST("auto_create_paiement", "int"); } else { - $auto_create_paiement = empty($conf->global->CREATE_NEW_SALARY_WITHOUT_AUTO_PAYMENT); + $auto_create_paiement = !getDolGlobalString('CREATE_NEW_SALARY_WITHOUT_AUTO_PAYMENT'); } $datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int')); diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 8a284e6f99e..e4ca80e83fe 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -913,7 +913,7 @@ class PaymentSalary extends CommonObject $langs->load('salaries'); $datas = []; - if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { + if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { return ['optimize' => $langs->trans("SalaryPayment")]; } diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index 63e4ac6bb0c..41d975698e9 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -536,7 +536,7 @@ class Salary extends CommonObject $linkclose = ''; if (empty($notooltip)) { - if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { + if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { $label = $langs->trans("ShowMyObject"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 74c5705ea08..7d720cbc033 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -339,7 +339,7 @@ $num = $db->num_rows($resql); // Direct jump if only one record found -if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { +if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id); diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 0ae6ad89823..4b2d721a93f 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -212,7 +212,7 @@ if ($action == 'create') { print ''.$langs->trans("Date").''; $datepaye = dol_mktime(GETPOST("rehour", 'int'), GETPOST("remin", 'int'), GETPOST("resec", 'int'), GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int')); - $datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ? (GETPOST("remonth") ? $datepaye : -1) : ''; + $datepayment = !getDolGlobalString('MAIN_AUTOFILL_DATE') ? (GETPOST("remonth") ? $datepaye : -1) : ''; print $form->selectDate($datepayment, '', 1, 1, 0, "add_payment", 1, 1, 0, '', '', $salary->dateep, '', 1, $langs->trans("DateEnd")); print ""; print ''; diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php index 0623394ca56..10f98bdc210 100644 --- a/htdocs/salaries/stats/index.php +++ b/htdocs/salaries/stats/index.php @@ -53,7 +53,7 @@ $result = restrictedArea($user, 'salaries', '', '', ''); $nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); +$startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/salaries/virement_request.php b/htdocs/salaries/virement_request.php index 83f8868c05e..9654aa854a3 100644 --- a/htdocs/salaries/virement_request.php +++ b/htdocs/salaries/virement_request.php @@ -611,7 +611,7 @@ if ($resql) { } if ($type != 'bank-transfer') { - if (!empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT)) { + if (getDolGlobalString('STRIPE_SEPA_DIRECT_DEBIT')) { $langs->load("stripe"); if ($obj->fk_prelevement_bons > 0) { print '   '; @@ -619,7 +619,7 @@ if ($resql) { print 'rowid.'&id='.$object->id.'&type='.urlencode($type).'">'.img_picto('', 'stripe', 'class="pictofixedwidth"').$langs->trans("RequestDirectDebitWithStripe").''; } } else { - if (!empty($conf->global->STRIPE_SEPA_CREDIT_TRANSFER)) { + if (getDolGlobalString('STRIPE_SEPA_CREDIT_TRANSFER')) { $langs->load("stripe"); if ($obj->fk_prelevement_bons > 0) { print '   '; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 16102685e3e..3ab7103ef25 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -738,7 +738,7 @@ foreach ($profid as $key => $val) { print ''; print ''.$langs->trans('VATIntra')."\n"; -if (!empty($conf->global->SOCIETE_VAT_INTRA_UNIQUE)) { +if (getDolGlobalString('SOCIETE_VAT_INTRA_UNIQUE')) { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; @@ -821,7 +821,7 @@ print ''; print ''.$langs->trans("AddRefInList").''; print ' '; print ''; -if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { +if (getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { @@ -835,7 +835,7 @@ print ''; print ''.$langs->trans("AddVatInList").''; print ' '; print ''; -if (!empty($conf->global->SOCIETE_SHOW_VAT_IN_LIST)) { +if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST')) { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { @@ -849,7 +849,7 @@ print ''; print ''.$langs->trans("AddAdressInList").''; print ' '; print ''; -if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { +if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { @@ -863,7 +863,7 @@ print ''; print ''.$langs->trans("AddEmailPhoneTownInContactList").''; print ' '; print ''; -if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { +if (getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { @@ -879,7 +879,7 @@ if (isModEnabled("expedition")) { print ''.$langs->trans("AskForPreferredShippingMethod").''; print ' '; print ''; - if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) { + if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD')) { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { @@ -896,7 +896,7 @@ print ''; print ''.$langs->trans("DisableProspectCustomerType").''; print ' '; print ''; -if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { +if (getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { @@ -906,7 +906,7 @@ if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { print ''; print ''; -if (empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { +if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) { // Default Prospect/Customer thirdparty type on customer crĂ©ation print ''; print ''.$langs->trans("DefaultCustomerType").''; diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index e4a19b757ae..a32782fab17 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -123,7 +123,7 @@ if (empty($reshook)) { $form = new Form($db); $title = $langs->trans("Agenda"); -if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { +if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { $title = $object->name." - ".$title; } $help_url = ''; diff --git a/htdocs/societe/ajax/ajaxcompanies.php b/htdocs/societe/ajax/ajaxcompanies.php index aca9a4eaddb..203b40aaff2 100644 --- a/htdocs/societe/ajax/ajaxcompanies.php +++ b/htdocs/societe/ajax/ajaxcompanies.php @@ -88,18 +88,18 @@ if (! $socid) { } $sql = "SELECT s.rowid, s.nom, s.name_alias, s.code_client, s.code_fournisseur, s.address, s.zip, s.town, s.email, s.siren, s.siret, s.ape, s.idprof4, s.idprof5, s.idprof6, s.client, s.fournisseur, s.datec, s.logo"; -if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { +if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { $sql .= ", dictp.code as country_code"; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; -if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { +if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as dictp ON dictp.rowid = s.fk_pays"; } $sql .= " WHERE s.entity IN (".getEntity('societe').")"; if ($socid) { $sql .= " AND ("; // Add criteria on name/code - if (!empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)) { // Can use index + if (getDolGlobalString('COMPANY_DONOTSEARCH_ANYWHERE')) { // Can use index $sql .= "s.nom LIKE '".$db->escape($db->escapeforlike($socid))."%'"; $sql .= " OR s.name_alias LIKE '".$db->escape($db->escapeforlike($socid))."%'"; $sql .= " OR s.code_client LIKE '".$db->escape($db->escapeforlike($socid))."%'"; @@ -110,7 +110,7 @@ if ($socid) { $sql .= " OR s.code_client LIKE '%".$db->escape($db->escapeforlike($socid))."%'"; $sql .= " OR s.code_fournisseur LIKE '%".$db->escape($db->escapeforlike($socid))."%'"; } - if (!empty($conf->global->SOCIETE_ALLOW_SEARCH_ON_ROWID)) { + if (getDolGlobalString('SOCIETE_ALLOW_SEARCH_ON_ROWID')) { $sql .= " OR s.rowid = ".((int) $socid); } $sql .= ")"; @@ -127,7 +127,7 @@ $resql = $db->query($sql); if ($resql) { while ($row = $db->fetch_array($resql)) { $label = ''; - if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { + if (getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) { if (($row['client']) && (!empty($row['code_client']))) { $label = $row['code_client'].' - '; } @@ -138,7 +138,7 @@ if ($resql) { $label .= $row['nom']; - if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { + if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { $label .= ($row['address'] ? ' - '.$row['address'] : '').($row['zip'] ? ' - '.$row['zip'] : '').($row['town'] ? ' '.$row['town'] : ''); if (!empty($row['country_code'])) { $label .= ', '.$langs->trans('Country'.$row['country_code']); diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index d6b9b3f62b5..b9119174058 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -153,7 +153,7 @@ abstract class ActionsCardCommon } // Load object modCodeClient - $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + $module = (getDolGlobalString('SOCIETE_CODECLIENT_ADDON') ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { $module = substr($module, 0, dol_strlen($module) - 4); } diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php index 1ee7e003b2a..cd95285d75b 100644 --- a/htdocs/societe/canvas/company/actions_card_company.class.php +++ b/htdocs/societe/canvas/company/actions_card_company.class.php @@ -101,7 +101,7 @@ class ActionsCardCompany extends ActionsCardCommon $this->tpl['profid3'] = $this->object->idprof3; $this->tpl['profid4'] = $this->object->idprof4; - if ($conf->use_javascript_ajax && empty($conf->global->MAIN_DISABLEVATCHECK)) { + if ($conf->use_javascript_ajax && !getDolGlobalString('MAIN_DISABLEVATCHECK')) { $js = "\n"; $js .= '