diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index b9e04015d7d..e0f6b693eb7 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -1351,7 +1351,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print "\n";
// Default language
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '
| '.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).' | '."\n";
print img_picto('', 'language').$formadmin->select_language($object->default_lang, 'default_lang', 0, 0, 1);
print ' | ';
@@ -1799,7 +1799,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '
| '.$langs->trans("DateOfBirth").' | '.dol_print_date($object->birth, 'day').' |
';
// Default language
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
print '| '.$langs->trans("DefaultLang").' | ';
//$s=picto_from_langcode($object->default_lang);
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index ae26b84baa5..0aa1af68afc 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -1867,10 +1867,10 @@ class Adherent extends CommonObject
$outputlangs = $langs;
$newlang = '';
$lang_id = GETPOST('lang_id');
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && !empty($lang_id)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && !empty($lang_id)) {
$newlang = $lang_id;
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $customer->default_lang;
}
if (!empty($newlang)) {
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index 12735e70211..4516b132982 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -397,7 +397,7 @@ class AdherentType extends CommonObject
$this->description = $this->db->escape($this->note_public);
// Multilangs
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
if ($this->setMultiLangs($user) < 0) {
$this->error = $langs->trans("Error")." : ".$this->db->error()." - ".$sql;
return -2;
@@ -509,7 +509,7 @@ class AdherentType extends CommonObject
$this->vote = $obj->vote;
// multilangs
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->getMultiLangs();
}
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index 303e6f3cfec..0daf46c2588 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -583,7 +583,7 @@ if (!$user->admin) {
$sql .= " AND (private = 0 OR (private = 1 AND fk_user = ".((int) $user->id)."))"; // Show only public and private to me
$sql .= " AND (active = 1 OR fk_user = ".((int) $user->id).")"; // Show only active or owned by me
}
-if (empty($conf->global->MAIN_MULTILANGS)) {
+if (!getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= " AND (lang = '".$db->escape($langs->defaultlang)."' OR lang IS NULL OR lang = '')";
}
if ($search_label) {
@@ -706,7 +706,7 @@ if ($action == 'add') {
$valuetoshow = $langs->trans("Owner");
}
if ($fieldlist[$field] == 'lang') {
- $valuetoshow = (empty($conf->global->MAIN_MULTILANGS) ? ' ' : $langs->trans("Language"));
+ $valuetoshow = (!getDolGlobalInt('MAIN_MULTILANGS') ? ' ' : $langs->trans("Language"));
}
if ($fieldlist[$field] == 'type') {
$valuetoshow = $langs->trans("Type");
@@ -1332,7 +1332,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
print ' | ';
} elseif ($value == 'lang') {
print '';
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$selectedlang = GETPOSTISSET('langcode') ?GETPOST('langcode', 'aZ09') : $langs->defaultlang;
if ($context == 'edit') {
$selectedlang = $obj->{$value};
diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index 686d13e7e39..d59e2279435 100644
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -472,7 +472,7 @@ print ' |
| '.$langs->trans("Parameter").' | | '.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").' | ';
-//if (!empty($conf->global->MAIN_MULTILANGS))
+//if (getDolGlobalInt('MAIN_MULTILANGS'))
//{
$selected = GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0);
print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1);
diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php
index 55d2bc07593..5c50b972c93 100644
--- a/htdocs/asset/class/asset.class.php
+++ b/htdocs/asset/class/asset.class.php
@@ -1171,10 +1171,10 @@ class Asset extends CommonObject
global $hidedetails, $hidedesc, $hideref;
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $this->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -1234,10 +1234,10 @@ class Asset extends CommonObject
global $hidedetails, $hidedesc, $hideref;
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $this->thirdparty->default_lang;
}
if (!empty($newlang)) {
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index a0b4d9c20c8..1d7901eca3f 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -384,7 +384,7 @@ class Categorie extends CommonObject
$this->db->free($resql);
// multilangs
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->getMultiLangs();
}
@@ -1000,7 +1000,7 @@ class Categorie extends CommonObject
$categories[$i]['array_options'] = $category_static->array_options;
// multilangs
- if (!empty($conf->global->MAIN_MULTILANGS) && isset($category_static->multilangs)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && isset($category_static->multilangs)) {
$categories[$i]['multilangs'] = $category_static->multilangs;
}
}
@@ -1128,11 +1128,11 @@ class Categorie extends CommonObject
// Init $this->cats array
$sql = "SELECT DISTINCT c.rowid, c.label, c.ref_ext, c.description, c.color, c.fk_parent, c.visible"; // Distinct reduce pb with old tables with duplicates
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= ", t.label as label_trans, t.description as description_trans";
}
$sql .= " FROM ".MAIN_DB_PREFIX."categorie as c";
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$this->db->escape($current_lang)."'";
}
$sql .= " WHERE c.entity IN (".getEntity('category').")";
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 0f019c80f4b..5a92ff25695 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -256,7 +256,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
// Define output language
$outputlangs = $langs;
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang);
@@ -281,10 +281,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -326,8 +326,8 @@ if (empty($reshook)) {
} elseif (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang;
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
@@ -347,8 +347,8 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang;
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
@@ -647,10 +647,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -746,7 +746,7 @@ if (empty($reshook)) {
$ret = $deposit->fetch($deposit->id); // Reload to get new records
$outputlangs = $langs;
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang($deposit->thirdparty->default_lang);
$outputlangs->load('products');
@@ -877,7 +877,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
// Define output language
$outputlangs = $langs;
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang);
@@ -1133,7 +1133,7 @@ if (empty($reshook)) {
$desc = '';
// Define output language
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
$newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
@@ -1167,7 +1167,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) {
$tmptxt = '(';
// Define output language
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
$newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'alpha')) {
@@ -1268,7 +1268,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
// Define output language
$outputlangs = $langs;
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang);
@@ -1442,7 +1442,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
// Define output language
$outputlangs = $langs;
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang);
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 7d21f4db1b6..46474092448 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -1901,7 +1901,7 @@ class Propal extends CommonObject
$line->fetch_optionals();
// multilangs
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
$tmpproduct = new Product($this->db);
$tmpproduct->fetch($objp->fk_product);
$tmpproduct->getMultiLangs();
@@ -2660,7 +2660,7 @@ class Propal extends CommonObject
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
// Define output language
$outputlangs = $langs;
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang);
@@ -2753,7 +2753,7 @@ class Propal extends CommonObject
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
// Define output language
$outputlangs = $langs;
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang);
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index b02223691af..ead1d09b44b 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -228,10 +228,10 @@ if (empty($reshook)) {
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -591,7 +591,7 @@ if (empty($reshook)) {
// Define output language
$outputlangs = $langs;
$newlang = GETPOST('lang_id', 'alpha');
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -875,7 +875,7 @@ if (empty($reshook)) {
$desc = '';
// Define output language
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
$newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
@@ -909,7 +909,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) {
$tmptxt = '(';
// Define output language
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
$newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'alpha')) {
@@ -1008,7 +1008,7 @@ if (empty($reshook)) {
// Define output language
$outputlangs = $langs;
$newlang = GETPOST('lang_id', 'alpha');
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -1183,10 +1183,10 @@ if (empty($reshook)) {
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -1351,10 +1351,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index d409c2057ee..6d0693d6346 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -2143,7 +2143,7 @@ class Commande extends CommonOrder
$line->fetch_optionals();
// multilangs
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
$tmpproduct = new Product($this->db);
$tmpproduct->fetch($objp->fk_product);
$tmpproduct->getMultiLangs();
diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php
index 95073a83b9d..33b85f707e9 100644
--- a/htdocs/compta/facture/card-rec.php
+++ b/htdocs/compta/facture/card-rec.php
@@ -542,7 +542,7 @@ if (empty($reshook)) {
$desc = '';
// Define output language
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
$newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
@@ -567,7 +567,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) {
$tmptxt = '(';
// Define output language
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
$newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'alpha')) {
@@ -651,8 +651,8 @@ if (empty($reshook)) {
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09');
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang;
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09');
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
@@ -858,9 +858,9 @@ if (empty($reshook)) {
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id','aZ09'))
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id','aZ09'))
$newlang = GETPOST('lang_id','aZ09');
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang))
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang))
$newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 1975bf9c8e2..3c407a834e6 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -279,10 +279,10 @@ if (empty($reshook)) {
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id')) {
$newlang = GETPOST('lang_id');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -527,10 +527,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -611,10 +611,10 @@ if (empty($reshook)) {
if (empty($error) && empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -666,10 +666,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -756,10 +756,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -1963,10 +1963,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && count($object->lines)) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -2181,7 +2181,7 @@ if (empty($reshook)) {
$desc = '';
// Define output language
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
$newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
@@ -2216,7 +2216,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) {
$tmptxt = '(';
// Define output language
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
$newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'alpha')) {
@@ -2339,10 +2339,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -2598,10 +2598,10 @@ if (empty($reshook)) {
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 19f6cdd9b88..a286e93b9d0 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -602,10 +602,10 @@ class Facture extends CommonInvoice
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($this->thirdparty->default_lang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($this->thirdparty->default_lang)) {
$newlang = $this->thirdparty->default_lang; // for proposal, order, invoice, ...
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($this->default_lang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($this->default_lang)) {
$newlang = $this->default_lang; // for thirdparty
}
if (!empty($newlang)) {
@@ -2193,7 +2193,7 @@ class Facture extends CommonInvoice
$line->fetch_optionals();
// multilangs
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
$tmpproduct = new Product($this->db);
$tmpproduct->fetch($objp->fk_product);
$tmpproduct->getMultiLangs();
diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php
index 2591defbf7d..7b3eaceab3a 100644
--- a/htdocs/compta/paiement/cheque/card.php
+++ b/htdocs/compta/paiement/cheque/card.php
@@ -139,10 +139,10 @@ if ($action == 'create' && GETPOST("accountid", "int") > 0 && $user->rights->ban
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- //if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->client->default_lang;
+ //if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
@@ -190,10 +190,10 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->banque-
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- //if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->client->default_lang;
+ //if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
@@ -232,10 +232,10 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- //if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->client->default_lang;
+ //if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 310388b9e87..ec1392e9ea7 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -455,7 +455,7 @@ class Paiement extends CommonObject
$newlang = '';
$outputlangs = $langs;
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$invoice->fetch_thirdparty();
$newlang = $invoice->thirdparty->default_lang;
}
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index d751cbef511..11aebc8fc29 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -884,7 +884,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' |
';
//Default language
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '| '.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).' | '."\n";
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');
print ' | ';
@@ -1171,7 +1171,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '
';
//Default language
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '| '.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).' | '."\n";
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');
print ' | ';
@@ -1398,7 +1398,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Default language
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
print '
| '.$langs->trans("DefaultLang").' | ';
//$s=picto_from_langcode($object->default_lang);
diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php
index 729c99f1186..ff18b06c44a 100644
--- a/htdocs/contact/consumption.php
+++ b/htdocs/contact/consumption.php
@@ -497,7 +497,7 @@ if ($sql_select) {
// Product
if ($objp->fk_product > 0) {
// Define output language
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$prod = new Product($db);
$prod->fetch($objp->fk_product);
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 9a1e4aed2e1..4e8c378b832 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -292,7 +292,7 @@ if (empty($reshook)) {
$product_static = new Product($db);
// Define output language
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$prod = new Product($db);
$prod->id = $lines[$i]->fk_product;
$prod->getMultiLangs();
@@ -618,10 +618,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && !empty($conf->global->CONTRACT_ADDON_PDF)) { // No generation if default type not defined
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -795,10 +795,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 29428ceb26d..f3b617a251a 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -874,7 +874,7 @@ class Contrat extends CommonObject
$line->fetch_optionals();
// multilangs
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
$tmpproduct = new Product($this->db);
$tmpproduct->fetch($objp->fk_product);
$tmpproduct->getMultiLangs();
diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php
index f1fcdf4f0f8..78a2616058a 100644
--- a/htdocs/core/actions_addupdatedelete.inc.php
+++ b/htdocs/core/actions_addupdatedelete.inc.php
@@ -366,10 +366,10 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && is_object($object->thirdparty)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && is_object($object->thirdparty)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -405,10 +405,10 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) {
if (method_exists($object, 'generateDocument')) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -442,10 +442,10 @@ if ($action == 'confirm_close' && $confirm == 'yes' && $permissiontoadd) {
if (method_exists($object, 'generateDocument')) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -486,10 +486,10 @@ if ($action == 'confirm_reopen' && $confirm == 'yes' && $permissiontoadd) {
if (method_exists($object, 'generateDocument')) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php
index 385b36bdbce..0a5f63de9aa 100644
--- a/htdocs/core/actions_builddoc.inc.php
+++ b/htdocs/core/actions_builddoc.inc.php
@@ -66,13 +66,13 @@ if ($action == 'builddoc' && ($permissiontoadd || !empty($usercangeneretedoc)))
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($object->thirdparty->default_lang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($object->thirdparty->default_lang)) {
$newlang = $object->thirdparty->default_lang; // for proposal, order, invoice, ...
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($object->default_lang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($object->default_lang)) {
$newlang = $object->default_lang; // for thirdparty
}
if (!empty($newlang)) {
diff --git a/htdocs/core/actions_lineupdown.inc.php b/htdocs/core/actions_lineupdown.inc.php
index d41f1f1932c..e43b0216cbe 100644
--- a/htdocs/core/actions_lineupdown.inc.php
+++ b/htdocs/core/actions_lineupdown.inc.php
@@ -34,10 +34,10 @@ if ($action == 'up' && $permissiontoedit) {
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -59,10 +59,10 @@ if ($action == 'down' && $permissiontoedit) {
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php
index aa73c9cdc8a..6ab6b6943a7 100644
--- a/htdocs/core/actions_massactions.inc.php
+++ b/htdocs/core/actions_massactions.inc.php
@@ -763,10 +763,10 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto
// Define output language (Here it is not used because we do only merging existing PDF)
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- //elseif (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && is_object($objecttmp->thirdparty)) { // On massaction, we can have several values for $objecttmp->thirdparty
+ //elseif (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && is_object($objecttmp->thirdparty)) { // On massaction, we can have several values for $objecttmp->thirdparty
// $newlang = $objecttmp->thirdparty->default_lang;
//}
if (!empty($newlang)) {
@@ -965,10 +965,10 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $objecttmp->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -1116,13 +1116,13 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($objecttmp->thirdparty->default_lang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($objecttmp->thirdparty->default_lang)) {
$newlang = $objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ...
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($objecttmp->default_lang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($objecttmp->default_lang)) {
$newlang = $objecttmp->default_lang; // for thirdparty
}
if (!empty($newlang)) {
diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php
index 7595daf1093..a731fac76de 100644
--- a/htdocs/core/actions_setnotes.inc.php
+++ b/htdocs/core/actions_setnotes.inc.php
@@ -45,10 +45,10 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel',
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php
index 19f9724cc98..f036628db3b 100644
--- a/htdocs/core/boxes/box_produits.php
+++ b/htdocs/core/boxes/box_produits.php
@@ -119,7 +119,7 @@ class box_produits extends ModeleBoxes
$datem = $this->db->jdate($objp->tms);
// Multilangs
- if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active
+ if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active
$sqld = "SELECT label";
$sqld .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sqld .= " WHERE fk_product = ".((int) $objp->rowid);
diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php
index 203d42c7eed..4be56eee072 100644
--- a/htdocs/core/boxes/box_produits_alerte_stock.php
+++ b/htdocs/core/boxes/box_produits_alerte_stock.php
@@ -126,7 +126,7 @@ class box_produits_alerte_stock extends ModeleBoxes
$price_base_type = '';
// Multilangs
- if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active
+ if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active
$sqld = "SELECT label";
$sqld .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sqld .= " WHERE fk_product = ".((int) $objp->rowid);
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 9e488b2eafa..7f30878d566 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -4989,7 +4989,7 @@ abstract class CommonObject
$text = $product_static->getNomUrl(1);
// Define output language and label
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
if (property_exists($this, 'socid') && !is_object($this->thirdparty)) {
dol_print_error('', 'Error: Method printObjectLine was called on an object and object->fetch_thirdparty was not done before');
return;
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index a241aa367cf..14236b5e332 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -2562,7 +2562,7 @@ class Form
}
// Multilang : we add translation
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= ", pl.label as label_translated";
$sql .= ", pl.description as description_translated";
$selectFields .= ", label_translated";
@@ -2605,7 +2605,7 @@ class Form
$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
}
// Multilang : we add translation
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && !empty($socid)) {
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
@@ -2671,7 +2671,7 @@ class Form
$sql .= " AND ";
}
$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
}
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
@@ -2679,7 +2679,7 @@ class Form
}
if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) {
$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
}
}
@@ -2885,7 +2885,7 @@ class Form
$outrefcust = empty($objp->custref) ? '' : $objp->custref;
$outlabel = $objp->label;
$outdesc = $objp->description;
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outlabel_translated = $objp->label_translated;
$outdesc_translated = $objp->description_translated;
}
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index a01f15c5479..675300169e4 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -728,7 +728,7 @@ class FormFile
}
// Language code (if multilang)
- if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && !empty($conf->global->MAIN_MULTILANGS) && !$forcenomultilang && (!empty($modellist) || $showempty)) {
+ if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && getDolGlobalInt('MAIN_MULTILANGS') && !$forcenomultilang && (!empty($modellist) || $showempty)) {
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($this->db);
$defaultlang = ($codelang && $codelang != 'auto') ? $codelang : $langs->getDefaultLang();
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index ff6147977f3..aa54b3f330c 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -401,7 +401,7 @@ class FormMail extends Form
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($this->param['langsmodels'])) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($this->param['langsmodels'])) {
$newlang = $this->param['langsmodels'];
}
if (!empty($newlang)) {
diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index bd881416fa9..ed944dec414 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -1264,7 +1264,7 @@ class FormTicket
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $this->param['langsmodels'];
}
if (!empty($newlang)) {
@@ -1311,7 +1311,7 @@ class FormTicket
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $this->param['langsmodels'];
}
if (!empty($newlang)) {
diff --git a/htdocs/core/lib/categories.lib.php b/htdocs/core/lib/categories.lib.php
index ee69ccf4a87..5ee8ac517a8 100644
--- a/htdocs/core/lib/categories.lib.php
+++ b/htdocs/core/lib/categories.lib.php
@@ -49,7 +49,7 @@ function categories_prepare_head(Categorie $object, $type)
$head[$h][2] = 'photos';
$h++;
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$head[$h][0] = DOL_URL_ROOT.'/categories/traduction.php?id='.$object->id.'&type='.$type;
$head[$h][1] = $langs->trans("Translation");
$head[$h][2] = 'translation';
diff --git a/htdocs/core/lib/doc.lib.php b/htdocs/core/lib/doc.lib.php
index 92cc140f299..f71c4231038 100644
--- a/htdocs/core/lib/doc.lib.php
+++ b/htdocs/core/lib/doc.lib.php
@@ -57,7 +57,7 @@ function doc_getlinedesc($line, $outputlangs, $hideref = 0, $hidedesc = 0, $issu
if ($idprod) {
$prodser->fetch($idprod);
// If a predefined product and multilang and on other lang, we renamed label with label translated
- if (!empty($conf->global->MAIN_MULTILANGS) && ($outputlangs->defaultlang != $langs->defaultlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && ($outputlangs->defaultlang != $langs->defaultlang)) {
if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && $label == $prodser->label) {
$label = $prodser->multilangs[$outputlangs->defaultlang]["label"];
}
diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php
index 5cad13a6e57..6e0dcb3b83a 100644
--- a/htdocs/core/lib/member.lib.php
+++ b/htdocs/core/lib/member.lib.php
@@ -149,7 +149,7 @@ function member_type_prepare_head(AdherentType $object)
$h++;
// Multilangs
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$head[$h][0] = DOL_URL_ROOT."/adherents/type_translation.php?rowid=".$object->id;
$head[$h][1] = $langs->trans("Translation");
$head[$h][2] = 'translation';
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index cf455968424..7007b49b65f 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -1420,7 +1420,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
if ($idprod) {
$prodser->fetch($idprod);
// If a predefined product and multilang and on other lang, we renamed label with label translated
- if (!empty($conf->global->MAIN_MULTILANGS) && ($outputlangs->defaultlang != $langs->defaultlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && ($outputlangs->defaultlang != $langs->defaultlang)) {
$translatealsoifmodified = (!empty($conf->global->MAIN_MULTILANG_TRANSLATE_EVEN_IF_MODIFIED)); // By default if value was modified manually, we keep it (no translation because we don't have it)
// TODO Instead of making a compare to see if param was modified, check that content contains reference translation. If yes, add the added part to the new translation
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index 983611120b0..0d2edb4805e 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -74,7 +74,7 @@ function product_prepare_head($object)
}
// Multilangs
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$head[$h][0] = DOL_URL_ROOT."/product/traduction.php?id=".$object->id;
$head[$h][1] = $langs->trans("Translation");
$head[$h][2] = 'translation';
diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php
index df6e3231a0b..8e3c4f7112c 100644
--- a/htdocs/core/lib/sendings.lib.php
+++ b/htdocs/core/lib/sendings.lib.php
@@ -305,7 +305,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
// Description
if ($objp->fk_product > 0) {
// Define output language
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$object = new $origin($db);
$object->fetch($origin_id);
$object->fetch_thirdparty();
diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php
index 335e3ac575a..71be0733fb2 100644
--- a/htdocs/core/modules/mailings/thirdparties.modules.php
+++ b/htdocs/core/modules/mailings/thirdparties.modules.php
@@ -316,7 +316,7 @@ class mailing_thirdparties extends MailingTargets
$s .= '';
$s .= ajax_combobox("filter_status_thirdparties");
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
// Choose language
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($this->db);
diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php
index 604d96fd4cd..2023a5e2695 100644
--- a/htdocs/core/modules/modProduct.class.php
+++ b/htdocs/core/modules/modProduct.class.php
@@ -230,7 +230,7 @@ class modProduct extends DolibarrModules
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('group_concat(cat.label)'=>'Categories'));
}
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel', 'l.description'=>'TranslatedDescription', 'l.note'=>'TranslatedNote'));
}
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
@@ -261,7 +261,7 @@ class modProduct extends DolibarrModules
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric'));
}
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('l.lang'=>'Text', 'l.label'=>'Text', 'l.description'=>'Text', 'l.note'=>'Text'));
}
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
@@ -280,7 +280,7 @@ class modProduct extends DolibarrModules
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref'));
}
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation'));
}
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
@@ -295,7 +295,7 @@ class modProduct extends DolibarrModules
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref'));
}
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation'));
}
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
@@ -309,7 +309,7 @@ class modProduct extends DolibarrModules
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cp.fk_categorie = cat.rowid';
}
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid';
}
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object';
@@ -905,7 +905,7 @@ class modProduct extends DolibarrModules
'pr.date_price'=>'2020-12-31');
}
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
// Import translations of product names and descriptions
$r++;
$this->import_code[$r] = $this->rights_class.'_languages';
diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php
index d2431d3e22c..a6bfdd47433 100644
--- a/htdocs/core/modules/modService.class.php
+++ b/htdocs/core/modules/modService.class.php
@@ -195,7 +195,7 @@ class modService extends DolibarrModules
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('group_concat(cat.label)'=>'Categories'));
}
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel', 'l.description'=>'TranslatedDescription', 'l.note'=>'TranslatedNote'));
}
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
@@ -224,7 +224,7 @@ class modService extends DolibarrModules
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric'));
}
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('l.lang'=>'Text', 'l.label'=>'Text', 'l.description'=>'Text', 'l.note'=>'Text'));
}
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
@@ -243,7 +243,7 @@ class modService extends DolibarrModules
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref'));
}
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation'));
}
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
@@ -258,7 +258,7 @@ class modService extends DolibarrModules
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref'));
}
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation'));
}
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
@@ -272,7 +272,7 @@ class modService extends DolibarrModules
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cp.fk_categorie = cat.rowid';
}
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid';
}
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object';
@@ -834,7 +834,7 @@ class modService extends DolibarrModules
'pr.date_price'=>'2013-04-10');
}
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
// Import translations of product names and descriptions
$r++;
$this->import_code[$r] = $this->rights_class.'_languages';
diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php
index d93a7d99076..eb57e7c5453 100644
--- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php
@@ -491,7 +491,7 @@ class pdf_standard extends ModelePDFMovement
$objp = $this->db->fetch_object($resql);
// Multilangs
- if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active
+ if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active
$sql = "SELECT label";
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql .= " WHERE fk_product = ".((int) $objp->rowid);
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index ea95036b280..8214b8243e9 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -793,7 +793,7 @@ class pdf_azur extends ModelePDFPropales
// Find the desire PDF
$filetomerge = new Propalmergepdfproduct($this->db);
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang);
} else {
$filetomerge->fetch_by_product($line->fk_product);
diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
index cdac495c393..049391450d8 100644
--- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
@@ -918,7 +918,7 @@ class pdf_cyan extends ModelePDFPropales
// Find the desire PDF
$filetomerge = new Propalmergepdfproduct($this->db);
- if (!empty($conf->global->MAIN_MULTILANGS)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS')) {
$filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang);
} else {
$filetomerge->fetch_by_product($line->fk_product);
diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php
index d3fa898d0a1..6231fb492b0 100644
--- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php
@@ -306,7 +306,7 @@ class pdf_standard extends ModelePDFStock
$objp = $this->db->fetch_object($resql);
// Multilangs
- if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active
+ if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active
$sql = "SELECT label";
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql .= " WHERE fk_product = ".((int) $objp->rowid);
diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php
index 07595012466..8f27d747fab 100644
--- a/htdocs/core/tpl/advtarget.tpl.php
+++ b/htdocs/core/tpl/advtarget.tpl.php
@@ -243,7 +243,7 @@ print ' | '."\n";
print ' |
'."\n";
// Customer Default Langauge
-if (!empty($conf->global->MAIN_MULTILANGS)) {
+if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '| '.$langs->trans("DefaultLang");
if (!empty($array_query['cust_language'])) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php
index 888cb1d7026..24604388af1 100644
--- a/htdocs/core/tpl/card_presend.tpl.php
+++ b/htdocs/core/tpl/card_presend.tpl.php
@@ -63,7 +63,7 @@ if ($action == 'presend') {
// Define output language
$outputlangs = $langs;
$newlang = '';
- if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
if (GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index 81a1692c6a3..a7eb433a021 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -763,7 +763,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
}
global->PRODUIT_AUTOFILL_DESC) && $conf->global->PRODUIT_AUTOFILL_DESC == 1) {
- if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { ?>
+ if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { ?>
var proddesc = data.desc_trans;
diff --git a/htdocs/datapolicy/admin/setupmail.php b/htdocs/datapolicy/admin/setupmail.php
index f36a3dbc834..2ceaa3332e0 100644
--- a/htdocs/datapolicy/admin/setupmail.php
+++ b/htdocs/datapolicy/admin/setupmail.php
@@ -118,7 +118,7 @@ print ' |