diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index b0c2903d28e..03ac96d6c9e 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -318,6 +318,20 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post } } +// Efface les fichiers +if ($action=='remove_file') +{ + $com = new Commande($db); + + if ($com->fetch($id)) + { + $upload_dir = $conf->commande->dir_output . "/" . $com->ref; + $file = $upload_dir . '/' . urldecode($_GET['urlfile']); + dol_delete_file($file); + $mesg = '
'.$langs->trans("FileWasRemoved").'
'; + } +} + /* * Envoi de la commande par mail */