update code toward php8 compliance

This commit is contained in:
Philippe GRAND 2022-09-24 14:45:52 +02:00
parent 1dc58f9684
commit dde7bb63a7
7 changed files with 12 additions and 12 deletions

View File

@ -316,7 +316,7 @@ class mailing_thirdparties extends MailingTargets
$s .= '</select>'; $s .= '</select>';
$s .= ajax_combobox("filter_status_thirdparties"); $s .= ajax_combobox("filter_status_thirdparties");
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
// Choose language // Choose language
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($this->db); $formadmin = new FormAdmin($this->db);

View File

@ -195,7 +195,7 @@ class modService extends DolibarrModules
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('group_concat(cat.label)'=>'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')); $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)) { 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")) { 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')); $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')); $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)) { 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")) { 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')); $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')); $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)) { 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")) { 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')); $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')); $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)) { if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
@ -272,7 +272,7 @@ class modService extends DolibarrModules
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { 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'; $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_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'; $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'); 'pr.date_price'=>'2013-04-10');
} }
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
// Import translations of product names and descriptions // Import translations of product names and descriptions
$r++; $r++;
$this->import_code[$r] = $this->rights_class.'_languages'; $this->import_code[$r] = $this->rights_class.'_languages';

View File

@ -491,7 +491,7 @@ class pdf_standard extends ModelePDFMovement
$objp = $this->db->fetch_object($resql); $objp = $this->db->fetch_object($resql);
// Multilangs // 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 = "SELECT label";
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql .= " WHERE fk_product = ".((int) $objp->rowid); $sql .= " WHERE fk_product = ".((int) $objp->rowid);

View File

@ -793,7 +793,7 @@ class pdf_azur extends ModelePDFPropales
// Find the desire PDF // Find the desire PDF
$filetomerge = new Propalmergepdfproduct($this->db); $filetomerge = new Propalmergepdfproduct($this->db);
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang); $filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang);
} else { } else {
$filetomerge->fetch_by_product($line->fk_product); $filetomerge->fetch_by_product($line->fk_product);

View File

@ -918,7 +918,7 @@ class pdf_cyan extends ModelePDFPropales
// Find the desire PDF // Find the desire PDF
$filetomerge = new Propalmergepdfproduct($this->db); $filetomerge = new Propalmergepdfproduct($this->db);
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang); $filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang);
} else { } else {
$filetomerge->fetch_by_product($line->fk_product); $filetomerge->fetch_by_product($line->fk_product);

View File

@ -306,7 +306,7 @@ class pdf_standard extends ModelePDFStock
$objp = $this->db->fetch_object($resql); $objp = $this->db->fetch_object($resql);
// Multilangs // 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 = "SELECT label";
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql .= " WHERE fk_product = ".((int) $objp->rowid); $sql .= " WHERE fk_product = ".((int) $objp->rowid);

View File

@ -243,7 +243,7 @@ print '</td><td>'."\n";
print '</td></tr>'."\n"; print '</td></tr>'."\n";
// Customer Default Langauge // Customer Default Langauge
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '<tr><td>'.$langs->trans("DefaultLang"); print '<tr><td>'.$langs->trans("DefaultLang");
if (!empty($array_query['cust_language'])) { if (!empty($array_query['cust_language'])) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');