patch #539958 Remember selection of target mailbox in move message option.
authorjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 9 May 2002 04:23:18 +0000 (04:23 +0000)
committerjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 9 May 2002 04:23:18 +0000 (04:23 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2808 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php
src/move_messages.php

index 5a0929857d2334c8c6d9272ee33507e0d075f73c..065479971fdf555c4b9756892bfdd03e1911badf 100644 (file)
@@ -626,6 +626,7 @@ function displayMessageArray($imapConnection, $num_msgs, $start_msg,
  * $Message is a message that is centered on top of the list
  * $More is a second line that is left aligned
  */
 function mail_message_listing_beginning ($imapConnection, $moveURL, 
                                         $mailbox = '', $sort = -1,
                                         $msg_cnt_str = '', 
@@ -633,7 +634,9 @@ function mail_message_listing_beginning ($imapConnection, $moveURL,
                                         $start_msg = 1) {
   global $color, $index_order, $auto_expunge, $move_to_trash, $base_uri,
     $checkall, $sent_folder, $draft_folder, $thread_sort_messages, 
-    $allow_thread_sort, $allow_server_sort, $server_sort_order;
+    $allow_thread_sort, $allow_server_sort, $server_sort_order,
+    $lastTargetMailbox;
+
   $urlMailbox = urlencode($mailbox);
 
   /*
@@ -674,7 +677,12 @@ function mail_message_listing_beginning ($imapConnection, $moveURL,
       if( $box2 == 'INBOX' ) {
        $box2 = _("INBOX");
       }
-      echo "         <OPTION VALUE=\"$box\">$box2</option>\n";
+      if ($lastTargetMailbox == $box) {
+        echo "       <OPTION VALUE=\"$box\" SELECTED>$box2</OPTION>\n";
+      }
+      else {
+        echo "         <OPTION VALUE=\"$box\">$box2</OPTION>\n";
+      }
     }
   }
   echo '         </SELECT></TT>&nbsp;'
index 782b5c59ad296eefde14e00659eefb122fde6bf9..21c87a76726eb38781baf250fc1df21e46b14def 100644 (file)
@@ -43,7 +43,7 @@ function putSelectedMessagesIntoString($msg) {
 
 function attachSelectedMessages($msg, $imapConnection) {
 
-    global $mailbox, $username, $attachment_dir, $attachments, $identity, $data_dir, $composesession;
+    global $mailbox, $username, $attachment_dir, $attachments, $identity, $data_dir, $composesession, $lastTargetMailbox;
 
 
     if (!isset($attachments)) {
@@ -125,6 +125,15 @@ function attachSelectedMessages($msg, $imapConnection) {
 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 sqimap_mailbox_select($imapConnection, $mailbox);
 
+/* remember changes to mailbox setting */
+if (!isset($lastTargetMailbox)) {
+    $lastTargetMailbox = 'INBOX';
+}
+if ($targetMailbox != $lastTargetMailbox) {
+    $lastTargetMailbox = $targetMailbox;
+    session_register('lastTargetMailbox');
+}
+
 // expunge-on-demand if user isn't using move_to_trash or auto_expunge
 if(isset($expungeButton)) {
     sqimap_mailbox_expunge($imapConnection, $mailbox, true);