correct bug 364
This commit is contained in:
parent
779e33d490
commit
1a56c5b021
@ -321,7 +321,6 @@ class Task extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Delete associated link file
|
//Delete associated link file
|
||||||
|
|
||||||
//retreive project ref to know project folder
|
//retreive project ref to know project folder
|
||||||
$sql = "SELECT p.ref";
|
$sql = "SELECT p.ref";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task as t INNER JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid=t.fk_projet";
|
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task as t INNER JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid=t.fk_projet";
|
||||||
@ -339,24 +338,6 @@ class Task extends CommonObject
|
|||||||
}
|
}
|
||||||
$this->db->free($resql_projref);
|
$this->db->free($resql_projref);
|
||||||
|
|
||||||
if ($conf->projet->dir_output)
|
|
||||||
{
|
|
||||||
$dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($projectref) . '/' . dol_sanitizeFileName($this->id);
|
|
||||||
dol_syslog(get_class($this)."::delete(retreive proj ref) dir=".$dir, LOG_DEBUG);
|
|
||||||
if (file_exists($dir))
|
|
||||||
{
|
|
||||||
require_once(DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php");
|
|
||||||
$res = @dol_delete_dir_recursive($dir);
|
|
||||||
if (!$res)
|
|
||||||
{
|
|
||||||
$this->error = 'ErrorFailToDeleteDir';
|
|
||||||
$this->db->rollback();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Delete linked contacts
|
// Delete linked contacts
|
||||||
@ -370,7 +351,6 @@ class Task extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Delete rang of line
|
// Delete rang of line
|
||||||
//$this->delRangOfLine($this->id, $this->element);
|
//$this->delRangOfLine($this->id, $this->element);
|
||||||
|
|
||||||
@ -407,8 +387,28 @@ class Task extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
|
||||||
|
$this->db->free($resql);
|
||||||
|
|
||||||
|
//Delete associated link file
|
||||||
|
if ($conf->projet->dir_output)
|
||||||
|
{
|
||||||
|
$dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($projectref) . '/' . dol_sanitizeFileName($this->id);
|
||||||
|
dol_syslog(get_class($this)."::delete(retreive proj ref) dir=".$dir, LOG_DEBUG);
|
||||||
|
if (file_exists($dir))
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php");
|
||||||
|
$res = @dol_delete_dir_recursive($dir);
|
||||||
|
if (!$res)
|
||||||
|
{
|
||||||
|
$this->error = 'ErrorFailToDeleteDir';
|
||||||
|
$this->db->rollback();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user