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 '
'; print ''; print ''; print ''; -if (!empty($conf->global->MAIN_MULTILANGS)) { +if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''; */ // View product description in thirdparty language -if (!empty($conf->global->MAIN_MULTILANGS)) { +if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''; print ''; print ''; $labeltoshow = $objp->label; - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->labelm)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($objp->labelm)) { $labeltoshow = $objp->labelm; } diff --git a/htdocs/product/document.php b/htdocs/product/document.php index ee5ba79a284..bfb5978406d 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -154,14 +154,14 @@ if ($action == 'filemerge' && $permissiontoadd) { $filetomerge_file_array = GETPOST('filetoadd'); - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $lang_id = GETPOST('lang_id', 'aZ09'); } // Delete all file already associated $filetomerge = new Propalmergepdfproduct($db); - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $result = $filetomerge->delete_by_product($user, $object->id, $lang_id); } else { $result = $filetomerge->delete_by_product($user, $object->id); @@ -176,7 +176,7 @@ if ($action == 'filemerge' && $permissiontoadd) { $filetomerge->fk_product = $object->id; $filetomerge->file_name = $filetomerge_file; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $filetomerge->lang = $lang_id; } @@ -271,7 +271,7 @@ if ($object->id) { if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) { $filetomerge = new Propalmergepdfproduct($db); - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $lang_id = GETPOST('lang_id', 'aZ09'); $result = $filetomerge->fetch_by_product($object->id, $lang_id); } else { @@ -305,7 +305,7 @@ if ($object->id) { print '
'.$form->editfieldkey('DefaultLang', 'default_lang', '', null, 0).''."\n"; print img_picto('', 'language', 'class="pictofixedwidth"'); print $formadmin->select_language((GETPOST('l') ? GETPOST('l') : $langs->defaultlang), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index dc33073e978..8edac0d3538 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -143,10 +143,10 @@ if ($action == 'add') { 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)) { @@ -547,7 +547,7 @@ if ($action == 'create') { $product->fetch($object->lines[$i]->fk_product); // 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')) { diff --git a/htdocs/don/card.php b/htdocs/don/card.php index e8df10f2ee9..ae73fdfd15a 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -120,10 +120,10 @@ if (empty($reshook)) { 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)) { @@ -350,8 +350,8 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang=''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && !empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->thirdparty->default_lang; + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && !empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang=$object->thirdparty->default_lang; if (!empty($newlang)) { $outputlangs = new Translate("",$conf); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 41727761027..d83b5bd75f5 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -437,10 +437,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)) { @@ -773,10 +773,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)) { @@ -2090,7 +2090,7 @@ if ($action == 'create') { $outputlangs = $langs; - 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->fetch_thirdparty(); $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { @@ -2169,7 +2169,7 @@ if ($action == 'create') { // Predefined product or service if ($lines[$i]->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($lines[$i]->fk_product); $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product_label; diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 4aa9a9a7f54..33ee4a761bb 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -679,7 +679,7 @@ if ($id > 0 || !empty($ref)) { // Product label 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->fetch_thirdparty(); $prod = new Product($db); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index a0d02e10bbd..c325aae4854 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -384,10 +384,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)) { @@ -494,10 +494,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)) { @@ -604,10 +604,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)) { @@ -718,10 +718,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)) { @@ -832,10 +832,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)) { @@ -944,10 +944,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)) { @@ -983,10 +983,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)) { @@ -1012,10 +1012,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)) { @@ -1186,7 +1186,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)) { @@ -1230,10 +1230,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)) { @@ -1322,10 +1322,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/fichinter/card.php b/htdocs/fichinter/card.php index a090c8573c4..8b3868bf195 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -174,10 +174,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)) { @@ -199,10 +199,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)) { @@ -311,7 +311,7 @@ if (empty($reshook)) { $prod->id = $lines[$i]->fk_product; // 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->getMultiLangs(); // We show if duration is present on service (so we get it) $prod->fetch($lines[$i]->fk_product); @@ -517,10 +517,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)) { @@ -613,10 +613,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)) { @@ -646,10 +646,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)) { @@ -666,10 +666,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)) { @@ -688,10 +688,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/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index a875cf85a81..3015be37169 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -504,10 +504,10 @@ class FactureFournisseur 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)) { diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index e0b3fcac0c6..bdf4f8aa457 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -349,7 +349,7 @@ class PaiementFourn extends Paiement if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $newlang = ''; $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $invoice->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 5125b758b9f..fc18302eab0 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -534,7 +534,7 @@ if (empty($reshook)) { $label = $productsupplier->label; // 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')) { @@ -685,7 +685,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $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'); @@ -861,10 +861,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)) { @@ -899,10 +899,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)) { @@ -941,10 +941,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)) { @@ -1004,10 +1004,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)) { @@ -1065,10 +1065,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/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index f9c955e5c82..71ba4f6928a 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -570,7 +570,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')) { @@ -595,7 +595,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')) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 33fac296f8d..c2bef9b2904 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -230,10 +230,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)) { @@ -274,9 +274,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); @@ -343,10 +343,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)) { @@ -502,10 +502,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)) { @@ -1513,7 +1513,7 @@ if (empty($reshook)) { if ($idprod > 0) { $label = $productsupplier->label; // 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')) { @@ -1658,10 +1658,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)) { @@ -1758,10 +1758,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/mrp/mo_card.php b/htdocs/mrp/mo_card.php index cda6088a982..c1869f755de 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -205,10 +205,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/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 19533e05c06..303f5516d72 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -808,7 +808,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $objp = $db->fetch_object($resql); // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { // If multilang is enabled + if (getDolGlobalInt('MAIN_MULTILANGS')) { // If multilang is enabled // TODO Use a cache here $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 7b11ecd7e81..178858b718f 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -396,10 +396,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/partnership/class/partnershiputils.class.php b/htdocs/partnership/class/partnershiputils.class.php index 13f5942ba70..366bee570df 100644 --- a/htdocs/partnership/class/partnershiputils.class.php +++ b/htdocs/partnership/class/partnershiputils.class.php @@ -157,7 +157,7 @@ class PartnershipUtils // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -323,7 +323,7 @@ class PartnershipUtils // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index 969fea1673d..865888c69a3 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -129,10 +129,10 @@ if (empty($reshook)) { 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)) { @@ -161,10 +161,10 @@ if (empty($reshook)) { 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/product/admin/product.php b/htdocs/product/admin/product.php index 42f80906574..d530b57b125 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -716,7 +716,7 @@ print '
'.$langs->trans("ViewProductDescInThirdpartyLanguageAbility").''; diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 1896c801c50..b2ce6e48c09 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -106,7 +106,7 @@ if ($action == 'fetch' && !empty($id)) { $thirdpartytemp->fetch($socid); //Load translation description and label - 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)) { $newlang = $thirdpartytemp->default_lang; if (!empty($newlang)) { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index ccc3a05c51f..0460642c746 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1203,7 +1203,7 @@ class Product extends CommonObject $this->id = $id; // 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; @@ -2495,7 +2495,7 @@ class Product extends CommonObject $this->fetch_optionals(); // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS) && empty($ignore_lang_load)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($ignore_lang_load)) { $this->getMultiLangs(); } diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index b4b85c3852a..84b6cbe7123 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -107,7 +107,7 @@ class Propalmergepdfproduct extends CommonObject $sql = "INSERT INTO ".$this->db->prefix()."propal_merge_pdf_product("; $sql .= "fk_product,"; $sql .= "file_name,"; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= "lang,"; } $sql .= "fk_user_author,"; @@ -116,7 +116,7 @@ class Propalmergepdfproduct extends CommonObject $sql .= ") VALUES ("; $sql .= " ".(!isset($this->fk_product) ? 'NULL' : ((int) $this->fk_product)).","; $sql .= " ".(!isset($this->file_name) ? 'NULL' : "'".$this->db->escape($this->file_name)."'").","; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= " ".(!isset($this->lang) ? 'NULL' : "'".$this->db->escape($this->lang)."'").","; } $sql .= " ".((int) $user->id).","; @@ -186,7 +186,7 @@ class Propalmergepdfproduct extends CommonObject $this->fk_product = $obj->fk_product; $this->file_name = $obj->file_name; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->lang = $obj->lang; } $this->fk_user_author = $obj->fk_user_author; @@ -233,7 +233,7 @@ class Propalmergepdfproduct extends CommonObject $sql .= " FROM ".$this->db->prefix()."propal_merge_pdf_product as t"; $sql .= " WHERE t.fk_product = ".((int) $product_id); - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($lang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($lang)) { $sql .= " AND t.lang = '".$this->db->escape($lang)."'"; } @@ -248,7 +248,7 @@ class Propalmergepdfproduct extends CommonObject $line->fk_product = $obj->fk_product; $line->file_name = $obj->file_name; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $line->lang = $obj->lang; } $line->fk_user_author = $obj->fk_user_author; @@ -258,7 +258,7 @@ class Propalmergepdfproduct extends CommonObject $line->import_key = $obj->import_key; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->lines[$obj->file_name.'_'.$obj->lang] = $line; } else { $this->lines[$obj->file_name] = $line; @@ -311,7 +311,7 @@ class Propalmergepdfproduct extends CommonObject $sql .= " fk_product=".(isset($this->fk_product) ? $this->fk_product : "null").","; $sql .= " file_name=".(isset($this->file_name) ? "'".$this->db->escape($this->file_name)."'" : "null").","; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= " lang=".(isset($this->lang) ? "'".$this->db->escape($this->lang)."'" : "null").","; } $sql .= " fk_user_mod=".$user->id; @@ -403,7 +403,7 @@ class Propalmergepdfproduct extends CommonObject $sql = "DELETE FROM ".$this->db->prefix()."propal_merge_pdf_product"; $sql .= " WHERE fk_product = ".((int) $product_id); - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($lang_id)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($lang_id)) { $sql .= " AND lang = '".$this->db->escape($lang_id)."'"; } diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 47cc741fb22..c10b5abe93e 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -157,12 +157,12 @@ if ($action == 'search') { $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type as type, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,'; $sql .= ' p.fk_product_type, p.tms as datem, p.tobatch'; $sql .= ', p.tosell as status, p.tobuy as status_buy'; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= ', pl.label as labelm, pl.description as descriptionm'; } $sql .= ' FROM '.MAIN_DB_PREFIX.'product as p'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON p.rowid = cp.fk_product'; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND lang='".($current_lang)."'"; } $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; @@ -170,7 +170,7 @@ if ($action == 'search') { // For natural search $params = array('p.ref', 'p.label', 'p.description', 'p.note'); // multilang - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $params[] = 'pl.label'; $params[] = 'pl.description'; $params[] = 'pl.note'; @@ -682,7 +682,7 @@ if ($id > 0 || !empty($ref)) { print ''.$productstatic->getNomUrl(1, '', 24).'
'; // Get language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $langs->load("languages"); print '\n"; if ($mode && $mode != '-1') { foreach ($infoprod as $prodid => $vals) { // 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) $prodid); diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 31a2060287f..f3ad55d526d 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -608,7 +608,7 @@ while ($i < $imaxinloop) { $objp = $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 // TODO Use a cache $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 999c1993a4f..095eaee313f 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -692,7 +692,7 @@ if ($action == 'create') { $objp = $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/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 7c85bd3295b..7e34931f9a8 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -269,10 +269,10 @@ if (empty($reshook)) { // 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)) { @@ -1319,7 +1319,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $userstatic->statut = $obj->user_status; // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { // If multilang is enabled + if (getDolGlobalInt('MAIN_MULTILANGS')) { // If multilang is enabled // TODO Use a cache $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 53f01d7899c..291fb2b7333 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -180,7 +180,7 @@ if ($action == 'order' && GETPOST('valid')) { //$product = new Product($db); //$product->fetch($obj->fk_product); - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $productsupplier->getMultiLangs(); } @@ -191,7 +191,7 @@ if ($action == 'order' && GETPOST('valid')) { $desc = $productsupplier->description; } $line->desc = $desc; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { // TODO Get desc in language of thirdparty } @@ -803,7 +803,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $prod->load_stock('warehouseopen, warehouseinternal'.(!$usevirtualstock?', novirtual':''), $draftchecked); // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql = 'SELECT label,description'; $sql .= ' FROM '.MAIN_DB_PREFIX.'product_lang'; $sql .= ' WHERE fk_product = '.((int) $objp->rowid); diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 0571caeb6fb..d88355c6912 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -488,7 +488,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $prod->fetch($objp->rowid); // Multilangs - /*if (!empty($conf->global->MAIN_MULTILANGS)) + /*if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql = 'SELECT label,description'; $sql .= ' FROM '.MAIN_DB_PREFIX.'product_lang'; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index a078cdaca15..da88e28fc6b 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -199,10 +199,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)) { @@ -437,10 +437,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)) { @@ -532,10 +532,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 = $reception->thirdparty->default_lang; } if (!empty($newlang)) { @@ -667,10 +667,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)) { @@ -1738,7 +1738,7 @@ if ($action == 'create') { $var = false; - 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->fetch_thirdparty(); $outputlangs = $langs; $newlang = ''; @@ -1813,7 +1813,7 @@ if ($action == 'create') { // Predefined product or service if ($lines[$i]->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($lines[$i]->fk_product); $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product->label; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index a6cd787b343..d5c109a5516 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -694,7 +694,7 @@ class RecruitmentJobPosition 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/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index e71ee255981..fc8794aa1a8 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -246,7 +246,7 @@ abstract class ActionsCardCommon } // Language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->tpl['select_lang'] = $formadmin->select_language(($this->object->default_lang ? $this->object->default_lang : $conf->global->MAIN_LANG_DEFAULT), 'default_lang', 0, 0, 1); } @@ -306,7 +306,7 @@ abstract class ActionsCardCommon $arr = $formcompany->typent_array(1); $this->tpl['typent'] = $arr[$this->object->typent_code]; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; //$s=picto_from_langcode($this->default_lang); //print ($s?$s.' ':''); diff --git a/htdocs/societe/canvas/company/tpl/card_create.tpl.php b/htdocs/societe/canvas/company/tpl/card_create.tpl.php index 58752a1bc7b..d70277dc58d 100644 --- a/htdocs/societe/canvas/company/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_create.tpl.php @@ -189,7 +189,7 @@ for ($i = 1; $i <= 4; $i++) { -global->MAIN_MULTILANGS)) { ?> + diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php index eb300cfdd4e..c432f5a6d95 100644 --- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php @@ -211,7 +211,7 @@ for ($i = 1; $i <= 4; $i++) { -global->MAIN_MULTILANGS)) { ?> + diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index fb9a38ed442..22c46cb93b5 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -190,7 +190,7 @@ for ($i = 1; $i <= 4; $i++) { -global->MAIN_MULTILANGS)) { ?> + diff --git a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php index 1c8b51dac7c..1a574019948 100644 --- a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php @@ -156,7 +156,7 @@ if (isModEnabled('barcode')) { ?> -global->MAIN_MULTILANGS)) { ?> + diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index 56192bbe4e7..adfd1d8363a 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -160,7 +160,7 @@ if ($this->control->tpl['fournisseur']) { -global->MAIN_MULTILANGS)) { ?> + diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index 369ef413fc1..11716519f16 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -131,7 +131,7 @@ if ($this->control->tpl['action_delete']) { -global->MAIN_MULTILANGS)) { ?> + diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 90aafe95f5d..b5a49e9e18d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1804,7 +1804,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } else { print ''.$langs->trans("Currency".$conf->currency).''; } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''; @@ -2554,7 +2554,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Default language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''; @@ -3071,7 +3071,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 '"; } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''; print '';
'; @@ -316,7 +316,7 @@ if ($object->id) { print Form::selectarray('lang_id', $langs_available, $default_lang, 0, 0, 0, '', 0, 0, 0, 'ASC'); - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''; } @@ -328,7 +328,7 @@ if ($object->id) { $checked = ''; $filename = $filetoadd['name']; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { if (array_key_exists($filetoadd['name'].'_'.$default_lang, $filetomerge->lines)) { $filename = $filetoadd['name'].' - '.$langs->trans('Language_'.$default_lang); $checked = ' checked '; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 3ca5bfbc655..845c2e1012d 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -347,7 +347,7 @@ if ((isModEnabled("product") || isModEnabled("service")) && ($user->rights->prod } // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql .= " WHERE fk_product = ".((int) $objp->rowid); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 7ffbfe814a8..7b6014c6bc1 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -179,7 +179,7 @@ $fieldstosearchall = array( ); // multilang -if (!empty($conf->global->MAIN_MULTILANGS)) { +if (getDolGlobalInt('MAIN_MULTILANGS')) { $fieldstosearchall['pl.label'] = 'ProductLabelTranslated'; $fieldstosearchall['pl.description'] = 'ProductDescriptionTranslated'; $fieldstosearchall['pl.note'] = 'ProductNoteTranslated'; @@ -444,7 +444,7 @@ if (!empty($searchCategoryProductList) || !empty($catid)) { } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; // multilang -if (!empty($conf->global->MAIN_MULTILANGS)) { +if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$db->escape($langs->getDefaultLang())."'"; } @@ -1309,7 +1309,7 @@ if ($resql) { $obj = $db->fetch_object($resql); // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { // If multilang is enabled + if (getDolGlobalInt('MAIN_MULTILANGS')) { // If multilang is enabled $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql .= " WHERE fk_product = ".((int) $obj->rowid); diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index f657eef99eb..4bde44f1892 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -214,7 +214,7 @@ print "
control->tpl['select_workforce']; echo $this->control->tpl['info_admin']; ?>
trans("DefaultLang"); ?> control->tpl['select_lang']; ?>control->tpl['select_workforce']; echo $this->control->tpl['info_admin']; ?>
trans("DefaultLang"); ?> control->tpl['select_lang']; ?>control->tpl['effectif']; ?>
trans("DefaultLang"); ?> control->tpl['default_lang']; ?>
trans("DefaultLang"); ?> control->tpl['select_lang']; ?>
trans("DefaultLang"); ?> control->tpl['select_lang']; ?>control->tpl['typent']; ?>
trans("DefaultLang"); ?> control->tpl['default_lang']; ?>
'.$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 '
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print img_picto('', 'language').$formadmin->select_language($object->default_lang, 'default_lang', 0, 0, 1); print '
'.$langs->trans("DefaultLang").''; //$s=picto_from_langcode($object->default_lang); diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 7fe72779c6c..c0401ce958f 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1366,8 +1366,8 @@ class Thirdparties extends DolibarrApi $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)) { + //if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { if (isset($this->company->thirdparty->default_lang)) { $newlang = $this->company->thirdparty->default_lang; // for proposal, order, invoice, ... } elseif (isset($this->company->default_lang)) { diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 0c1370f7440..0ff76102582 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -535,7 +535,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/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 22b9dc56fae..6110fc7a5e5 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1548,7 +1548,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $allowgenifempty = 0; // Language code (if multilang) - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($db); $defaultlang = $langs->getDefaultLang(); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 7d2bf3c2eb0..da70aa005d9 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -202,7 +202,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); @@ -222,10 +222,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)) { @@ -449,10 +449,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)) { @@ -527,7 +527,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); @@ -659,7 +659,7 @@ if (empty($reshook)) { $label = $productsupplier->label; // 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')) { @@ -852,10 +852,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)) { @@ -1040,7 +1040,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/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 0e8789dc84a..7ecd6e0b3a5 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1721,7 +1721,7 @@ class SupplierProposal 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/ticket/card.php b/htdocs/ticket/card.php index 862ea805a72..d12d84d00f1 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1474,9 +1474,9 @@ if ($action == 'create' || $action == 'presend') { $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($object->thirdparty)) { + } elseif (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && is_object($object->thirdparty)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 524d4589c8e..507240f352f 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1179,7 +1179,7 @@ if ($action == 'create' || $action == 'adduserldap') { print "
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0, 'string', '', 0, 0, 'id', $langs->trans("WarningNotLangOfInterface", $langs->transnoentitiesnoconv("UserGUISetup"))).''."\n"; print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ?GETPOST('default_lang', 'alpha') : ($object->lang ? $object->lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone widthcentpercentminusx'); @@ -1636,7 +1636,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Default language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $langs->load("languages"); require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; print '
'; @@ -2596,7 +2596,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Default language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { print '
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0, 'string', '', 0, 0, 'id', $langs->trans("WarningNotLangOfInterface", $langs->transnoentitiesnoconv("UserGUISetup"))).''."\n"; print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language($object->lang, 'default_lang', 0, null, '1', 0, 0, 'widthcentpercentminusx maxwidth300'); print '