Fix: big problem with files upload and more compatible with external

modules
This commit is contained in:
Regis Houssin
2012-05-29 23:00:12 +02:00
parent 763e2a96a4
commit b5246add8d
12 changed files with 93 additions and 29 deletions

View File

@@ -2302,7 +2302,7 @@ class Commande extends CommonObject
{
dol_delete_preview($this);
if (!dol_delete_file($file))
if (! dol_delete_file($file,0,0,0,$this)) // For triggers
{
$this->error=$langs->trans("ErrorCanNotDeleteFile",$file);
$this->db->rollback();
@@ -2311,7 +2311,7 @@ class Commande extends CommonObject
}
if (file_exists($dir))
{
if (!dol_delete_dir($dir))
if (! dol_delete_dir($dir))
{
$this->error=$langs->trans("ErrorCanNotDeleteDir",$dir);
$this->db->rollback();