From 5421a20fc00949da283fc796964b46ad970219e4 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 29 Nov 2012 16:18:40 +0000 Subject: [PATCH] * email: set preset signature below the preconfigured mailbody (if sig was configured on top), when sending meeting requests --- felamimail/inc/class.uicompose.inc.php | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/felamimail/inc/class.uicompose.inc.php b/felamimail/inc/class.uicompose.inc.php index 460870001c..15b89813c0 100644 --- a/felamimail/inc/class.uicompose.inc.php +++ b/felamimail/inc/class.uicompose.inc.php @@ -230,8 +230,10 @@ */ function compose($_focusElement='to',$suppressSigOnTop=false, $isReply=false) { + //error_log(__METHOD__.__LINE__.array2string($_REQUEST)); // read the data from session // all values are empty for a new compose window + $insertSigOnTop = false; $sessionData = $this->bocompose->getSessionData(); $alwaysAttachVCardAtCompose = false; // we use this to eliminate double attachments, if users VCard is already present/attached if ( isset($GLOBALS['egw_info']['apps']['stylite']) && (isset($this->bocompose->preferencesArray['attachVCardAtCompose']) && @@ -275,6 +277,15 @@ { $names = (array)$_REQUEST['preset']['name']; $types = (array)$_REQUEST['preset']['type']; + //if (!empty($types) && in_array('text/calendar; method=request',$types)) + if (!empty($types) && in_array('text/calendar',$types)) + { + $insertSigOnTop = 'below'; + } + else + { + //$insertSigOnTop = 'top'; // more complicated + } $files = (array)$_REQUEST['preset']['file']; foreach($files as $k => $path) { @@ -629,14 +640,14 @@ { $disableRuler = true; } - $insertSigOnTop = false; + //error_log(__METHOD__.__LINE__.array2string($this->bocompose->preferencesArray)); if (isset($this->bocompose->preferencesArray['insertSignatureAtTopOfMessage']) && $this->bocompose->preferencesArray['insertSignatureAtTopOfMessage'] && !(isset($_POST['mySigID']) && !empty($_POST['mySigID']) ) && !$suppressSigOnTop ) { - $insertSigOnTop = true; + $insertSigOnTop = ($insertSigOnTop?$insertSigOnTop:true); if($sessionData['mimeType'] == 'html') { $before = ($disableRuler ?' 
':' 

'); $inbetween = ' 
'; @@ -646,7 +657,15 @@ } $sigText = felamimail_bo::merge($signature->fm_signature,array($GLOBALS['egw']->accounts->id2name($GLOBALS['egw_info']['user']['account_id'],'person_id'))); if ($sessionData['mimeType'] == 'html') $sigText = "".$sigText.""; - $sessionData['body'] = $before.($sessionData['mimeType'] == 'html'?$sigText:$this->bocompose->convertHTMLToText($sigText)).$inbetween.$sessionData['body']; + + if ($insertSigOnTop === 'below') + { + $sessionData['body'] = $sessionData['body'].$before.($sessionData['mimeType'] == 'html'?$sigText:$this->bocompose->convertHTMLToText($sigText)); + } + else + { + $sessionData['body'] = $before.($sessionData['mimeType'] == 'html'?$sigText:$this->bocompose->convertHTMLToText($sigText)).$inbetween.$sessionData['body']; + } } // prepare body // in a way, this tests if we are having real utf-8 (the displayCharset) by now; we should if charsets reported (or detected) are correct