[Svn] r4169 - in trunk/roundcubemail: . config program/localization/en_US program/localization/pl_PL program/steps/mail program/steps/settings

trac at roundcube.net trac at roundcube.net
Tue Nov 2 15:53:54 CET 2010


Author: alec
Date: 2010-11-02 09:53:54 -0500 (Tue, 02 Nov 2010)
New Revision: 4169

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/config/main.inc.php.dist
   trunk/roundcubemail/program/localization/en_US/labels.inc
   trunk/roundcubemail/program/localization/pl_PL/labels.inc
   trunk/roundcubemail/program/steps/mail/compose.inc
   trunk/roundcubemail/program/steps/settings/func.inc
   trunk/roundcubemail/program/steps/settings/save_prefs.inc
Log:
- Add option to place replies in the folder of the message being replied to (#1485945) 


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2010-11-02 14:31:27 UTC (rev 4168)
+++ trunk/roundcubemail/CHANGELOG	2010-11-02 14:53:54 UTC (rev 4169)
@@ -59,6 +59,7 @@
 - Improve performance of setting IMAP flags using .SILENT suffix
 - Improve performance of message cache status checking with skip_disabled=true
 - Support contact's email addresses up to 255 characters long (#1487095)
+- Add option to place replies in the folder of the message being replied to (#1485945)
 
 RELEASE 0.4.2
 -------------

Modified: trunk/roundcubemail/config/main.inc.php.dist
===================================================================
--- trunk/roundcubemail/config/main.inc.php.dist	2010-11-02 14:31:27 UTC (rev 4168)
+++ trunk/roundcubemail/config/main.inc.php.dist	2010-11-02 14:53:54 UTC (rev 4169)
@@ -589,4 +589,7 @@
 // Delivery Status Notification checkbox default state
 $rcmail_config['dsn_default'] = 0;
 
+// Place replies in the folder of the message being replied to
+$rcmail_config['reply_same_folder'] = false;
+
 // end of config file

Modified: trunk/roundcubemail/program/localization/en_US/labels.inc
===================================================================
--- trunk/roundcubemail/program/localization/en_US/labels.inc	2010-11-02 14:31:27 UTC (rev 4168)
+++ trunk/roundcubemail/program/localization/en_US/labels.inc	2010-11-02 14:53:54 UTC (rev 4169)
@@ -378,6 +378,7 @@
 $labels['afternseconds']  = 'after $n seconds';
 $labels['reqmdn'] = 'Always request a return receipt';
 $labels['reqdsn'] = 'Always request a delivery status notification';
+$labels['replysamefolder'] = 'Place replies in the folder of the message being replied to';
 
 $labels['folder']  = 'Folder';
 $labels['folders']  = 'Folders';

Modified: trunk/roundcubemail/program/localization/pl_PL/labels.inc
===================================================================
--- trunk/roundcubemail/program/localization/pl_PL/labels.inc	2010-11-02 14:31:27 UTC (rev 4168)
+++ trunk/roundcubemail/program/localization/pl_PL/labels.inc	2010-11-02 14:53:54 UTC (rev 4169)
@@ -363,5 +363,7 @@
 $labels['addmailfollowupto'] = 'Dodaj Mail-Followup-To';
 $labels['dsn'] = 'Status dostarczenia (DSN)';
 $labels['reqdsn'] = 'Zawsze żądaj statusu dostarczenia (DSN)';
+$labels['replysamefolder'] = 'Umieszczaj odpowiedzi w folderze wiadomości, na którą odpowiadam';
+$labels['contactproperties'] = 'Właściwości';
 
 ?>

Modified: trunk/roundcubemail/program/steps/mail/compose.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/compose.inc	2010-11-02 14:31:27 UTC (rev 4168)
+++ trunk/roundcubemail/program/steps/mail/compose.inc	2010-11-02 14:53:54 UTC (rev 4169)
@@ -100,12 +100,8 @@
   }
 
   // check if folder for saving sent messages exists and is subscribed (#1486802)
-  if (($sent_folder = $_SESSION['compose']['param']['sent_mbox']) && !$IMAP->mailbox_exists($sent_folder, true)) {
-    // folder may exist but isn't subscribed (#1485241)
-    if (!$IMAP->mailbox_exists($sent_folder))
-      $IMAP->create_mailbox($sent_folder, true);
-    else
-      $IMAP->subscribe($sent_folder);
+  if ($sent_folder = $_SESSION['compose']['param']['sent_mbox']) {
+    rcmail_check_sent_folder($sent_folder, true);
   }
 
   // redirect to a unique URL with all parameters stored in session
@@ -177,6 +173,13 @@
       $MESSAGE->reply_all = $_SESSION['compose']['param']['all'];
 
     $OUTPUT->set_env('compose_mode', 'reply');
+
+    // Save the sent message in the same folder of the message being replied to
+    if ($RCMAIL->config->get('reply_same_folder') && ($sent_folder = $_SESSION['compose']['mailbox'])
+      && rcmail_check_sent_folder($sent_folder, false)
+    ) {
+      $_SESSION['compose']['param']['sent_mbox'] = $sent_folder;
+    }
   }
   else if ($compose_mode == RCUBE_COMPOSE_DRAFT)
   {
@@ -191,8 +194,15 @@
         $_SESSION['compose']['forward_uid'] = $info['uid'];
 
       $_SESSION['compose']['mailbox'] = $info['folder'];
+
+      // Save the sent message in the same folder of the message being replied to
+      if ($RCMAIL->config->get('reply_same_folder') && ($sent_folder = $info['folder'])
+        && rcmail_check_sent_folder($sent_folder, false)
+      ) {
+        $_SESSION['compose']['param']['sent_mbox'] = $sent_folder;
+      }
     }
-    
+
     if ($MESSAGE->headers->in_reply_to)
       $_SESSION['compose']['reply_msgid'] = '<'.$MESSAGE->headers->in_reply_to.'>';
 
@@ -1261,6 +1271,26 @@
 }
 
 
