';
$i = 0;
- while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
+ while ((!getDolGlobalString('BOOKMARKS_SHOW_IN_MENU') || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
$bookmarkList .= '
target == 1 ? ' target="_blank" rel="noopener noreferrer"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
$bookmarkList .= dol_escape_htmltag($obj->title);
$bookmarkList .= '';
diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php
index 58c74799904..7598114c9e2 100644
--- a/htdocs/core/boxes/box_actions.php
+++ b/htdocs/core/boxes/box_actions.php
@@ -217,7 +217,7 @@ class box_actions extends ModeleBoxes
global $langs, $conf;
$out = parent::showBox($this->info_box_head, $this->info_box_contents, 1);
- if (!empty($conf->global->SHOW_DIALOG_HOMEPAGE)) {
+ if (getDolGlobalString('SHOW_DIALOG_HOMEPAGE')) {
$actioncejour = false;
$contents = $this->info_box_contents;
if (is_countable($contents) && count($contents) > 0) {
diff --git a/htdocs/core/boxes/box_actions_future.php b/htdocs/core/boxes/box_actions_future.php
index 1a4c7584cc1..bcb09b8953d 100644
--- a/htdocs/core/boxes/box_actions_future.php
+++ b/htdocs/core/boxes/box_actions_future.php
@@ -220,7 +220,7 @@ class box_actions_future extends ModeleBoxes
global $langs, $conf;
$out = parent::showBox($this->info_box_head, $this->info_box_contents, 1);
- if (!empty($conf->global->SHOW_DIALOG_HOMEPAGE)) {
+ if (getDolGlobalString('SHOW_DIALOG_HOMEPAGE')) {
$actioncejour = false;
$contents = $this->info_box_contents;
if (is_countable($contents) && count($contents) > 0) {
diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php
index 21105904d9c..066d1eb7473 100644
--- a/htdocs/core/boxes/box_activity.php
+++ b/htdocs/core/boxes/box_activity.php
@@ -90,7 +90,7 @@ class box_activity extends ModeleBoxes
$savMAIN_ACTIVATE_FILECACHE = getDolGlobalInt('MAIN_ACTIVATE_FILECACHE');
$conf->global->MAIN_ACTIVATE_FILECACHE = 1;
- if (!empty($conf->global->MAIN_BOX_ACTIVITY_DURATION)) {
+ if (getDolGlobalString('MAIN_BOX_ACTIVITY_DURATION')) {
$nbofperiod = $conf->global->MAIN_BOX_ACTIVITY_DURATION;
}
diff --git a/htdocs/core/boxes/box_boms.php b/htdocs/core/boxes/box_boms.php
index e8acdf2c25c..0870411b8bd 100644
--- a/htdocs/core/boxes/box_boms.php
+++ b/htdocs/core/boxes/box_boms.php
@@ -135,7 +135,7 @@ class box_boms extends ModeleBoxes
'asis' => 1,
);
- if (!empty($conf->global->BOM_BOX_LAST_BOMS_SHOW_VALIDATE_USER)) {
+ if (getDolGlobalString('BOM_BOX_LAST_BOMS_SHOW_VALIDATE_USER')) {
if ($objp->fk_user_valid > 0) {
$userstatic->fetch($objp->fk_user_valid);
}
diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php
index 91dfcd395f1..62f62996dc9 100644
--- a/htdocs/core/boxes/box_clients.php
+++ b/htdocs/core/boxes/box_clients.php
@@ -61,7 +61,7 @@ class box_clients extends ModeleBoxes
$this->db = $db;
// disable box for such cases
- if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
+ if (getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) {
$this->enabled = 0; // disabled by this option
}
diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php
index a678b8f0e01..f67f00684ce 100644
--- a/htdocs/core/boxes/box_commandes.php
+++ b/htdocs/core/boxes/box_commandes.php
@@ -83,7 +83,7 @@ class box_commandes extends ModeleBoxes
$societestatic = new Societe($this->db);
$userstatic = new User($this->db);
- $this->info_box_head = array('text' => $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."CustomerOrders", $max));
+ $this->info_box_head = array('text' => $langs->trans("BoxTitleLast".(getDolGlobalString('MAIN_LASTBOX_ON_OBJECT_DATE') ? "" : "Modified")."CustomerOrders", $max));
if ($user->hasRight('commande', 'lire')) {
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
@@ -105,7 +105,7 @@ class box_commandes extends ModeleBoxes
}
$sql .= " WHERE c.fk_soc = s.rowid";
$sql .= " AND c.entity IN (".getEntity('commande').")";
- if (!empty($conf->global->ORDER_BOX_LAST_ORDERS_VALIDATED_ONLY)) {
+ if (getDolGlobalString('ORDER_BOX_LAST_ORDERS_VALIDATED_ONLY')) {
$sql .= " AND c.fk_statut = 1";
}
if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
@@ -114,7 +114,7 @@ class box_commandes extends ModeleBoxes
if ($user->socid) {
$sql .= " AND s.rowid = ".((int) $user->socid);
}
- if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) {
+ if (getDolGlobalString('MAIN_LASTBOX_ON_OBJECT_DATE')) {
$sql .= " ORDER BY c.date_commande DESC, c.ref DESC ";
} else {
$sql .= " ORDER BY c.tms DESC, c.ref DESC ";
@@ -168,7 +168,7 @@ class box_commandes extends ModeleBoxes
'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
);
- if (!empty($conf->global->ORDER_BOX_LAST_ORDERS_SHOW_VALIDATE_USER)) {
+ if (getDolGlobalString('ORDER_BOX_LAST_ORDERS_SHOW_VALIDATE_USER')) {
if ($objp->fk_user_valid > 0) {
$userstatic->fetch($objp->fk_user_valid);
}
diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php
index bd39bb7da8c..c7ced94d5ea 100644
--- a/htdocs/core/boxes/box_contacts.php
+++ b/htdocs/core/boxes/box_contacts.php
@@ -92,7 +92,7 @@ class box_contacts extends ModeleBoxes
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
- if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
+ if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
$sql .= ", spe.accountancy_code_customer as code_compta";
$sql .= ", spe.accountancy_code_supplier as code_compta_fournisseur";
} else {
@@ -104,7 +104,7 @@ class box_contacts extends ModeleBoxes
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON sp.fk_pays = co.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid";
- if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
+ if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
}
if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php
index 95985fe688e..879e2b4f78d 100644
--- a/htdocs/core/boxes/box_contracts.php
+++ b/htdocs/core/boxes/box_contracts.php
@@ -97,7 +97,7 @@ class box_contracts extends ModeleBoxes
if ($user->socid) {
$sql .= " AND s.rowid = ".((int) $user->socid);
}
- if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) {
+ if (getDolGlobalString('MAIN_LASTBOX_ON_OBJECT_DATE')) {
$sql .= " ORDER BY c.date_contrat DESC, c.ref DESC ";
} else {
$sql .= " ORDER BY c.tms DESC, c.ref DESC ";
diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php
index eee1900c628..ce3a0978bce 100644
--- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php
+++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php
@@ -61,7 +61,7 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes
$this->db = $db;
// disable box for such cases
- if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
+ if (getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) {
$this->enabled = 0; // disabled by this option
}
diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php
index 4587e026968..24b45a753f0 100644
--- a/htdocs/core/boxes/box_dolibarr_state_board.php
+++ b/htdocs/core/boxes/box_dolibarr_state_board.php
@@ -75,7 +75,7 @@ class box_dolibarr_state_board extends ModeleBoxes
$this->max = $max;
$this->info_box_head = array('text' => $langs->trans("DolibarrStateBoard"));
- if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) {
+ if (empty($user->socid) && !getDolGlobalString('MAIN_DISABLE_GLOBAL_BOXSTATS')) {
$hookmanager = new HookManager($this->db);
$hookmanager->initHooks(array('index'));
$object = new stdClass();
@@ -114,13 +114,13 @@ class box_dolibarr_state_board extends ModeleBoxes
$conditions = array(
'users' => $user->hasRight('user', 'user', 'lire'),
'members' => isModEnabled('adherent') && $user->hasRight('adherent', 'lire'),
- 'customers' => isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS),
- 'prospects' => isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS),
- 'suppliers' => ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight('fournisseur', 'lire'))
+ 'customers' => isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS_STATS'),
+ 'prospects' => isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS_STATS'),
+ 'suppliers' => ((isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'lire'))
|| (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire'))
|| (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))
)
- && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
+ && !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_STATS'),
'contacts' => isModEnabled('societe') && $user->hasRight('societe', 'contact', 'lire'),
'products' => isModEnabled('product') && $user->hasRight('product', 'read'),
'services' => isModEnabled('service') && $user->hasRight('service', 'read'),
@@ -130,9 +130,9 @@ class box_dolibarr_state_board extends ModeleBoxes
'donations' => isModEnabled('don') && $user->hasRight('don', 'lire'),
'contracts' => isModEnabled('contrat') && $user->hasRight('contrat', 'lire'),
'interventions' => isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire'),
- 'supplier_orders' => isModEnabled('supplier_order') && $user->hasRight('fournisseur', 'commande', 'lire') && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS),
- 'supplier_invoices' => isModEnabled('supplier_invoice') && $user->hasRight('fournisseur', 'facture', 'lire') && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS),
- 'supplier_proposals' => isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire') && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS),
+ 'supplier_orders' => isModEnabled('supplier_order') && $user->hasRight('fournisseur', 'commande', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS'),
+ 'supplier_invoices' => isModEnabled('supplier_invoice') && $user->hasRight('fournisseur', 'facture', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS'),
+ 'supplier_proposals' => isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS'),
'projects' => isModEnabled('project') && $user->hasRight('projet', 'lire'),
'expensereports' => isModEnabled('expensereport') && $user->hasRight('expensereport', 'lire'),
'holidays' => isModEnabled('holiday') && $user->hasRight('holiday', 'read'),
diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php
index eb0b5d1d4aa..0b6350401b9 100644
--- a/htdocs/core/boxes/box_factures.php
+++ b/htdocs/core/boxes/box_factures.php
@@ -81,7 +81,7 @@ class box_factures extends ModeleBoxes
$langs->load("bills");
- $text = $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."CustomerBills", $max);
+ $text = $langs->trans("BoxTitleLast".(getDolGlobalString('MAIN_LASTBOX_ON_OBJECT_DATE') ? "" : "Modified")."CustomerBills", $max);
$this->info_box_head = array(
'text' => $text,
'limit'=> dol_strlen($text)
@@ -116,7 +116,7 @@ class box_factures extends ModeleBoxes
}
$sql .= " GROUP BY s.rowid, s.nom, s.name_alias, s.code_client, s.code_compta, s.client, s.logo, s.email, s.entity, s.tva_intra, s.siren, s.siret, s.ape, s.idprof4, s.idprof5, s.idprof6,";
$sql .= " f.rowid, f.ref, f.type, f.total_ht, f.total_tva, f.total_ttc, f.datef, f.paye, f.fk_statut, f.datec, f.tms, f.date_lim_reglement";
- if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) {
+ if (getDolGlobalString('MAIN_LASTBOX_ON_OBJECT_DATE')) {
$sql .= " ORDER BY f.datef DESC, f.ref DESC ";
} else {
$sql .= " ORDER BY f.tms DESC, f.ref DESC ";
diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php
index 3b35eb98f13..6954b54a8d7 100644
--- a/htdocs/core/boxes/box_factures_fourn.php
+++ b/htdocs/core/boxes/box_factures_fourn.php
@@ -81,7 +81,7 @@ class box_factures_fourn extends ModeleBoxes
$thirdpartystatic = new Fournisseur($this->db);
$this->info_box_head = array(
- 'text' => $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."SupplierBills", $max)
+ 'text' => $langs->trans("BoxTitleLast".(getDolGlobalString('MAIN_LASTBOX_ON_OBJECT_DATE') ? "" : "Modified")."SupplierBills", $max)
);
if ($user->hasRight('fournisseur', 'facture', 'lire')) {
@@ -111,7 +111,7 @@ class box_factures_fourn extends ModeleBoxes
if ($user->socid) {
$sql .= " AND s.rowid = ".((int) $user->socid);
}
- if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) {
+ if (getDolGlobalString('MAIN_LASTBOX_ON_OBJECT_DATE')) {
$sql .= " ORDER BY f.datef DESC, f.ref DESC ";
} else {
$sql .= " ORDER BY f.tms DESC, f.ref DESC ";
diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php
index d96a4b53eee..01deb479385 100644
--- a/htdocs/core/boxes/box_factures_imp.php
+++ b/htdocs/core/boxes/box_factures_imp.php
@@ -90,7 +90,7 @@ class box_factures_imp extends ModeleBoxes
if ($user->hasRight('facture', 'lire')) {
$sql1 = "SELECT s.rowid as socid, s.nom as name, s.name_alias, s.code_client, s.client";
- if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
+ if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
$sql1 .= ", spe.accountancy_code_customer as code_compta";
} else {
$sql1 .= ", s.code_compta";
@@ -106,7 +106,7 @@ class box_factures_imp extends ModeleBoxes
$sql1 .= ", f.paye, f.fk_statut as status, f.rowid as facid";
$sql1 .= ", SUM(pf.amount) as am";
$sql2 = " FROM ".MAIN_DB_PREFIX."societe as s";
- if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
+ if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
$sql2 .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
}
if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
@@ -125,7 +125,7 @@ class box_factures_imp extends ModeleBoxes
$sql2 .= " AND s.rowid = ".((int) $user->socid);
}
$sql3 = " GROUP BY s.rowid, s.nom, s.name_alias, s.code_client, s.client, s.logo, s.email, s.entity, s.tva_intra, s.siren, s.siret, s.ape, s.idprof4, s.idprof5, s.idprof6,";
- if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
+ if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
$sql3 .= " spe.accountancy_code_customer as code_compta,";
} else {
$sql3 .= " s.code_compta,";
diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php
index 208836572da..ff74e00e8e5 100644
--- a/htdocs/core/boxes/box_goodcustomers.php
+++ b/htdocs/core/boxes/box_goodcustomers.php
@@ -62,10 +62,10 @@ class box_goodcustomers extends ModeleBoxes
$this->db = $db;
// disable box for such cases
- if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
+ if (getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) {
$this->enabled = 0; // disabled by this option
}
- if (empty($conf->global->MAIN_BOX_ENABLE_BEST_CUSTOMERS)) {
+ if (!getDolGlobalString('MAIN_BOX_ENABLE_BEST_CUSTOMERS')) {
$this->enabled = 0; // not enabled by default. Very slow on large database
}
diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php
index 49099019737..c7d1e01b2a1 100644
--- a/htdocs/core/boxes/box_graph_invoices_permonth.php
+++ b/htdocs/core/boxes/box_graph_invoices_permonth.php
@@ -77,7 +77,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
//$facturestatic=new Facture($this->db);
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
- if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) {
+ if (!getDolGlobalString('GRAPH_USE_FISCAL_YEAR')) {
$startmonth = 1;
}
@@ -131,7 +131,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
if (empty($endyear)) {
$endyear = $nowarray['year'];
}
- $startyear = $endyear - (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 2 : ($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH - 1));
+ $startyear = $endyear - (!getDolGlobalString('MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH') ? 2 : ($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH - 1));
$mode = 'customer';
$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320';
diff --git a/htdocs/core/boxes/box_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php
index d0e9bfea937..0a931bbf2a2 100644
--- a/htdocs/core/boxes/box_graph_invoices_peryear.php
+++ b/htdocs/core/boxes/box_graph_invoices_peryear.php
@@ -75,7 +75,7 @@ class box_graph_invoices_peryear extends ModeleBoxes
//$facturestatic=new Facture($this->db);
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
- if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1;
+ if (!getDolGlobalString('GRAPH_USE_FISCAL_YEAR')) $startmonth = 1;
$text = $langs->trans("Turnover", $max);
$this->info_box_head = array(
@@ -115,7 +115,7 @@ class box_graph_invoices_peryear extends ModeleBoxes
if (empty($showtot)) { $showtot = 1; }
$nowarray = dol_getdate(dol_now(), true);
if (empty($endyear)) $endyear = $nowarray['year'];
- $numberyears = (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 5 : $conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH);
+ $numberyears = (!getDolGlobalString('MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH') ? 5 : $conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH);
$startyear = $endyear - $numberyears;
$mode = 'customer';
diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
index c2efefe36a9..fe157a168ae 100644
--- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
+++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
@@ -76,7 +76,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
- if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) {
+ if (!getDolGlobalString('GRAPH_USE_FISCAL_YEAR')) {
$startmonth = 1;
}
@@ -128,7 +128,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
if (empty($endyear)) {
$endyear = $nowarray['year'];
}
- $startyear = $endyear - (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 2 : ($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH - 1));
+ $startyear = $endyear - (!getDolGlobalString('MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH') ? 2 : ($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH - 1));
$mode = 'supplier';
$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320';
diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php
index 7290dba1704..e0233fbd14b 100644
--- a/htdocs/core/boxes/box_graph_orders_permonth.php
+++ b/htdocs/core/boxes/box_graph_orders_permonth.php
@@ -77,7 +77,7 @@ class box_graph_orders_permonth extends ModeleBoxes
//$commandestatic=new Commande($this->db);
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
- if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) {
+ if (!getDolGlobalString('GRAPH_USE_FISCAL_YEAR')) {
$startmonth = 1;
}
@@ -131,7 +131,7 @@ class box_graph_orders_permonth extends ModeleBoxes
if (empty($endyear)) {
$endyear = $nowarray['year'];
}
- $startyear = $endyear - (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 2 : ($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH - 1));
+ $startyear = $endyear - (!getDolGlobalString('MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH') ? 2 : ($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH - 1));
$mode = 'customer';
$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320';
diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php
index 2361164e15d..6f883c11b28 100644
--- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php
+++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php
@@ -76,7 +76,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
- if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) {
+ if (!getDolGlobalString('GRAPH_USE_FISCAL_YEAR')) {
$startmonth = 1;
}
@@ -130,7 +130,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
if (empty($endyear)) {
$endyear = $nowarray['year'];
}
- $startyear = $endyear - (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 2 : ($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH - 1));
+ $startyear = $endyear - (!getDolGlobalString('MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH') ? 2 : ($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH - 1));
$mode = 'supplier';
$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320';
diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php
index b442d136306..84a4184cdc4 100644
--- a/htdocs/core/boxes/box_graph_propales_permonth.php
+++ b/htdocs/core/boxes/box_graph_propales_permonth.php
@@ -77,7 +77,7 @@ class box_graph_propales_permonth extends ModeleBoxes
//$propalstatic=new Propal($this->db);
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
- if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) {
+ if (!getDolGlobalString('GRAPH_USE_FISCAL_YEAR')) {
$startmonth = 1;
}
@@ -131,7 +131,7 @@ class box_graph_propales_permonth extends ModeleBoxes
if (empty($endyear)) {
$endyear = $nowarray['year'];
}
- $startyear = $endyear - (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 2 : ($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH - 1));
+ $startyear = $endyear - (!getDolGlobalString('MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH') ? 2 : ($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH - 1));
$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320';
$HEIGHT = '192';
diff --git a/htdocs/core/boxes/box_mos.php b/htdocs/core/boxes/box_mos.php
index a4ab7eb934c..505ba41acbc 100644
--- a/htdocs/core/boxes/box_mos.php
+++ b/htdocs/core/boxes/box_mos.php
@@ -132,7 +132,7 @@ class box_mos extends ModeleBoxes
'asis' => 1,
);
- if (!empty($conf->global->MRP_BOX_LAST_MOS_SHOW_VALIDATE_USER)) {
+ if (getDolGlobalString('MRP_BOX_LAST_MOS_SHOW_VALIDATE_USER')) {
if ($objp->fk_user_valid > 0) {
$userstatic->fetch($objp->fk_user_valid);
}
diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php
index 9c6208808a1..b88da90ec7a 100644
--- a/htdocs/core/boxes/box_propales.php
+++ b/htdocs/core/boxes/box_propales.php
@@ -81,7 +81,7 @@ class box_propales extends ModeleBoxes
$propalstatic = new Propal($this->db);
$societestatic = new Societe($this->db);
- $this->info_box_head = array('text' => $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."Propals", $max));
+ $this->info_box_head = array('text' => $langs->trans("BoxTitleLast".(getDolGlobalString('MAIN_LASTBOX_ON_OBJECT_DATE') ? "" : "Modified")."Propals", $max));
if ($user->hasRight('propal', 'lire')) {
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
@@ -100,7 +100,7 @@ class box_propales extends ModeleBoxes
if ($user->socid) {
$sql .= " AND s.rowid = ".((int) $user->socid);
}
- if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) {
+ if (getDolGlobalString('MAIN_LASTBOX_ON_OBJECT_DATE')) {
$sql .= " ORDER BY p.datep DESC, p.ref DESC ";
} else {
$sql .= " ORDER BY p.tms DESC, p.ref DESC ";
diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php
index 0791f68185e..3528baa7bec 100644
--- a/htdocs/core/boxes/box_prospect.php
+++ b/htdocs/core/boxes/box_prospect.php
@@ -63,7 +63,7 @@ class box_prospect extends ModeleBoxes
$this->db = $db;
// disable box for such cases
- if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
+ if (getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) {
$this->enabled = 0; // disabled by this option
}
diff --git a/htdocs/core/boxes/box_shipments.php b/htdocs/core/boxes/box_shipments.php
index ffaf9190b80..184eaac13ac 100644
--- a/htdocs/core/boxes/box_shipments.php
+++ b/htdocs/core/boxes/box_shipments.php
@@ -105,7 +105,7 @@ class box_shipments extends ModeleBoxes
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
}
$sql .= " WHERE e.entity IN (".getEntity('expedition').")";
- if (!empty($conf->global->ORDER_BOX_LAST_SHIPMENTS_VALIDATED_ONLY)) {
+ if (getDolGlobalString('ORDER_BOX_LAST_SHIPMENTS_VALIDATED_ONLY')) {
$sql .= " AND e.fk_statut = 1";
}
if ($user->socid > 0) {
diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php
index 0a93660dbeb..9b6e965decc 100644
--- a/htdocs/core/boxes/box_supplier_orders.php
+++ b/htdocs/core/boxes/box_supplier_orders.php
@@ -79,7 +79,7 @@ class box_supplier_orders extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
$thirdpartystatic = new Fournisseur($this->db);
- $this->info_box_head = array('text' => $langs->trans("BoxTitleLatest".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."SupplierOrders", $max));
+ $this->info_box_head = array('text' => $langs->trans("BoxTitleLatest".(getDolGlobalString('MAIN_LASTBOX_ON_OBJECT_DATE') ? "" : "Modified")."SupplierOrders", $max));
if ($user->hasRight('fournisseur', 'commande', 'lire')) {
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
@@ -103,7 +103,7 @@ class box_supplier_orders extends ModeleBoxes
if ($user->socid) {
$sql .= " AND s.rowid = ".((int) $user->socid);
}
- if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) {
+ if (getDolGlobalString('MAIN_LASTBOX_ON_OBJECT_DATE')) {
$sql .= " ORDER BY c.date_commande DESC, c.ref DESC ";
} else {
$sql .= " ORDER BY c.tms DESC, c.ref DESC ";
diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php
index c2984fb1b12..b3cd40f1741 100644
--- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php
+++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php
@@ -105,7 +105,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
if ($user->socid) {
$sql .= " AND s.rowid = ".((int) $user->socid);
}
- if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) {
+ if (getDolGlobalString('MAIN_LASTBOX_ON_OBJECT_DATE')) {
$sql .= " ORDER BY c.date_commande DESC, c.ref DESC";
} else {
$sql .= " ORDER BY c.date_livraison ASC, c.fk_statut ASC";
diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php
index 86b38495465..70dd49083f8 100644
--- a/htdocs/core/boxes/box_task.php
+++ b/htdocs/core/boxes/box_task.php
@@ -64,7 +64,7 @@ class box_task extends ModeleBoxes
$this->boxlabel = "Tasks";
$this->db = $db;
- $this->hidden = (!empty($conf->global->PROJECT_HIDE_TASKS) || empty($user->rights->projet->lire));
+ $this->hidden = (getDolGlobalString('PROJECT_HIDE_TASKS') || empty($user->rights->projet->lire));
}
/**
diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php
index 1e76abfbfee..c091c707fd2 100644
--- a/htdocs/core/boxes/modules_boxes.php
+++ b/htdocs/core/boxes/modules_boxes.php
@@ -374,7 +374,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
$out .= "
\n";
$out .= "\n\n";
- if (!empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
+ if (getDolGlobalString('MAIN_ACTIVATE_FILECACHE')) {
dol_filecache($cachedir, $filename, $out);
}
} else {
diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php
index 4e2201cf638..c74f030556e 100644
--- a/htdocs/core/db/pgsql.class.php
+++ b/htdocs/core/db/pgsql.class.php
@@ -323,7 +323,7 @@ class DoliDBPgsql extends DoliDB
// To have postgresql case sensitive
$count_like = 0;
$line = str_replace(' LIKE \'', ' ILIKE \'', $line, $count_like);
- if (!empty($conf->global->PSQL_USE_UNACCENT) && $count_like > 0) {
+ if (getDolGlobalString('PSQL_USE_UNACCENT') && $count_like > 0) {
// @see https://docs.postgresql.fr/11/unaccent.html : 'unaccent()' function must be installed before
$line = preg_replace('/\s+(\(+\s*)([a-zA-Z0-9\-\_\.]+) ILIKE /', ' \1unaccent(\2) ILIKE ', $line);
}
@@ -521,7 +521,7 @@ class DoliDBPgsql extends DoliDB
$query = $this->convertSQLFromMysql($query, $type, ($this->unescapeslashquot && $this->standard_conforming_strings));
//print "After convertSQLFromMysql:\n".$query."';
// Define link to login card
$appli = constant('DOL_APPLICATION_TITLE');
-if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
+if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
$appli = $conf->global->MAIN_APPLICATION_TITLE;
if (preg_match('/\d\.\d/', $appli)) {
if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
@@ -88,7 +88,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) {
}
$logouttext = '';
-if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
+if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
//$logouthtmltext=$appli.'
';
if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') {
$logouthtmltext .= $langs->trans("Logout").'
';
diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php
index 0b8a72afece..ba9496cc803 100644
--- a/htdocs/core/get_menudiv.php
+++ b/htdocs/core/get_menudiv.php
@@ -237,10 +237,10 @@ $(document).ready(function(){
if (empty($user->socid)) { // If internal user or not defined
- $conf->standard_menu = (empty($conf->global->MAIN_MENU_STANDARD_FORCED) ? (empty($conf->global->MAIN_MENU_STANDARD) ? 'eldy_menu.php' : $conf->global->MAIN_MENU_STANDARD) : $conf->global->MAIN_MENU_STANDARD_FORCED);
+ $conf->standard_menu = (!getDolGlobalString('MAIN_MENU_STANDARD_FORCED') ? (!getDolGlobalString('MAIN_MENU_STANDARD') ? 'eldy_menu.php' : $conf->global->MAIN_MENU_STANDARD) : $conf->global->MAIN_MENU_STANDARD_FORCED);
} else // If external user
{
- $conf->standard_menu = (empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED) ? (empty($conf->global->MAIN_MENUFRONT_STANDARD) ? 'eldy_menu.php' : $conf->global->MAIN_MENUFRONT_STANDARD) : $conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
+ $conf->standard_menu = (!getDolGlobalString('MAIN_MENUFRONT_STANDARD_FORCED') ? (!getDolGlobalString('MAIN_MENUFRONT_STANDARD') ? 'eldy_menu.php' : $conf->global->MAIN_MENUFRONT_STANDARD) : $conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
}
// Load the menu manager (only if not already done)
diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php
index 9e7e8841bb5..e9356596653 100644
--- a/htdocs/core/js/lib_head.js.php
+++ b/htdocs/core/js/lib_head.js.php
@@ -1277,7 +1277,7 @@ function price2numjs(amount) {
global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUERY_JNOTIFY')) {
+if (!getDolGlobalString('MAIN_DISABLE_JQUERY_JNOTIFY') && !defined('DISABLE_JQUERY_JNOTIFY')) {
?>
// Defined properties for JNotify
$(document).ready(function() {
@@ -1326,7 +1326,7 @@ jQuery(document).ready(function() {
*/
global->MAIN_DISABLE_SELECT2_FOCUS_PROTECTION) && !defined('DISABLE_SELECT2_FOCUS_PROTECTION')) {
+if (!getDolGlobalString('MAIN_DISABLE_SELECT2_FOCUS_PROTECTION') && !defined('DISABLE_SELECT2_FOCUS_PROTECTION')) {
?>
$(document).on('select2:open', (e) => {
console.log("Execute the focus (click on combo or use space when on component");
diff --git a/htdocs/core/js/lib_notification.js.php b/htdocs/core/js/lib_notification.js.php
index 168bd23eb7b..d3403298691 100644
--- a/htdocs/core/js/lib_notification.js.php
+++ b/htdocs/core/js/lib_notification.js.php
@@ -89,7 +89,7 @@ if ("Notification" in window) {
// We set a delay before launching first test so next check will arrive after the time_auto_update compared to previous one.
//var time_first_execution = (time_auto_update + (time_js_next_test - nowtime)) * 1000; //need milliseconds
- var time_first_execution = global->MAIN_BROWSER_NOTIFICATION_CHECK_FIRST_EXECUTION) ? 0 : $conf->global->MAIN_BROWSER_NOTIFICATION_CHECK_FIRST_EXECUTION); ?>;
+ var time_first_execution = global->MAIN_BROWSER_NOTIFICATION_CHECK_FIRST_EXECUTION); ?>;
setTimeout(first_execution, time_first_execution * 1000); // Launch a first execution after a time_first_execution delay
time_js_next_test = nowtime + time_first_execution;
@@ -138,7 +138,7 @@ function check_events() {
console.log("Retrieved "+arrayofpastreminders.length+" reminders to do.");
var audio = null;
global->AGENDA_REMINDER_BROWSER_SOUND)) {
+ if (getDolGlobalString('AGENDA_REMINDER_BROWSER_SOUND')) {
print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav\');';
}
?>
diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php
index 08ec7f062e3..b8d700ffb93 100644
--- a/htdocs/core/lib/accounting.lib.php
+++ b/htdocs/core/lib/accounting.lib.php
@@ -99,7 +99,7 @@ function length_accountg($account)
return '';
}
- if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
+ if (getDolGlobalString('ACCOUNTING_MANAGE_ZERO')) {
return $account;
}
@@ -138,7 +138,7 @@ function length_accounta($accounta)
return '';
}
- if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
+ if (getDolGlobalString('ACCOUNTING_MANAGE_ZERO')) {
return $accounta;
}
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index f9de3625647..a25e0d4b26e 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -843,7 +843,7 @@ function security_prepare_head()
$sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous"
$sql .= " AND entity = ".((int) $conf->entity);
$sql .= " AND bydefault = 1";
- if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
+ if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
$sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is not enabled
}
$resql = $db->query($sql);
@@ -859,7 +859,7 @@ function security_prepare_head()
$head[$h][0] = DOL_URL_ROOT."/admin/perms.php";
$head[$h][1] = $langs->trans("DefaultRights");
if ($nbPerms > 0) {
- $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '
'.$nbPerms.'' : '');
+ $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '
'.$nbPerms.'' : '');
}
$head[$h][2] = 'default';
$h++;
diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php
index 1a49715dac3..17b639f0c2d 100644
--- a/htdocs/core/lib/agenda.lib.php
+++ b/htdocs/core/lib/agenda.lib.php
@@ -73,11 +73,11 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '
';
// Type
$multiselect = 0;
- if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) { // We use an option here because it adds bugs when used on agenda page "peruser" and "list"
- $multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE));
+ if (getDolGlobalString('MAIN_ENABLE_MULTISELECT_TYPE')) { // We use an option here because it adds bugs when used on agenda page "peruser" and "list"
+ $multiselect = (getDolGlobalString('AGENDA_USE_EVENT_TYPE'));
}
print img_picto($langs->trans("ActionType"), 'square', 'class="pictofixedwidth inline-block" style="color: #ddd;"');
- print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect, 0, 'maxwidth500 widthcentpercentminusx');
+ print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? 1 : -1), 0, $multiselect, 0, 'maxwidth500 widthcentpercentminusx');
print '
';
if ($canedit) {
@@ -441,7 +441,7 @@ function actions_prepare_head($object)
$nbResources = (is_array($listofresourcelinked) ?count($listofresourcelinked) : 0);
$head[$h][1] = $langs->trans("Resources");
if ($nbResources > 0) {
- $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '
'.($nbResources).'' : '');
+ $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '
'.($nbResources).'' : '');
}
$head[$h][2] = 'resources';
$h++;
@@ -456,7 +456,7 @@ function actions_prepare_head($object)
$head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$object->id;
$head[$h][1] = $langs->trans("Documents");
if (($nbFiles + $nbLinks) > 0) {
- $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '
'.($nbFiles + $nbLinks).'' : '');
+ $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '
'.($nbFiles + $nbLinks).'' : '');
}
$head[$h][2] = 'documents';
$h++;
@@ -508,7 +508,7 @@ function calendars_prepare_head($param)
$h++;
//if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
- if (!empty($conf->global->AGENDA_SHOW_PERTYPE)) {
+ if (getDolGlobalString('AGENDA_SHOW_PERTYPE')) {
$head[$h][0] = DOL_URL_ROOT.'/comm/action/pertype.php'.($param ? '?'.$param : '');
$head[$h][1] = $langs->trans("ViewPerType");
$head[$h][2] = 'cardpertype';
diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php
index e5f16cbbaf4..3f152cf404e 100644
--- a/htdocs/core/lib/ajax.lib.php
+++ b/htdocs/core/lib/ajax.lib.php
@@ -194,7 +194,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
$("#'.$htmlnamejquery.'").attr("data-tvatx", ui.item.tva_tx);
$("#'.$htmlnamejquery.'").attr("data-default-vat-code", ui.item.default_vat_code);
';
- if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
+ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
$script .= '
// For customer price when PRODUIT_CUSTOMER_PRICES_BY_QTY is on
console.log("PRODUIT_CUSTOMER_PRICES_BY_QTY is on, propagate also prices by quantity into data-pbqxxx properties");
@@ -451,20 +451,20 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete =
global $conf;
// select2 can be disabled for smartphones
- if (!empty($conf->browser->layout) && $conf->browser->layout == 'phone' && !empty($conf->global->MAIN_DISALLOW_SELECT2_WITH_SMARTPHONE)) {
+ if (!empty($conf->browser->layout) && $conf->browser->layout == 'phone' && getDolGlobalString('MAIN_DISALLOW_SELECT2_WITH_SMARTPHONE')) {
return '';
}
- if (!empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) {
+ if (getDolGlobalString('MAIN_DISABLE_AJAX_COMBOX')) {
return '';
}
if (empty($conf->use_javascript_ajax)) {
return '';
}
- if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) {
+ if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
return '';
}
- if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
+ if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
return '';
}
diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php
index bfa95ce9c0a..455230cdb65 100644
--- a/htdocs/core/lib/asset.lib.php
+++ b/htdocs/core/lib/asset.lib.php
@@ -135,7 +135,7 @@ function assetPrepareHead(Asset $object)
$head[$h][0] = DOL_URL_ROOT . '/asset/note.php?id=' . $object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) {
- $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '
' . $nbNote . '' : '');
+ $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '
' . $nbNote . '' : '');
}
$head[$h][2] = 'note';
$h++;
@@ -215,7 +215,7 @@ function assetModelPrepareHead($object)
$head[$h][0] = DOL_URL_ROOT . '/asset/model/note.php?id=' . $object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) {
- $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '
' . $nbNote . '' : '');
+ $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '
' . $nbNote . '' : '');
}
$head[$h][2] = 'note';
$h++;
diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php
index f568ecb603f..9dc327edf8f 100644
--- a/htdocs/core/lib/bank.lib.php
+++ b/htdocs/core/lib/bank.lib.php
@@ -68,7 +68,7 @@ function bank_prepare_head(Account $object)
$head[$h][2] = 'graph';
$h++;
- if ($object->courant != Account::TYPE_CASH || !empty($conf->global->BANK_CAN_RECONCILIATE_CASHACCOUNT)) {
+ if ($object->courant != Account::TYPE_CASH || getDolGlobalString('BANK_CAN_RECONCILIATE_CASHACCOUNT')) {
$nbReceipts = 0;
// List of all standing receipts
diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php
index 01358e0753d..5ccf8c70af3 100644
--- a/htdocs/core/lib/barcode.lib.php
+++ b/htdocs/core/lib/barcode.lib.php
@@ -60,7 +60,7 @@ if (defined('PHP-BARCODE_PATH_COMMAND')) {
$genbarcode_loc = constant('PHP-BARCODE_PATH_COMMAND');
} else {
$genbarcode_loc = '';
- if (!empty($conf->global->GENBARCODE_LOCATION)) {
+ if (getDolGlobalString('GENBARCODE_LOCATION')) {
$genbarcode_loc = $conf->global->GENBARCODE_LOCATION;
}
}
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 604f16c41f3..a07af1797f0 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -52,8 +52,8 @@ function societe_prepare_head(Societe $object)
$head[$h][2] = 'card';
$h++;
- if (empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) {
- if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->hasRight('societe', 'contact', 'lire')) {
+ if (!getDolGlobalString('MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES')) {
+ if (!getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB') && $user->hasRight('societe', 'contact', 'lire')) {
//$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$nbContact = 0;
// Enable caching of thirdrparty count Contacts
@@ -106,19 +106,19 @@ function societe_prepare_head(Societe $object)
if ($object->client == 1 || $object->client == 2 || $object->client == 3) {
$head[$h][0] = DOL_URL_ROOT.'/comm/card.php?socid='.$object->id;
$head[$h][1] = '';
- if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && ($object->client == 2 || $object->client == 3)) {
+ if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && ($object->client == 2 || $object->client == 3)) {
$head[$h][1] .= $langs->trans("Prospect");
}
- if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && $object->client == 3) {
+ if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && $object->client == 3) {
$head[$h][1] .= ' | ';
}
- if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && ($object->client == 1 || $object->client == 3)) {
+ if (!getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && ($object->client == 1 || $object->client == 3)) {
$head[$h][1] .= $langs->trans("Customer");
}
$head[$h][2] = 'customer';
$h++;
- if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
+ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
$langs->load("products");
// price
$head[$h][0] = DOL_URL_ROOT.'/societe/price.php?socid='.$object->id;
@@ -171,7 +171,7 @@ function societe_prepare_head(Societe $object)
}
// Tab to link resources
- if (isModEnabled('resource') && !empty($conf->global->RESOURCE_ON_THIRDPARTIES)) {
+ if (isModEnabled('resource') && getDolGlobalString('RESOURCE_ON_THIRDPARTIES')) {
$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=societe&element_id='.$object->id;
$head[$h][1] = $langs->trans("Resources");
$head[$h][2] = 'resources';
@@ -180,7 +180,7 @@ function societe_prepare_head(Societe $object)
// Related items
if ((isModEnabled('commande') || isModEnabled('propal') || isModEnabled('facture') || isModEnabled('ficheinter') || isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))
- && empty($conf->global->THIRDPARTIES_DISABLE_RELATED_OBJECT_TAB)) {
+ && !getDolGlobalString('THIRDPARTIES_DISABLE_RELATED_OBJECT_TAB')) {
$head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Referers");
$head[$h][2] = 'consumption';
@@ -200,7 +200,7 @@ function societe_prepare_head(Societe $object)
//$title = $langs->trans("BankAccountsAndGateways");
$servicestatus = 0;
- if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) {
+ if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
$servicestatus = 1;
}
@@ -243,7 +243,7 @@ function societe_prepare_head(Societe $object)
}
if (
- ((isModEnabled('website') && !empty($conf->global->WEBSITE_USE_WEBSITE_ACCOUNTS)) || isModEnabled('webportal'))
+ ((isModEnabled('website') && getDolGlobalString('WEBSITE_USE_WEBSITE_ACCOUNTS')) || isModEnabled('webportal'))
&& $user->hasRight('societe', 'lire')
) {
$site_filter_list = array();
@@ -1063,7 +1063,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
$extrafields->fetch_name_optionals_label($contactstatic->table_element);
$contactstatic->fields = array(
- 'rowid' =>array('type'=>'integer', 'label'=>"TechnicalID", 'enabled'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) ? 1 : 0), 'visible'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) ? 1 : 0), 'position'=>1),
+ 'rowid' =>array('type'=>'integer', 'label'=>"TechnicalID", 'enabled'=>(getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0), 'visible'=>(getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0), 'position'=>1),
'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'index'=>1, 'position'=>20),
'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>3, 'index'=>1, 'position'=>30),
@@ -1075,7 +1075,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
// Definition of fields for list
$arrayfields = array(
- 't.rowid'=>array('label'=>"TechnicalID", 'checked'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) ? 1 : 0), 'enabled'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) ? 1 : 0), 'position'=>1),
+ 't.rowid'=>array('label'=>"TechnicalID", 'checked'=>(getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0), 'enabled'=>(getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0), 'position'=>1),
't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10),
't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20),
't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30),
@@ -1132,13 +1132,13 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
$newcardbutton = '';
if ($user->hasRight('societe', 'contact', 'creer')) {
- $addcontact = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
+ $addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
$newcardbutton .= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
}
print "\n";
- $title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ContactsForCompany") : $langs->trans("ContactsAddressesForCompany"));
+ $title = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("ContactsForCompany") : $langs->trans("ContactsAddressesForCompany"));
print load_fiche_titre($title, $newcardbutton, '');
print '