From 6e2152582af447edc1475e64679a76b219ba7b81 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 23 Apr 2009 11:47:30 -0600 Subject: [PATCH] Bug #8203: Fix redirect compose --- imp/js/src/compose.js | 38 +++++++++++++++++--------------------- imp/lib/UI/Compose.php | 3 +-- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/imp/js/src/compose.js b/imp/js/src/compose.js index d81367604..3ce9960aa 100644 --- a/imp/js/src/compose.js +++ b/imp/js/src/compose.js @@ -149,24 +149,19 @@ var ImpCompose = { uniqSubmit: function(actionID, e) { + var form; + e.stop(); if (actionID == 'redirect') { if ($F('to') == '') { alert(IMP.text.compose_recipient); $('to').focus(); - } else { - // Ticket #6727; this breaks on WebKit w/FCKeditor. - if (!Prototype.Browser.WebKit) { - $('redirect').setStyle({ cursor: 'wait' }); - } - this.display_unload_warning = false; + return; } - return; - } - - if (actionID == 'send_message') { + form = $('redirect'); + } else if (actionID == 'send_message') { if (($F('subject') == '') && !window.confirm(IMP.text.compose_nosubject)) { return; @@ -180,30 +175,31 @@ var ImpCompose = { return; } - } + this.skip_spellcheck = false; - this.skip_spellcheck = false; + if (IMP.SpellCheckerObject) { + IMP.SpellCheckerObject.resume(); + } - if (IMP.SpellCheckerObject) { - IMP.SpellCheckerObject.resume(); + form = $('compose'); + $('actionID').setValue('send_message'); } // Ticket #6727; this breaks on WebKit w/FCKeditor. if (!Prototype.Browser.WebKit) { - $('compose').setStyle({ cursor: 'wait' }); + form.setStyle({ cursor: 'wait' }); } this.display_unload_warning = false; - $('actionID').setValue(actionID); - this._uniqSubmit(); + this._uniqSubmit(form); }, - _uniqSubmit: function() + _uniqSubmit: function(form) { if (this.textarea_ready) { - $('compose').submit(); + form.submit(); } else { - this._uniqSubmit.defer(); + this._uniqSubmit.bind(this, form).defer(); } }, @@ -253,7 +249,7 @@ var ImpCompose = { if (typeof IMP.SpellCheckerObject != 'object') { // If we fired before the onload that initializes the spellcheck, // wait. - this.initializeSpellChecker.defer(); + this.initializeSpellChecker.bind(this).defer(); return; } diff --git a/imp/lib/UI/Compose.php b/imp/lib/UI/Compose.php index 9112cc20f..bfd2e0be9 100644 --- a/imp/lib/UI/Compose.php +++ b/imp/lib/UI/Compose.php @@ -62,9 +62,8 @@ class IMP_UI_Compose IMP_Maillog::log('redirect', $headers->getValue('message-id'), $recipients); } - $bodytext = $contents->getBody(); try { - $imp_compose->sendMessage($recipients, $headers, $bodytext, $charset); + $imp_compose->sendMessage($recipients, $headers, $mime_message, $charset); } catch (IMP_Compose_Exception $e) { throw new Horde_Exception($e); } -- 2.11.0