Fix SQL to export categories of contact
Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 Conflicts: htdocs/product/class/product.class.php
This commit is contained in:
commit
70df6130b5
@ -332,7 +332,7 @@ class modCategorie extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .= ' INNER JOIN '.MAIN_DB_PREFIX.'categorie_contact as cc ON cc.fk_categorie = cat.rowid';
|
$this->export_sql_end[$r] .= ' INNER JOIN '.MAIN_DB_PREFIX.'categorie_contact as cc ON cc.fk_categorie = cat.rowid';
|
||||||
$this->export_sql_end[$r] .= ' INNER JOIN '.MAIN_DB_PREFIX.'socpeople as p ON p.rowid = cc.fk_socpeople';
|
$this->export_sql_end[$r] .= ' INNER JOIN '.MAIN_DB_PREFIX.'socpeople as p ON p.rowid = cc.fk_socpeople';
|
||||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra ON extra.fk_object = p.rowid';
|
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra ON extra.fk_object = p.rowid';
|
||||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_civility as civ ON civ.rowid = p.civility';
|
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_civility as civ ON civ.code = p.civility';
|
||||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON c.rowid = p.fk_pays';
|
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON c.rowid = p.fk_pays';
|
||||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc';
|
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc';
|
||||||
$this->export_sql_end[$r] .= ' WHERE cat.entity IN ('.getEntity('category').')';
|
$this->export_sql_end[$r] .= ' WHERE cat.entity IN ('.getEntity('category').')';
|
||||||
|
|||||||
@ -1247,6 +1247,15 @@ class Product extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove extrafields
|
||||||
|
if (!$error) {
|
||||||
|
$result = $this->deleteExtraFields();
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Delete product
|
// Delete product
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$sqlz = "DELETE FROM ".MAIN_DB_PREFIX."product";
|
$sqlz = "DELETE FROM ".MAIN_DB_PREFIX."product";
|
||||||
@ -1274,16 +1283,6 @@ class Product extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove extrafields
|
|
||||||
if (!$error)
|
|
||||||
{
|
|
||||||
$result = $this->deleteExtraFields();
|
|
||||||
if ($result < 0) {
|
|
||||||
$error++;
|
|
||||||
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user