update code toward php8 compliance

This commit is contained in:
Philippe GRAND 2022-09-24 14:54:23 +02:00
parent 90c923a94b
commit 804f13fbe6
5 changed files with 18 additions and 18 deletions

View File

@ -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";

View File

@ -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);

View File

@ -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';

View File

@ -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;

View File

@ -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);