Fix clean of contract
This commit is contained in:
parent
f51b02026c
commit
d9ca9fe22d
@ -1237,8 +1237,8 @@ class Contrat extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error)
|
// Delete lines
|
||||||
{
|
if (!$error) {
|
||||||
// Delete contratdet extrafields
|
// Delete contratdet extrafields
|
||||||
$main = MAIN_DB_PREFIX . 'contratdet';
|
$main = MAIN_DB_PREFIX . 'contratdet';
|
||||||
$ef = $main . "_extrafields";
|
$ef = $main . "_extrafields";
|
||||||
@ -1268,9 +1268,21 @@ class Contrat extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete llx_ecm_files
|
||||||
|
if (!$error) {
|
||||||
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."ecm_files WHERE src_object_type = '".$this->db->escape($this->table_element.(empty($this->module) ? '' : '@'.$this->module))."' AND src_object_id = ".$this->id;
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if (!$resql)
|
||||||
|
{
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
$this->errors[] = $this->error;
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete contract
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
// Delete contrat
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."contrat";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."contrat";
|
||||||
$sql .= " WHERE rowid=".$this->id;
|
$sql .= " WHERE rowid=".$this->id;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user