From: Michael M Slusarz Date: Thu, 26 Mar 2009 03:14:00 +0000 (-0600) Subject: Simplify forwarding X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=06d51f0a968ad6a0a7e6b72b6b911bd01e560e4c;p=horde.git Simplify forwarding Simply too much confusion with 3 different forwarding options. Other MUA's don't have the same choice. Always forwarding the entire message is both consistent with the concept of forwarding and with the way other MUA's do things. --- diff --git a/imp/ajax.php b/imp/ajax.php index 05e601b90..877be79cb 100644 --- a/imp/ajax.php +++ b/imp/ajax.php @@ -511,7 +511,7 @@ case 'GetForwardData': $imp_compose = IMP_Compose::singleton(Util::getPost('imp_compose')); $imp_contents = IMP_Contents::singleton($idx_string); $imp_ui = new IMP_UI_Compose(); - $fwd_msg = $imp_ui->getForwardData($imp_compose, $imp_contents, Util::getPost('type'), $idx_string); + $fwd_msg = $imp_ui->getForwardData($imp_compose, $imp_contents, $idx_string); $header = $fwd_msg['headers']; $header['replytype'] = 'forward'; diff --git a/imp/compose-dimp.php b/imp/compose-dimp.php index 80e971ac3..bc0ce3638 100644 --- a/imp/compose-dimp.php +++ b/imp/compose-dimp.php @@ -191,7 +191,7 @@ $folder = Util::getFormData('folder'); $show_editor = false; $title = _("New Message"); -if (in_array($type, array('reply', 'reply_all', 'reply_list', 'forward_all', 'forward_body', 'forward_attachments', 'resume'))) { +if (in_array($type, array('reply', 'reply_all', 'reply_list', 'forward', 'resume'))) { if (!$index || !$folder) { $type = 'new'; } @@ -232,15 +232,9 @@ case 'reply_list': } break; -case 'forward_all': -case 'forward_body': -case 'forward_attachments': - $fwd_msg = $imp_ui->getForwardData($imp_compose, $imp_contents, $type, $index . IMP::IDX_SEP . $folder); - if ($type == 'forward_all') { - $msg = ''; - } else { - $msg = $fwd_msg['body']; - } +case 'forward': + $fwd_msg = $imp_ui->getForwardData($imp_compose, $imp_contents, $index . IMP::IDX_SEP . $folder); + $msg = $fwd_msg['body']; $header = $fwd_msg['headers']; $header['replytype'] = 'forward'; $title = $header['title']; @@ -249,7 +243,8 @@ case 'forward_attachments': } $type = 'forward'; - if (!$prefs->isLocked('default_identity') && !is_null($fwd_msg['identity'])) { + if (!$prefs->isLocked('default_identity') && + !is_null($fwd_msg['identity'])) { $identity->setDefault($fwd_msg['identity']); } break; diff --git a/imp/compose.php b/imp/compose.php index babca4b53..59a7837ed 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -104,9 +104,7 @@ if ($actionID) { case 'reply': case 'reply_all': case 'reply_list': - case 'forward_all': - case 'forward_body': - case 'forward_attachments': + case 'forward': case 'redirect_compose': case 'fwd_digest': // These are all safe actions that might be invoked without a token. @@ -346,19 +344,13 @@ case 'reply_list': $reply_index = $index; break; -case 'forward_all': -case 'forward_body': -case 'forward_attachments': +case 'forward': if (!($imp_contents = &_getIMPContents($index, $thismailbox))) { break; } - $fwd_msg = $imp_ui->getForwardData($imp_compose, $imp_contents, $actionID, $index . IMP::IDX_SEP . $thismailbox); - if ($actionID == 'forward_all') { - $msg = ''; - } else { - $msg = $fwd_msg['body']; - } + $fwd_msg = $imp_ui->getForwardData($imp_compose, $imp_contents, $index . IMP::IDX_SEP . $thismailbox); + $msg = $fwd_msg['body']; $header = $fwd_msg['headers']; $format = $fwd_msg['format']; $rtemode = ($rtemode || (!is_null($rtemode) && ($format == 'html'))); @@ -894,9 +886,6 @@ if ($redirect) { break; case 'forward': - case 'forward_all': - case 'forward_body': - case 'forward_attachments': $reply_type = 'forward'; break; } diff --git a/imp/config/prefs.php.dist b/imp/config/prefs.php.dist index 3a3929a5e..3b6a7ba7a 100644 --- a/imp/config/prefs.php.dist +++ b/imp/config/prefs.php.dist @@ -77,8 +77,8 @@ $prefGroups['reply_forward'] = array( 'column' => _("Message Options"), 'label' => _("Message Replies/Forwards"), 'desc' => _("Customize how you reply to or forward mail."), - 'members' => array('reply_quote', 'reply_format', 'forward_default', - 'forward_bodytext', 'reply_headers', 'attrib_text') + 'members' => array('reply_quote', 'reply_format', 'forward_bodytext', + 'reply_headers', 'attrib_text') ); $prefGroups['drafts'] = array( @@ -701,21 +701,9 @@ $_prefs['reply_format'] = array( 'type' => 'checkbox', 'desc' => _("When replying/forwarding to a message, should we use the same format as the original message?")); -// What should the default forward method be? -$_prefs['forward_default'] = array( - 'value' => 'forward_all', - 'locked' => false, - 'shared' => false, - 'type' => 'enum', - 'enum' => array('forward_all' => _("Entire Message"), - 'forward_body' => _("Body Text Only"), - 'forward_attachments' => _("Body Text with Attachments")), - 'desc' => _("Default forwarding method:"), - 'help' => 'message-forward'); - // Should the original message be included? $_prefs['forward_bodytext'] = array( - 'value' => 1, + 'value' => 0, 'locked' => false, 'shared' => false, 'type' => 'checkbox', diff --git a/imp/docs/CHANGES b/imp/docs/CHANGES index b8c2e4157..867f7ba0b 100644 --- a/imp/docs/CHANGES +++ b/imp/docs/CHANGES @@ -2,6 +2,7 @@ v5.0-git -------- +[mms] Simplify forwarding - always attach entire message. [mms] Remember splitbar position on login/refresh (DIMP). [mms] Disable some advanced functions if using POP3 driver (caching, searching, sorting) because it is too resource intensive. diff --git a/imp/docs/UPGRADING b/imp/docs/UPGRADING index 916e53838..4a12ef1fb 100644 --- a/imp/docs/UPGRADING +++ b/imp/docs/UPGRADING @@ -23,7 +23,7 @@ supported. * servers.php has changed * imp_hook_vinfo has changed -* alternative_display, attachment_display pref is gone. +* alternative_display, attachment_display, forward_default pref is gone. * imp_hook_spam_bounce -> imp_hook_spam_email * imp_hook_msglist_format input has changed. diff --git a/imp/js/src/DimpBase.js b/imp/js/src/DimpBase.js index 10ea99f71..35e6fec27 100644 --- a/imp/js/src/DimpBase.js +++ b/imp/js/src/DimpBase.js @@ -653,6 +653,10 @@ var DimpBase = { this.flag(id.substring(12)); break; + case 'ctx_message_forward': + this.composeMailbox('forward'); + break; + case 'ctx_draft_resume': this.composeMailbox('resume'); break; @@ -670,12 +674,6 @@ var DimpBase = { this.composeMailbox(id.substring(10)); break; - case 'ctx_forward_forward_all': - case 'ctx_forward_forward_body': - case 'ctx_forward_forward_attachments': - this.composeMailbox(id.substring(12)); - break; - case 'previewtoggle': this.togglePreviewPane(); break; @@ -1559,7 +1557,7 @@ var DimpBase = { case 'button_forward': case 'button_reply': - this.composeMailbox(id == 'button_reply' ? 'reply' : DIMP.conf.forward_default); + this.composeMailbox(id == 'button_reply' ? 'reply' : 'forward'); break; case 'button_deleted': @@ -2330,11 +2328,8 @@ var DimpBase = { /* Add popdown menus. */ this._addMouseEvents({ id: 'button_reply', type: 'reply' }, true); DM.disable('button_reply_img', true, true); - this._addMouseEvents({ id: 'button_forward', type: 'forward' }, true); - DM.disable('button_forward_img', true, true); this._addMouseEvents({ id: 'button_other', type: 'otheractions' }, true); DM.addSubMenu('ctx_message_reply', 'ctx_reply'); - DM.addSubMenu('ctx_message_forward', 'ctx_forward'); DM.addSubMenu('ctx_message_setflag', 'ctx_flag'); DM.addSubMenu('oa_setflag', 'ctx_flag'); DM.addSubMenu('ctx_draft_setflag', 'ctx_flag'); diff --git a/imp/js/src/fullmessage-dimp.js b/imp/js/src/fullmessage-dimp.js index d85e7cd54..2c91d107a 100644 --- a/imp/js/src/fullmessage-dimp.js +++ b/imp/js/src/fullmessage-dimp.js @@ -22,9 +22,7 @@ var DimpFullmessage = { func = 'GetReplyData'; break; - case 'forward_all': - case 'forward_body': - case 'forward_attachments': + case 'forward': func = 'GetForwardData'; break; } @@ -86,7 +84,7 @@ var DimpFullmessage = { case 'forward_link': case 'reply_link': - this.quickreply(id == 'reply_link' ? 'reply' : DIMP.conf.forward_default); + this.quickreply(id == 'reply_link' ? 'reply' : 'forward'); e.stop(); return; @@ -120,12 +118,6 @@ var DimpFullmessage = { this.quickreply(id.substring(10)); break; - case 'ctx_forward_forward_all': - case 'ctx_forward_forward_body': - case 'ctx_forward_forward_attachments': - this.quickreply(id.substring(12)); - break; - default: parentfunc(id, elt); break; @@ -145,7 +137,6 @@ var DimpFullmessage = { DimpCore.init(); this.addPopdown('reply_link', 'replypopdown'); - this.addPopdown('forward_link', 'fwdpopdown'); /* Set up address linking. */ [ 'from', 'to', 'cc', 'bcc', 'replyTo' ].each(function(a) { diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index d84442f7d..d557e11ca 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -1323,8 +1323,6 @@ class IMP_Compose * Determine the text and headers for a forwarded message. * * @param IMP_Contents $contents An IMP_Contents object. - * @param string $forcebodytxt Force addition of body text, even if - * prefs would not allow it. * * @return array An array with the following keys: *
@@ -1336,7 +1334,7 @@ class IMP_Compose
      *              message's addresses.
      * 
