From a612289136ae83dff50efff777dea8d353fe99cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Nov 2015 03:02:31 +0100 Subject: [PATCH] FIX Storing and deleting files on emailing was done at wrong place --- htdocs/comm/mailing/card.php | 14 +++++++++++--- htdocs/core/lib/functions.lib.php | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 8ab7fc91233..2ff7796bfae 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -544,7 +544,7 @@ if (empty($reshook)) require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - dol_remove_file_process($_POST['removedfile'],0); + dol_remove_file_process($_POST['removedfile'],0,0); // We really delete file linked to mailing $action="edit"; } @@ -1093,7 +1093,10 @@ else } print ''; - print ""; + + dol_fiche_end(); + + print "\n"; print '
'."\n"; @@ -1103,6 +1106,9 @@ else // Print mail content print load_fiche_titre($langs->trans("EMail"),'',''); + + dol_fiche_head(); + print ''; // Subject @@ -1168,7 +1174,9 @@ else print '
'; - print '
'; + dol_fiche_end(); + + print '
'; print ''; print '     '; print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 78dfcf11706..727dd9d8a9e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3860,7 +3860,7 @@ function get_exdir($num,$level,$alpha,$withoutslash,$object,$modulepart) $path = ''; - if (! empty($level) && in_array($modulepart, array('cheque','user','category','holiday','shipment', 'member','don','donation','supplier_invoice','invoice_supplier'))) + if (! empty($level) && in_array($modulepart, array('cheque','user','category','holiday','shipment', 'member','don','donation','supplier_invoice','invoice_supplier','mailing'))) { // This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided if (empty($alpha)) $num = preg_replace('/([^0-9])/i','',$num);