update code toward php8 compliance
This commit is contained in:
parent
accb4b6463
commit
fdd79cfa14
@ -119,7 +119,7 @@ class box_produits extends ModeleBoxes
|
|||||||
$datem = $this->db->jdate($objp->tms);
|
$datem = $this->db->jdate($objp->tms);
|
||||||
|
|
||||||
// Multilangs
|
// 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 = "SELECT label";
|
||||||
$sqld .= " FROM ".MAIN_DB_PREFIX."product_lang";
|
$sqld .= " FROM ".MAIN_DB_PREFIX."product_lang";
|
||||||
$sqld .= " WHERE fk_product = ".((int) $objp->rowid);
|
$sqld .= " WHERE fk_product = ".((int) $objp->rowid);
|
||||||
|
|||||||
@ -4989,7 +4989,7 @@ abstract class CommonObject
|
|||||||
$text = $product_static->getNomUrl(1);
|
$text = $product_static->getNomUrl(1);
|
||||||
|
|
||||||
// Define output language and label
|
// Define output language and label
|
||||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
if (getDolGlobalInt('MAIN_MULTILANGS')) {
|
||||||
if (property_exists($this, 'socid') && !is_object($this->thirdparty)) {
|
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');
|
dol_print_error('', 'Error: Method printObjectLine was called on an object and object->fetch_thirdparty was not done before');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -2562,7 +2562,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Multilang : we add translation
|
// Multilang : we add translation
|
||||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
if (getDolGlobalInt('MAIN_MULTILANGS')) {
|
||||||
$sql .= ", pl.label as label_translated";
|
$sql .= ", pl.label as label_translated";
|
||||||
$sql .= ", pl.description as description_translated";
|
$sql .= ", pl.description as description_translated";
|
||||||
$selectFields .= ", label_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";
|
$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
|
||||||
}
|
}
|
||||||
// Multilang : we add translation
|
// 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 ";
|
$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)) {
|
if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && !empty($socid)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
@ -2671,7 +2671,7 @@ class Form
|
|||||||
$sql .= " AND ";
|
$sql .= " AND ";
|
||||||
}
|
}
|
||||||
$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
|
$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)."%'";
|
$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
|
||||||
}
|
}
|
||||||
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
|
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
|
||||||
@ -2679,7 +2679,7 @@ class Form
|
|||||||
}
|
}
|
||||||
if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) {
|
if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) {
|
||||||
$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
|
$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)."%'";
|
$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2885,7 +2885,7 @@ class Form
|
|||||||
$outrefcust = empty($objp->custref) ? '' : $objp->custref;
|
$outrefcust = empty($objp->custref) ? '' : $objp->custref;
|
||||||
$outlabel = $objp->label;
|
$outlabel = $objp->label;
|
||||||
$outdesc = $objp->description;
|
$outdesc = $objp->description;
|
||||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
if (getDolGlobalInt('MAIN_MULTILANGS')) {
|
||||||
$outlabel_translated = $objp->label_translated;
|
$outlabel_translated = $objp->label_translated;
|
||||||
$outdesc_translated = $objp->description_translated;
|
$outdesc_translated = $objp->description_translated;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -728,7 +728,7 @@ class FormFile
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Language code (if multilang)
|
// 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';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||||
$formadmin = new FormAdmin($this->db);
|
$formadmin = new FormAdmin($this->db);
|
||||||
$defaultlang = ($codelang && $codelang != 'auto') ? $codelang : $langs->getDefaultLang();
|
$defaultlang = ($codelang && $codelang != 'auto') ? $codelang : $langs->getDefaultLang();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user