*/ - public function forwardMessage($contents, $forcebodytxt = false) + public function forwardMessage($contents) { /* The headers of the message. */ $header = array( @@ -1365,7 +1363,7 @@ class IMP_Compose $header['subject'] = 'Fwd:'; } - if ($forcebodytxt || $GLOBALS['prefs']->getValue('forward_bodytext')) { + if ($GLOBALS['prefs']->getValue('forward_bodytext')) { $from = Horde_Mime_Address::addrArray2String($h->getOb('from')); $msg_pre = "\n----- " . diff --git a/imp/lib/DIMP.php b/imp/lib/DIMP.php index 1836bcb2d..4ef360aed 100644 --- a/imp/lib/DIMP.php +++ b/imp/lib/DIMP.php @@ -159,7 +159,6 @@ class DIMP 'popup_width' => 820, 'popup_height' => 610, - 'forward_default' => $prefs->getValue('forward_default'), 'spam_folder' => IMP::folderPref($prefs->getValue('spam_folder'), true), 'spam_reporting' => (int) !empty($conf['spam']['reporting']), 'spam_spamfolder' => (int) !empty($conf['spam']['spamfolder']), diff --git a/imp/lib/UI/Compose.php b/imp/lib/UI/Compose.php index b1f83fe6e..9112cc20f 100644 --- a/imp/lib/UI/Compose.php +++ b/imp/lib/UI/Compose.php @@ -81,18 +81,14 @@ class IMP_UI_Compose /** */ - function getForwardData(&$imp_compose, &$imp_contents, $type, $index) + function getForwardData(&$imp_compose, &$imp_contents, $index) { - $fwd_msg = $imp_compose->forwardMessage($imp_contents, ($type == 'forward_body')); - if ($type == 'forward_all') { - $subject_header = $imp_compose->attachIMAPMessage(array($index), $fwd_msg['headers']); - if ($subject_header === false) { - // TODO: notification - } else { - $fwd_msg['headers']['subject'] = $subject_header; - } - } elseif ($type == 'forward_attachments') { - $imp_compose->attachFilesFromMessage($imp_contents, array('notify' => true)); + $fwd_msg = $imp_compose->forwardMessage($imp_contents); + $subject_header = $imp_compose->attachIMAPMessage(array($index), $fwd_msg['headers']); + if ($subject_header === false) { + // TODO: notification + } else { + $fwd_msg['headers']['subject'] = $subject_header; } return $fwd_msg; diff --git a/imp/locale/en_US/help.xml b/imp/locale/en_US/help.xml index 8a5222ef4..9dd1af190 100644 --- a/imp/locale/en_US/help.xml +++ b/imp/locale/en_US/help.xml @@ -21,21 +21,6 @@ --> - - Forwarding Email - When forwarding an email, you have several choices. - - Forwarding from the Mailbox View - In the mailbox view, you can forward multiple messages at the same time. Each message that you select will be sent, in its entirety, to your recipients. You will see each message as an attachment in your compose window. On the receiving end, the recipient(s) will see each email as an embedded email. - - Forwarding from the Message View - When forwarding individual messages in the message view, you can choose three different options: - 1. Entire Message: This option will attach the entire message to your email. The compose area will not contain any text from the forwarded message. This is the same as forwading a single email from the mailbox view, except that the Subject: line will be set for you. - 2. Body Text Only: If you only want to forward the body of the email, choose this option. Any attachments to the original email will not be included in your forward. The text will appear in the compose area, and you can edit it if you wish or add your own comments. - 3. Body Text with Attachments: To forward the attachments of an email along, along with the body as described in #2 Body Text Only, use this option. The body text will be placed in the compose area for you to edit, and all attachments to the original message will be copied to your forward. - - - Message Composition: Actions Actions diff --git a/imp/message.php b/imp/message.php index 156bdcd09..e0ed06fbb 100644 --- a/imp/message.php +++ b/imp/message.php @@ -507,10 +507,7 @@ if (!IMP::$printMode) { $a_template->set('show_reply_all', Horde::widget(IMP::composeLink(array(), array('actionID' => 'reply_all') + $compose_params), _("To All"), 'widget', '', '', _("To _All"), true)); } - $a_template->set('forward', Horde::widget(IMP::composeLink(array(), array('actionID' => $prefs->getValue('forward_default')) + $compose_params), _("Forward"), 'widget hasmenu', '', '', _("Fo_rward"), true)); - $a_template->set('forwardall', Horde::widget(IMP::composeLink(array(), array('actionID' => 'forward_all') + $compose_params), _("Entire Message"), 'widget', '', '', _("Entire Message"), true)); - $a_template->set('forwardbody', Horde::widget(IMP::composeLink(array(), array('actionID' => 'forward_body') + $compose_params), _("Body Text Only"), 'widget', '', '', _("Body Text Only"), true)); - $a_template->set('forwardattachments', Horde::widget(IMP::composeLink(array(), array('actionID' => 'forward_attachments') + $compose_params), _("Body Text with Attachments"), 'widget', '', '', _("Body Text with Attachments"), true)); + $a_template->set('forward', Horde::widget(IMP::composeLink(array(), array('actionID' => 'forward') + $compose_params), _("Forward"), 'widget', '', '', _("Fo_rward"), true)); $a_template->set('redirect', Horde::widget(IMP::composeLink(array(), array('actionID' => 'redirect_compose') + $compose_params), _("Redirect"), 'widget', '', '', _("Redirec_t"), true)); } diff --git a/imp/templates/chunks/message.php b/imp/templates/chunks/message.php index 2ab2e3c76..3c0befdde 100644 --- a/imp/templates/chunks/message.php +++ b/imp/templates/chunks/message.php @@ -37,7 +37,7 @@ function _createDAfmsg($text, $image, $id, $class = '', $show_text = true) - + getValue('spam_folder'), true)))): ?> @@ -122,12 +122,6 @@ function _createDAfmsg($text, $image, $id, $class = '', $show_text = true) - - - -