Simplify forwarding
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 26 Mar 2009 03:14:00 +0000 (21:14 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 26 Mar 2009 03:16:41 +0000 (21:16 -0600)
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.

18 files changed:
imp/ajax.php
imp/compose-dimp.php
imp/compose.php
imp/config/prefs.php.dist
imp/docs/CHANGES
imp/docs/UPGRADING
imp/js/src/DimpBase.js
imp/js/src/fullmessage-dimp.js
imp/lib/Compose.php
imp/lib/DIMP.php
imp/lib/UI/Compose.php
imp/locale/en_US/help.xml
imp/message.php
imp/templates/chunks/message.php
imp/templates/index/index-dimp.inc
imp/templates/message/navbar_actions.html
imp/themes/screen-dimp.css
imp/themes/silver/screen-dimp.css

index 05e601b..877be79 100644 (file)
@@ -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';
 
index 80e971a..bc0ce36 100644 (file)
@@ -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;
index babca4b..59a7837 100644 (file)
@@ -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;
         }
index 3a3929a..3b6a7ba 100644 (file)
@@ -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',
index b8c2e41..867f7ba 100644 (file)
@@ -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.
index 916e538..4a12ef1 100644 (file)
@@ -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.
 
index 10ea99f..35e6fec 100644 (file)
@@ -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');
index d85e7cd..2c91d10 100644 (file)
@@ -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) {
index d84442f..d557e11 100644 (file)
@@ -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:
      * <pre>
@@ -1336,7 +1334,7 @@ class IMP_Compose
      *              message's addresses.
      * </pre>
      */
-    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----- " .
index 1836bcb..4ef360a 100644 (file)
@@ -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']),
index b1f83fe..9112cc2 100644 (file)
@@ -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;
index 8a5222e..9dd1af1 100644 (file)
 </entry>
 -->
 
-<entry id="message-forward">
-  <title>Forwarding Email</title>
-  <para>When forwarding an email, you have several choices.</para>
-
-  <heading>Forwarding from the Mailbox View</heading>
-  <para>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.</para>
-
-  <heading>Forwarding from the Message View</heading>
-  <para>When forwarding individual messages in the message view, you can choose three different options:</para>
-  <para><b>1. Entire Message</b>: 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.</para>
-  <para><b>2. Body Text Only</b>: 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.</para>
-  <para><b>3. Body Text with Attachments</b>: 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.</para>
-
-</entry>
-
 <entry id="compose-buttons">
     <title>Message Composition: Actions</title>
     <heading>Actions</heading>
index 156bdcd..e0ed06f 100644 (file)
@@ -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));
     }
index 2ab2e3c..3c0befd 100644 (file)
@@ -37,7 +37,7 @@ function _createDAfmsg($text, $image, $id, $class = '', $show_text = true)
      <?php _createDAfmsg(_("Reply"), 'Reply', 'reply_link', 'hasmenu', $show_text) ?>
     </span>
     <span>
-     <?php _createDAfmsg(_("Forward"), 'Forward', 'forward_link', 'hasmenu', $show_text) ?>
+     <?php _createDAfmsg(_("Forward"), 'Forward', 'forward_link', '', $show_text) ?>
     </span>
 <?php if (!empty($conf['spam']['reporting']) && (!$conf['spam']['spamfolder'] || ($folder != IMP::folderPref($prefs->getValue('spam_folder'), true)))): ?>
     <span>
@@ -122,12 +122,6 @@ function _createDAfmsg($text, $image, $id, $class = '', $show_text = true)
 <?php endif; ?>
 </div>
 
-<div class="context" id="ctx_fwdpopdown" style="display:none">
- <a id="ctx_forward_forward_all"><span class="contextImg"></span><?php echo _("Entire Message") ?></a>
- <a id="ctx_forward_forward_body"><span class="contextImg"></span><?php echo _("Body Text Only") ?></a>
- <a id="ctx_forward_forward_attachments"><span class="contextImg"></span><?php echo _("Attachments Only") ?></a>
-</div>
-
 <div class="context" id="ctx_contacts" style="display:none">
  <a id="ctx_contacts_new"><span class="contextImg"></span><?php echo _("New Message") ?></a>
  <a id="ctx_contacts_add"><span class="contextImg"></span><?php echo _("Add to Address Book") ?></a>
index f4e432f..24cc363 100644 (file)
@@ -393,12 +393,6 @@ function _simpleButton($id, $text, $image, $imagedir = null)
  <a id="ctx_reply_reply_list"><span class="contextImg"></span><?php echo _("To List") ?></a>
 </div>
 
-<div class="context" id="ctx_forward" style="display:none">
- <a id="ctx_forward_forward_all"><span class="contextImg"></span><?php echo _("Entire Message") ?></a>
- <a id="ctx_forward_forward_body"><span class="contextImg"></span><?php echo _("Body Text Only") ?></a>
- <a id="ctx_forward_forward_attachments"><span class="contextImg"></span><?php echo _("Attachments Only") ?></a>
-</div>
-
 <div class="context" id="ctx_otheractions" style="display:none">
  <a id="previewtoggle"><span class="contextImg"></span><?php echo ($prefs->getValue('dimp_show_preview') ? _("Hide Preview") : _("Show Preview")); ?></a>
  <div class="sep"></div>
index cd64353..908cc36 100644 (file)
       <if:show_reply_all><li><tag:show_reply_all /></li></if:show_reply_all>
      </ul>
     </li>
-    <li><tag:forward />
-     <ul>
-      <li><tag:forwardall /></li>
-      <li><tag:forwardbody /></li>
-      <li><tag:forwardattachments /></li>
-     </ul>
-    </li>
+    <li><tag:forward /></li>
     <li><tag:redirect /></li>
 </if:reply>
     <if:show_thread><li><tag:show_thread /></li></if:show_thread>
index 26db4d5..9fd54f7 100644 (file)
@@ -1008,7 +1008,7 @@ span.dimpactionDrafts {
 #ctx_reply_reply span.contextImg, #ctx_reply_reply_all span.contextImg, #ctx_reply_reply_list span.contextImg {
     background-image: url("graphics/replyall.png");
 }
-#ctx_message_forward span.contextImg, #ctx_forward_forward_all span.contextImg, #ctx_forward_forward_body span.contextImg, #ctx_forward_forward_attachments span.contextImg {
+#ctx_message_forward span.contextImg {
     background-image: url("graphics/forward.png");
 }
 #ctx_folder_empty span.contextImg, #ctx_message_deleted span.contextImg, #ctx_draft_deleted span.contextImg, #oa_purge_deleted span.contextImg {
index 6f6f5f3..5ffe2c8 100644 (file)
@@ -110,7 +110,7 @@ span.dimpactionDrafts {
 #ctx_reply_reply span.contextImg, #ctx_reply_reply_all span.contextImg, #ctx_reply_reply_list span.contextImg {
     background-image: url("graphics/replyall.png");
 }
-#ctx_message_forward span.contextImg, #ctx_forward_forward_all span.contextImg, #ctx_forward_forward_body span.contextImg, #ctx_forward_forward_attachments span.contextImg {
+#ctx_message_forward span.contextImg {
     background-image: url("graphics/forward.png");
 }
 #ctx_folder_empty span.contextImg, #ctx_message_deleted span.contextImg, #ctx_draft_deleted span.contextImg, #oa_purge_deleted span.contextImg {