Fix: you can not delete project document folder in delete task method
This commit is contained in:
parent
1a56c5b021
commit
64ddee017b
@ -319,24 +319,6 @@ class Task extends CommonObject
|
|||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Delete associated link file
|
|
||||||
//retreive project ref to know project folder
|
|
||||||
$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.= " WHERE t.rowid = ".$this->id;
|
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::delete(retreive proj ref) sql=".$sql, LOG_DEBUG);
|
|
||||||
$resql_projref=$this->db->query($sql);
|
|
||||||
if ($resql_projref)
|
|
||||||
{
|
|
||||||
if ($this->db->num_rows($resql_projref))
|
|
||||||
{
|
|
||||||
$obj = $this->db->fetch_object($resql_projref);
|
|
||||||
$projectref = $obj->ref;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->db->free($resql_projref);
|
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -392,9 +374,14 @@ class Task extends CommonObject
|
|||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
//Delete associated link file
|
//Delete associated link file
|
||||||
|
// TODO you can not delete project document folder in delete task method
|
||||||
|
/*
|
||||||
if ($conf->projet->dir_output)
|
if ($conf->projet->dir_output)
|
||||||
{
|
{
|
||||||
$dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($projectref) . '/' . dol_sanitizeFileName($this->id);
|
$projectstatic=new Project($this->db);
|
||||||
|
$projectstatic->fetch($this->fk_project);
|
||||||
|
|
||||||
|
$dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($projectstatic->ref) . '/' . dol_sanitizeFileName($this->id);
|
||||||
dol_syslog(get_class($this)."::delete(retreive proj ref) dir=".$dir, LOG_DEBUG);
|
dol_syslog(get_class($this)."::delete(retreive proj ref) dir=".$dir, LOG_DEBUG);
|
||||||
if (file_exists($dir))
|
if (file_exists($dir))
|
||||||
{
|
{
|
||||||
@ -408,6 +395,7 @@ class Task extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user