From 19dd7ccf215288bf925c4e89b1f249ae51fff0c5 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 16 Aug 2013 09:05:20 +0000 Subject: [PATCH] * eMail/Filemanager: when saving mail to filemanager, add headerdata without subject to file - comment field --- felamimail/inc/class.felamimail_bo.inc.php | 10 +++++----- felamimail/inc/class.uidisplay.inc.php | 13 +++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/felamimail/inc/class.felamimail_bo.inc.php b/felamimail/inc/class.felamimail_bo.inc.php index 8fe2472acf..8fa3f092be 100644 --- a/felamimail/inc/class.felamimail_bo.inc.php +++ b/felamimail/inc/class.felamimail_bo.inc.php @@ -4914,7 +4914,7 @@ class felamimail_bo /** * createHeaderInfoSection - creates a textual headersection from headerobject * @param array header headerarray may contain SUBJECT,FROM,SENDER,TO,CC,BCC,DATE,PRIORITY,IMPORTANCE - * @param string headline Text tom use for headline + * @param string headline Text tom use for headline, if SUPPRESS, supress headline and footerline * @param bool createHTML do it with HTML breaks * @return string a preformatted string with the information of the header worked into it */ @@ -4933,13 +4933,13 @@ class felamimail_bo //if ($mailcontent['headers']['ORGANIZATION']) $headdata .= lang('organization').': '.$mailcontent['headers']['ORGANIZATION']."\ if (!empty($headdata)) { - if (!empty($headline)) $headdata = "---------------------------- $headline ----------------------------".($createHTML?"
":"\n").$headdata; - if (empty($headline)) $headdata = "--------------------------------------------------------".($createHTML?"
":"\n").$headdata; - $headdata .= "--------------------------------------------------------".($createHTML?"
":"\n"); + if (!empty($headline) && $headline != 'SUPPRESS') $headdata = "---------------------------- $headline ----------------------------".($createHTML?"
":"\n").$headdata; + if (empty($headline)) $headdata = ($headline != 'SUPPRESS'?"--------------------------------------------------------".($createHTML?"
":"\n"):'').$headdata; + $headdata .= ($headline != 'SUPPRESS'?"--------------------------------------------------------".($createHTML?"
":"\n"):''); } else { - $headdata = "--------------------------------------------------------".($createHTML?"
":"\n"); + $headdata = ($headline != 'SUPPRESS'?"--------------------------------------------------------".($createHTML?"
":"\n"):''); } return $headdata; } diff --git a/felamimail/inc/class.uidisplay.inc.php b/felamimail/inc/class.uidisplay.inc.php index ea8739ae42..91e4a5453b 100644 --- a/felamimail/inc/class.uidisplay.inc.php +++ b/felamimail/inc/class.uidisplay.inc.php @@ -1358,8 +1358,21 @@ blockquote[type=cite] { !fwrite($fp,$message)) { $err .= 'alert("'.addslashes(lang('Error saving %1!',$file)).'");'; + $succeeded = false; + } + else + { + $succeeded = true; } if ($fp) fclose($fp); + if ($succeeded) + { + $headers = $this->bofelamimail->getMessageHeader($this->uid,$partID,true); + unset($headers['SUBJECT']);//already in filename + $infoSection = felamimail_bo::createHeaderInfoSection($headers, 'SUPPRESS', false); + $props = array(array('name' => 'comment','val' => $infoSection)); + egw_vfs::proppatch($file,$props); + } } $this->bofelamimail->closeConnection();