update code toward php8 compliance

This commit is contained in:
Philippe GRAND 2022-09-24 14:42:35 +02:00
parent accb4b6463
commit fdd79cfa14
4 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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