From d93db2033244416d71901532508e934917e1495e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 31 May 2006 10:33:05 +0000 Subject: [PATCH] =?UTF-8?q?On=20efface=20le=20rep=E9rtoire=20du=20pdf=20pr?= =?UTF-8?q?ovisoire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/commande/commande.class.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 63a0f8f9b33..6105b82b1af 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -172,7 +172,23 @@ class Commande if ($this->db->query($sql) ) { - $result = 1; + // On efface le répertoire de pdf provisoire + $comref = sanitize_string($this->ref); + $comref = str_replace("(","",$comref); + $comref = str_replace(")","",$comref); + if ($conf->commande->dir_output) + { + $dir = $conf->commande->dir_output . "/" . $comref ; + if (file_exists($dir)) + { + if (!dol_delete_file($dir)) + { + $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); + return 0; + } + } + } + $result = 1; } else {