This commit is contained in:
Regis Houssin 2006-05-31 11:41:39 +00:00
parent 45a0d11bb7
commit 5c38e1214e
3 changed files with 8 additions and 7 deletions

View File

@ -184,7 +184,7 @@ class Commande
{
if (!dol_delete_file($file))
{
$this->error=$langs->trans("ErrorCanNotDeleteFile",$dir);
$this->error=$langs->trans("ErrorCanNotDeleteFile",$file);
return 0;
}
}

View File

@ -290,6 +290,7 @@ class Expedition
$this->db->begin();
$error = 0;
$provref = $this->ref;
if ($user->rights->expedition->valider)
{
@ -350,18 +351,18 @@ class Expedition
}
// On efface le répertoire de pdf provisoire
$expeditionref = sanitize_string($this->ref);
$expeditionref = sanitize_string($provref);
$expeditionref = str_replace("(","",$expeditionref);
$expeditionref = str_replace(")","",$expeditionref);
if ($conf->expedition->dir_output)
{
$dir = $conf->expedition->dir_output . "/" . $expeditionref ;
$file = $conf->expedition->dir_output . "/" . $expeditionref . "/" . $expeditionref . ".pdf";
$dir = $conf->expedition->dir_output . "/" . $expeditionref;
$file = $dir . "/" . $expeditionref . ".pdf";
if (file_exists($file))
{
if (!dol_delete_file($file))
{
$this->error=$langs->trans("ErrorCanNotDeleteFile",$dir);
$this->error=$langs->trans("ErrorCanNotDeleteFile",$file);
return 0;
}
}

View File

@ -346,12 +346,12 @@ class Livraison
if ($conf->expedition->dir_output)
{
$dir = $conf->livraison->dir_output . "/" . $livraisonref ;
$file = $conf->livraison->dir_output . "/" . $livraisonref . "/" . $livraisonref . ".pdf";
$file = $dir . "/" . $livraisonref . ".pdf";
if (file_exists($file))
{
if (!dol_delete_file($file))
{
$this->error=$langs->trans("ErrorCanNotDeleteFile",$dir);
$this->error=$langs->trans("ErrorCanNotDeleteFile",$file);
return 0;
}
}