From f9700dc941106fcdfdd019c40ee47d6c83652c33 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Dec 2012 14:37:15 +0100 Subject: [PATCH] Fix: [ bug #651 ] FusionPDF created files cannot be deleted --- htdocs/compta/facture/impayees.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 7b60344fc06..15309b3f70e 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -129,6 +129,20 @@ if ($action == "builddoc" && $user->rights->facture->lire) } } +// Remove file +if ($action == 'remove_file') +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $langs->load("other"); + $upload_dir = $diroutputpdf; + $file = $upload_dir . '/' . GETPOST('file'); + $ret=dol_delete_file($file,0,0,0,''); + if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); + else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); + $action=''; +} + /*