From cd8850780fb934d74f62f368af42ca8c5b927265 Mon Sep 17 00:00:00 2001 From: jmunro Date: Thu, 9 May 2002 04:23:18 +0000 Subject: [PATCH] patch #539958 Remember selection of target mailbox in move message option. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2808 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mailbox_display.php | 12 ++++++++++-- src/move_messages.php | 11 ++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 5a092985..06547997 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -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 " \n"; + if ($lastTargetMailbox == $box) { + echo " \n"; + } + else { + echo " \n"; + } } } echo '  ' diff --git a/src/move_messages.php b/src/move_messages.php index 782b5c59..21c87a76 100644 --- a/src/move_messages.php +++ b/src/move_messages.php @@ -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); -- 2.25.1