Changeset 2576 in subversion


Ignore:
Timestamp:
May 30, 2009 11:10:35 AM (4 years ago)
Author:
alec
Message:
  • After move/delete from 'show' action display next message instead of messages list (#1485887)
Location:
trunk/roundcubemail
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r2563 r2576  
    22=========================== 
    33 
     4- After move/delete from 'show' action display next message instead of messages list (#1485887) 
    45- Fixed problem with double quote at the end of folder name (#1485884) 
    56- Speedup UI by using CSS sprites and etags/expires/deflate in Apache config (#1484858,#1485800) 
  • trunk/roundcubemail/program/js/app.js

    r2550 r2576  
    17981798 
    17991799    // Hide message command buttons until a message is selected 
    1800     this.enable_command('reply', 'reply-all', 'forward', 'delete', 'mark', 'print', false); 
     1800    this.enable_command('reply', 'reply-all', 'forward', 'delete', 'mark', 'print', 'open', 'viewsource', 'download', false); 
    18011801 
    18021802    this._with_selected_messages('moveto', lock, add_url, (this.env.flag_for_deletion ? false : true)); 
     
    18101810    // exit if no mailbox specified or if selection is empty 
    18111811    if (!this.env.uid && !selection.length) 
    1812         return; 
     1812      return; 
    18131813 
    18141814    // if there is a trash mailbox defined and we're not currently in it: 
     
    18311831      { 
    18321832      this.mark_message('delete'); 
    1833       if(this.env.action=="show") 
    1834         this.command('nextmessage','',this); 
     1833      if (this.env.action == 'show') 
     1834        this.command('nextmessage', '', this); 
    18351835      else if (selection.length == 1) 
    18361836        this.message_list.select_next(); 
     
    18851885    if (this.env.search_request)  
    18861886      add_url += '&_search='+this.env.search_request; 
     1887 
     1888    if (this.env.next_uid) 
     1889      add_url += '&_next_uid='+this.env.next_uid; 
    18871890 
    18881891    // send request to server 
     
    39303933       
    39313934      case 'moveto': 
    3932         if (this.env.action == 'show') 
    3933           this.command('list'); 
    3934         else if (this.message_list) 
     3935        if (this.env.action == 'show') { 
     3936          // re-enable commands on move/delete error 
     3937          this.enable_command('reply', 'reply-all', 'forward', 'delete', 'mark', 'print', 'open', 'viewsource', 'download', true); 
     3938        } else if (this.message_list) 
    39353939          this.message_list.init(); 
    39363940        break; 
     
    39433947            this.show_contentframe(false); 
    39443948          // disable commands useless when mailbox is empty 
    3945           this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'mark', 'viewsource', 
    3946             'print', 'load-attachment', 'purge', 'expunge', 'select-all', 'select-none', 'sort', false); 
     3949          this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete',  
     3950            'mark', 'viewsource', 'open', 'download', 'print', 'load-attachment',  
     3951            'purge', 'expunge', 'select-all', 'select-none', 'sort', false); 
    39473952        } 
    39483953        break; 
  • trunk/roundcubemail/program/steps/mail/move_del.inc

    r2414 r2576  
    3838    if (!$moved) { 
    3939        // send error message 
    40         $OUTPUT->command('list_mailbox'); 
     40        if ($_POST['_from'] != 'show') 
     41          $OUTPUT->command('list_mailbox'); 
    4142        $OUTPUT->show_message('errormoving', 'error'); 
    4243        $OUTPUT->send(); 
     
    5556    if (!$del) { 
    5657        // send error message 
    57         $OUTPUT->command('list_mailbox'); 
     58        if ($_POST['_from'] != 'show') 
     59          $OUTPUT->command('list_mailbox'); 
    5860        $OUTPUT->show_message('errordeleting', 'error'); 
    5961        $OUTPUT->send(); 
     
    6769    exit; 
    6870} 
     71 
    6972// refresh saved search set after moving some messages 
    7073if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $IMAP->search_set) { 
     
    7275} 
    7376 
    74 $msg_count      = $IMAP->messagecount(); 
    75 $pages          = ceil($msg_count / $IMAP->page_size); 
    76 $nextpage_count = $old_count - $IMAP->page_size * $IMAP->list_page; 
    77 $remaining      = $msg_count - $IMAP->page_size * ($IMAP->list_page - 1); 
     77if ($_POST['_from'] == 'show') 
     78{ 
     79  if ($next = get_input_value('_next_uid', RCUBE_INPUT_GPC)) 
     80    $OUTPUT->command('show_message', $next); 
     81  else 
     82    $OUTPUT->command('command', 'list'); 
     83} 
     84else 
     85{ 
     86  $msg_count      = $IMAP->messagecount(); 
     87  $pages          = ceil($msg_count / $IMAP->page_size); 
     88  $nextpage_count = $old_count - $IMAP->page_size * $IMAP->list_page; 
     89  $remaining      = $msg_count - $IMAP->page_size * ($IMAP->list_page - 1); 
    7890 
    79 // jump back one page (user removed the whole last page) 
    80 if ($IMAP->list_page > 1 && $nextpage_count <= 0 && $remaining == 0) { 
     91  // jump back one page (user removed the whole last page) 
     92  if ($IMAP->list_page > 1 && $nextpage_count <= 0 && $remaining == 0) { 
    8193    $IMAP->set_page($IMAP->list_page-1); 
    8294    $_SESSION['page'] = $IMAP->list_page; 
    8395    $jump_back = true; 
    84 } 
     96  } 
    8597 
    86 // update message count display 
    87 $OUTPUT->set_env('pagecount', $pages); 
    88 $OUTPUT->set_env('messagecount', $msg_count); 
    89 $OUTPUT->set_env('current_page', $IMAP->list_page); 
    90 $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count)); 
     98  // update message count display 
     99  $OUTPUT->set_env('messagecount', $msg_count); 
     100  $OUTPUT->set_env('current_page', $IMAP->list_page); 
     101  $OUTPUT->set_env('pagecount', $pages); 
    91102 
    92 // update mailboxlist 
    93 $mbox = $IMAP->get_mailbox_name(); 
    94 $OUTPUT->command('set_unread_count', $mbox, $IMAP->messagecount($mbox, 'UNSEEN'), ($mbox == 'INBOX')); 
     103  // update mailboxlist 
     104  $mbox = $IMAP->get_mailbox_name(); 
     105  $OUTPUT->command('set_unread_count', $mbox, $IMAP->messagecount($mbox, 'UNSEEN'), ($mbox == 'INBOX')); 
    95106 
    96 if ($RCMAIL->action=='moveto' && $target) { 
     107  if ($RCMAIL->action=='moveto' && $target) { 
    97108    $OUTPUT->command('set_unread_count', $target, $IMAP->messagecount($target, 'UNSEEN')); 
    98 } 
     109  } 
    99110 
    100 $OUTPUT->command('set_quota', rcmail_quota_content($IMAP->get_quota())); 
     111  $OUTPUT->command('set_quota', rcmail_quota_content($IMAP->get_quota())); 
     112  $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count)); 
    101113 
    102 // add new rows from next page (if any) 
    103 if ($addrows && $_POST['_from']!='show' && ($jump_back || $nextpage_count > 0)) { 
     114  // add new rows from next page (if any) 
     115  if ($addrows && ($jump_back || $nextpage_count > 0)) { 
    104116    $sort_col   = isset($_SESSION['sort_col'])   ? $_SESSION['sort_col']   : $CONFIG['message_sort_col']; 
    105117    $sort_order = isset($_SESSION['sort_order']) ? $_SESSION['sort_order'] : $CONFIG['message_sort_order']; 
     
    110122    } 
    111123    rcmail_js_message_list($a_headers, false, false); 
     124  } 
    112125} 
    113126 
    114127// send response 
    115128$OUTPUT->send(); 
     129 
     130?> 
Note: See TracChangeset for help on using the changeset viewer.