From 4a74ebc1f9a511977333981ac267fa6052ec5cec 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 01bcf3599d2..3d0adbfcda8 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -128,6 +128,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=''; +} + /*