Correct bug #363

This commit is contained in:
FHenry 2012-04-15 11:47:57 +02:00 committed by Regis Houssin
parent df4f59db8a
commit d7ae9db463

View File

@ -439,21 +439,10 @@ class Project extends CommonObject
if ($conf->projet->dir_output)
{
$dir = $conf->projet->dir_output . "/" . $projectref;
$file = $conf->projet->dir_output . "/" . $projectref . "/" . $projectref . ".pdf";
if (file_exists($file))
{
dol_delete_preview($this);
if (!dol_delete_file($file))
{
$this->error = 'ErrorFailToDeleteFile';
$this->db->rollback();
return 0;
}
}
if (file_exists($dir))
{
$res = @dol_delete_dir($dir);
$res = @dol_delete_dir_recursive($dir);
if (!$res)
{
$this->error = 'ErrorFailToDeleteDir';