- After move/delete from 'show' action display next message instead of messages list (#1485887)
| | |
| | | CHANGELOG RoundCube Webmail |
| | | =========================== |
| | | |
| | | - After move/delete from 'show' action display next message instead of messages list (#1485887) |
| | | - Fixed problem with double quote at the end of folder name (#1485884) |
| | | - Speedup UI by using CSS sprites and etags/expires/deflate in Apache config (#1484858,#1485800) |
| | | - Support UID EXPUNGE: remove only moved/deleted messages |
| | |
| | | this.show_contentframe(false); |
| | | |
| | | // Hide message command buttons until a message is selected |
| | | this.enable_command('reply', 'reply-all', 'forward', 'delete', 'mark', 'print', false); |
| | | this.enable_command('reply', 'reply-all', 'forward', 'delete', 'mark', 'print', 'open', 'viewsource', 'download', false); |
| | | |
| | | this._with_selected_messages('moveto', lock, add_url, (this.env.flag_for_deletion ? false : true)); |
| | | }; |
| | |
| | | |
| | | // exit if no mailbox specified or if selection is empty |
| | | if (!this.env.uid && !selection.length) |
| | | return; |
| | | return; |
| | | |
| | | // if there is a trash mailbox defined and we're not currently in it: |
| | | if (this.env.trash_mailbox && String(this.env.mailbox).toLowerCase() != String(this.env.trash_mailbox).toLowerCase()) |
| | |
| | | else if (!this.env.trash_mailbox && this.env.flag_for_deletion) |
| | | { |
| | | this.mark_message('delete'); |
| | | if(this.env.action=="show") |
| | | this.command('nextmessage','',this); |
| | | if (this.env.action == 'show') |
| | | this.command('nextmessage', '', this); |
| | | else if (selection.length == 1) |
| | | this.message_list.select_next(); |
| | | } |
| | |
| | | // also send search request to get the right messages |
| | | if (this.env.search_request) |
| | | add_url += '&_search='+this.env.search_request; |
| | | |
| | | if (this.env.next_uid) |
| | | add_url += '&_next_uid='+this.env.next_uid; |
| | | |
| | | // send request to server |
| | | this.http_post(action, '_uid='+a_uids.join(',')+'&_mbox='+urlencode(this.env.mailbox)+add_url, lock); |
| | |
| | | } |
| | | |
| | | case 'moveto': |
| | | if (this.env.action == 'show') |
| | | this.command('list'); |
| | | else if (this.message_list) |
| | | if (this.env.action == 'show') { |
| | | // re-enable commands on move/delete error |
| | | this.enable_command('reply', 'reply-all', 'forward', 'delete', 'mark', 'print', 'open', 'viewsource', 'download', true); |
| | | } else if (this.message_list) |
| | | this.message_list.init(); |
| | | break; |
| | | |
| | |
| | | if (this.env.contentframe) |
| | | this.show_contentframe(false); |
| | | // disable commands useless when mailbox is empty |
| | | this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'mark', 'viewsource', |
| | | 'print', 'load-attachment', 'purge', 'expunge', 'select-all', 'select-none', 'sort', false); |
| | | this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', |
| | | 'mark', 'viewsource', 'open', 'download', 'print', 'load-attachment', |
| | | 'purge', 'expunge', 'select-all', 'select-none', 'sort', false); |
| | | } |
| | | break; |
| | | |
| | |
| | | |
| | | if (!$moved) { |
| | | // send error message |
| | | $OUTPUT->command('list_mailbox'); |
| | | if ($_POST['_from'] != 'show') |
| | | $OUTPUT->command('list_mailbox'); |
| | | $OUTPUT->show_message('errormoving', 'error'); |
| | | $OUTPUT->send(); |
| | | exit; |
| | |
| | | |
| | | if (!$del) { |
| | | // send error message |
| | | $OUTPUT->command('list_mailbox'); |
| | | if ($_POST['_from'] != 'show') |
| | | $OUTPUT->command('list_mailbox'); |
| | | $OUTPUT->show_message('errordeleting', 'error'); |
| | | $OUTPUT->send(); |
| | | exit; |
| | |
| | | else { |
| | | exit; |
| | | } |
| | | |
| | | // refresh saved search set after moving some messages |
| | | if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $IMAP->search_set) { |
| | | $_SESSION['search'][$search_request] = $IMAP->refresh_search(); |
| | | } |
| | | |
| | | $msg_count = $IMAP->messagecount(); |
| | | $pages = ceil($msg_count / $IMAP->page_size); |
| | | $nextpage_count = $old_count - $IMAP->page_size * $IMAP->list_page; |
| | | $remaining = $msg_count - $IMAP->page_size * ($IMAP->list_page - 1); |
| | | if ($_POST['_from'] == 'show') |
| | | { |
| | | if ($next = get_input_value('_next_uid', RCUBE_INPUT_GPC)) |
| | | $OUTPUT->command('show_message', $next); |
| | | else |
| | | $OUTPUT->command('command', 'list'); |
| | | } |
| | | else |
| | | { |
| | | $msg_count = $IMAP->messagecount(); |
| | | $pages = ceil($msg_count / $IMAP->page_size); |
| | | $nextpage_count = $old_count - $IMAP->page_size * $IMAP->list_page; |
| | | $remaining = $msg_count - $IMAP->page_size * ($IMAP->list_page - 1); |
| | | |
| | | // jump back one page (user removed the whole last page) |
| | | if ($IMAP->list_page > 1 && $nextpage_count <= 0 && $remaining == 0) { |
| | | // jump back one page (user removed the whole last page) |
| | | if ($IMAP->list_page > 1 && $nextpage_count <= 0 && $remaining == 0) { |
| | | $IMAP->set_page($IMAP->list_page-1); |
| | | $_SESSION['page'] = $IMAP->list_page; |
| | | $jump_back = true; |
| | | } |
| | | } |
| | | |
| | | // update message count display |
| | | $OUTPUT->set_env('pagecount', $pages); |
| | | $OUTPUT->set_env('messagecount', $msg_count); |
| | | $OUTPUT->set_env('current_page', $IMAP->list_page); |
| | | $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count)); |
| | | // update message count display |
| | | $OUTPUT->set_env('messagecount', $msg_count); |
| | | $OUTPUT->set_env('current_page', $IMAP->list_page); |
| | | $OUTPUT->set_env('pagecount', $pages); |
| | | |
| | | // update mailboxlist |
| | | $mbox = $IMAP->get_mailbox_name(); |
| | | $OUTPUT->command('set_unread_count', $mbox, $IMAP->messagecount($mbox, 'UNSEEN'), ($mbox == 'INBOX')); |
| | | // update mailboxlist |
| | | $mbox = $IMAP->get_mailbox_name(); |
| | | $OUTPUT->command('set_unread_count', $mbox, $IMAP->messagecount($mbox, 'UNSEEN'), ($mbox == 'INBOX')); |
| | | |
| | | if ($RCMAIL->action=='moveto' && $target) { |
| | | if ($RCMAIL->action=='moveto' && $target) { |
| | | $OUTPUT->command('set_unread_count', $target, $IMAP->messagecount($target, 'UNSEEN')); |
| | | } |
| | | } |
| | | |
| | | $OUTPUT->command('set_quota', rcmail_quota_content($IMAP->get_quota())); |
| | | $OUTPUT->command('set_quota', rcmail_quota_content($IMAP->get_quota())); |
| | | $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count)); |
| | | |
| | | // add new rows from next page (if any) |
| | | if ($addrows && $_POST['_from']!='show' && ($jump_back || $nextpage_count > 0)) { |
| | | // add new rows from next page (if any) |
| | | if ($addrows && ($jump_back || $nextpage_count > 0)) { |
| | | $sort_col = isset($_SESSION['sort_col']) ? $_SESSION['sort_col'] : $CONFIG['message_sort_col']; |
| | | $sort_order = isset($_SESSION['sort_order']) ? $_SESSION['sort_order'] : $CONFIG['message_sort_order']; |
| | | |
| | |
| | | $a_headers = array_slice($a_headers, -$count, $count); |
| | | } |
| | | rcmail_js_message_list($a_headers, false, false); |
| | | } |
| | | } |
| | | |
| | | // send response |
| | | $OUTPUT->send(); |
| | | |
| | | ?> |