2
0
forked from Wavyzz/dolibarr

Fix php8.2 warnings

This commit is contained in:
Laurent Destailleur
2023-11-27 11:39:32 +01:00
parent de96af8543
commit 53dab922fd
407 changed files with 2909 additions and 2908 deletions

View File

@@ -151,7 +151,7 @@ class modService extends DolibarrModules
//--------
$r = 0;
$alias_product_perentity = empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? "p" : "ppe";
$alias_product_perentity = !getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p" : "ppe";
$r++;
$this->export_code[$r] = $this->rights_class.'_'.$r;
@@ -192,7 +192,7 @@ class modService extends DolibarrModules
if (isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('s.nom'=>'Supplier', 'pf.ref_fourn'=>'SupplierRef', 'pf.quantity'=>'QtyMin', 'pf.remise_percent'=>'DiscountQtyMin', 'pf.unitprice'=>'BuyingPrice', 'pf.delivery_time_days'=>'NbDaysToDelivery'));
}
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
if (getDolGlobalString('EXPORTTOOL_CATEGORIES')) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('group_concat(cat.label)'=>'Categories'));
}
if (getDolGlobalInt('MAIN_MULTILANGS')) {
@@ -227,11 +227,11 @@ class modService extends DolibarrModules
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)) {
if (getDolGlobalString('EXPORTTOOL_CATEGORIES')) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array("group_concat(cat.label)"=>'Text'));
}
$this->export_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
if (getDolGlobalString('EXPORTTOOL_CATEGORIES')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array("group_concat(cat.label)"=>'category'));
}
if (isModEnabled('stock')) {
@@ -246,7 +246,7 @@ class modService extends DolibarrModules
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)) {
if (getDolGlobalString('EXPORTTOOL_CATEGORIES')) {
$this->export_dependencies_array[$r] = array('category'=>'p.rowid');
}
if (isModEnabled('stock')) {
@@ -261,15 +261,15 @@ class modService extends DolibarrModules
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)) {
if (getDolGlobalString('EXPORTTOOL_CATEGORIES')) {
$this->export_dependencies_array[$r] = array('category'=>'p.rowid');
}
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'product as p';
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$this->export_sql_end[$r] .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
}
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
if (getDolGlobalString('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 (getDolGlobalInt('MAIN_MULTILANGS')) {
@@ -280,12 +280,12 @@ class modService extends DolibarrModules
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc';
}
$this->export_sql_end[$r] .= ' WHERE p.fk_product_type = 1 AND p.entity IN ('.getEntity('product').')';
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
if (getDolGlobalString('EXPORTTOOL_CATEGORIES')) {
$this->export_sql_order[$r] = ' GROUP BY p.rowid'; // FIXME The group by used a generic value to say "all fields in select except function fields"
}
if (!isModEnabled("product")) { // We enable next import templates only if module product not already enabled (to avoid duplicate entries)
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
// Exports product multiprice
$r++;
$this->export_code[$r] = $this->rights_class.'_'.$r;
@@ -319,7 +319,7 @@ class modService extends DolibarrModules
$this->export_sql_end[$r] .= ' WHERE p.entity IN ('.getEntity('product').')'; // For product and service profile
}
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
// Exports product multiprice
$r++;
$this->export_code[$r] = $this->rights_class.'_'.$r;
@@ -352,7 +352,7 @@ class modService extends DolibarrModules
$this->export_sql_end[$r] .= ' WHERE p.entity IN ('.getEntity('product').')'; // For product and service profile
}
if (!empty($conf->global->PRODUIT_SOUSPRODUITS)) {
if (getDolGlobalString('PRODUIT_SOUSPRODUITS')) {
// Exports virtual products
$r++;
$this->export_code[$r] = $this->rights_class.'_'.$r;
@@ -415,7 +415,7 @@ class modService extends DolibarrModules
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p2.rowid'=>"subproduct", 'p2.ref'=>"subproduct", 'p2.label'=>"subproduct", 'p2.description'=>"subproduct"));
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'product as p';
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$this->export_sql_end[$r] .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as pac ON pac.fk_product = p.rowid AND pac.entity = " . ((int) $conf->entity);
}
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object,';
@@ -792,7 +792,7 @@ class modService extends DolibarrModules
'sp.multicurrency_price'=>''
));
}
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
if (getDolGlobalString('PRODUCT_USE_SUPPLIER_PACKAGING')) {
$this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
'sp.packagning'=>'10',
));
@@ -801,7 +801,7 @@ class modService extends DolibarrModules
$this->import_updatekeys_array[$r] = array('sp.fk_product'=>'ProductOrService', 'sp.ref_fourn'=>'SupplierRef', 'sp.fk_soc'=>'Supplier');
}
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
// Import products multiprices
$r++;
$this->import_code[$r] = $this->rights_class.'_multiprice';
@@ -815,7 +815,7 @@ class modService extends DolibarrModules
'pr.price'=>"PriceLevelUnitPriceHT", 'pr.price_ttc'=>"PriceLevelUnitPriceTTC",
'pr.price_min'=>"MinPriceLevelUnitPriceHT", 'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
'pr.date_price'=>'DateCreation*');
if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {
$this->import_fields_array[$r]['pr.tva_tx'] = 'VATRate';
}
if (is_object($mysoc) && $usenpr) {