diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index c394bb8ddb..091dbb3158 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -939,12 +939,18 @@ class mail_compose if (stripos($content['body'],'')!==false) $content['body'] = str_ireplace(array('',''),array('',''),$content['body']); //error_log(__METHOD__.__LINE__.array2string($this->mailPreferences)); $blockElements = array('address','blockquote','center','del','dir','div','dl','fieldset','form','h1','h2','h3','h4','h5','h6','hr','ins','isindex','menu','noframes','noscript','ol','p','pre','table','ul'); - if (isset($this->mailPreferences['insertSignatureAtTopOfMessage']) && - $this->mailPreferences['insertSignatureAtTopOfMessage'] && + if ($this->mailPreferences['insertSignatureAtTopOfMessage']!='no_belowaftersend' && !(isset($_POST['mySigID']) && !empty($_POST['mySigID']) ) && !$suppressSigOnTop ) { - $insertSigOnTop = ($insertSigOnTop?$insertSigOnTop:true); + // ON tOP OR BELOW? pREF CAN TELL + /* + Signature behavior preference changed. New default, if not set -> 0 + '0' => 'After reply, visible during compose', + '1' => 'Before reply, visible during compose', + 'no_belowaftersend' => 'Appened after reply before sending', + */ + $insertSigOnTop = ($insertSigOnTop?$insertSigOnTop:($this->mailPreferences['insertSignatureAtTopOfMessage']?$this->mailPreferences['insertSignatureAtTopOfMessage']:'below')); $sigText = mail_bo::merge($signature['ident_signature'],array($GLOBALS['egw']->accounts->id2name($GLOBALS['egw_info']['user']['account_id'],'person_id'))); if ($content['mimeType'] == 'html') { @@ -2067,8 +2073,14 @@ class mail_compose } $disableRuler = false; $signature = $_identity['ident_signature']; - - if ((isset($this->mailPreferences['insertSignatureAtTopOfMessage']) && $this->mailPreferences['insertSignatureAtTopOfMessage'])) + /* + Signature behavior preference changed. New default, if not set -> 0 + '0' => 'After reply, visible during compose', + '1' => 'Before reply, visible during compose', + 'no_belowaftersend' => 'Appened after reply before sending', + */ + $sigAlreadyThere = $this->mailPreferences['insertSignatureAtTopOfMessage']!='no_belowaftersend'?1:0; + if ($sigAlreadyThere) { // note: if you use stationery ' s the insert signatures at the top does not apply here anymore, as the signature // is already part of the body, so the signature part of the template will not be applied. @@ -2080,11 +2092,12 @@ class mail_compose { $disableRuler = true; } - + /* should be handled by identity object itself if($signature) { $signature = mail_bo::merge($signature,array($GLOBALS['egw']->accounts->id2name($GLOBALS['egw_info']['user']['account_id'],'person_id'))); } + */ if ($_formData['attachments'] && $_formData['filemode'] != egw_sharing::ATTACH && $_send) { $attachment_links = $this->getAttachmentLinks($_formData['attachments'], $_formData['filemode'], diff --git a/mail/inc/class.mail_hooks.inc.php b/mail/inc/class.mail_hooks.inc.php index bdec835027..84462f7ee1 100644 --- a/mail/inc/class.mail_hooks.inc.php +++ b/mail/inc/class.mail_hooks.inc.php @@ -321,7 +321,7 @@ class mail_hooks 'values' => array( '0' => 'After reply, visible during compose', '1' => 'Before reply, visible during compose', - '' => 'Appened after reply before sending', + 'no_belowaftersend' => 'Appened after reply before sending', ), 'xmlrpc' => True, 'default'=> '0',