+function rcmail_check_sent_folder($folder, $create=false)
+{
+  global $IMAP;
+
+  if ($IMAP->mailbox_exists($folder, true)) {
+    return true;
+  }
+
+  // folder may exist but isn't subscribed (#1485241)
+  if ($create) {
+    if (!$IMAP->mailbox_exists($folder))
+      return $IMAP->create_mailbox($folder, true);
+    else
+      return $IMAP->subscribe($folder);
+  }
+
+  return false;
+}
+
+
 function get_form_tags($attrib)
 {
   global $RCMAIL, $MESSAGE_FORM;
@@ -1274,13 +1304,13 @@
     $form_start = empty($attrib['form']) ? $RCMAIL->output->form_tag(array('name' => "form", 'method' => "post")) : '';
     $form_start .= $hiddenfields->show();
   }
-    
+
   $form_end = ($MESSAGE_FORM && !strlen($attrib['form'])) ? '</form>' : '';
   $form_name = !empty($attrib['form']) ? $attrib['form'] : 'form';
-  
+
   if (!$MESSAGE_FORM)
     $RCMAIL->output->add_gui_object('messageform', $form_name);
-  
+
   $MESSAGE_FORM = $form_name;
 
   return array($form_start, $form_end);

Modified: trunk/roundcubemail/program/steps/settings/func.inc
===================================================================
--- trunk/roundcubemail/program/steps/settings/func.inc	2010-11-02 14:31:27 UTC (rev 4168)
+++ trunk/roundcubemail/program/steps/settings/func.inc	2010-11-02 14:53:54 UTC (rev 4169)
@@ -534,6 +534,16 @@
       );
     }
 
+    if (!isset($no_override['reply_same_folder'])) {
+      $field_id = 'rcmfd_reply_same_folder';
+      $input_reply_same_folder = new html_checkbox(array('name' => '_reply_same_folder', 'id' => $field_id, 'value' => 1));
+
+      $blocks['main']['options']['reply_same_folder'] = array(
+        'title' => html::label($field_id, Q(rcube_label('replysamefolder'))),
+        'content' => $input_reply_same_folder->show($config['reply_same_folder']?1:0),
+      );
+    }
+
     if (!isset($no_override['top_posting'])) {
       $field_id = 'rcmfd_top_posting';
       $select_replymode = new html_select(array('name' => '_top_posting', 'id' => $field_id, 'onchange' => "\$('#rcmfd_sig_above').attr('disabled',this.selectedIndex==0)"));

Modified: trunk/roundcubemail/program/steps/settings/save_prefs.inc
===================================================================
--- trunk/roundcubemail/program/steps/settings/save_prefs.inc	2010-11-02 14:31:27 UTC (rev 4168)
+++ trunk/roundcubemail/program/steps/settings/save_prefs.inc	2010-11-02 14:53:54 UTC (rev 4169)
@@ -67,6 +67,7 @@
       'force_7bit'         => isset($_POST['_force_7bit']) ? TRUE : FALSE,
       'mdn_default'        => isset($_POST['_mdn_default']) ? TRUE : FALSE,
       'dsn_default'        => isset($_POST['_dsn_default']) ? TRUE : FALSE,
+      'reply_same_folder'  => isset($_POST['_reply_same_folder']) ? TRUE : FALSE,
       'show_sig'           => isset($_POST['_show_sig']) ? intval($_POST['_show_sig']) : 1,
       'top_posting'        => !empty($_POST['_top_posting']),
       'strip_existing_sig' => isset($_POST['_strip_existing_sig']),

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn


More information about the Svn mailing list