From d7ae9db4637fc6ace80cc51e438c077fa8e55803 Mon Sep 17 00:00:00 2001 From: FHenry <florian.henry.mail@gmail.com> Date: Sun, 15 Apr 2012 11:47:57 +0200 Subject: [PATCH] Correct bug #363 --- htdocs/projet/class/project.class.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index b9c81f699ea..bb47ec80fe8 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -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'; -- GitLab