Changeset 848 in subversion


Ignore:
Timestamp:
Oct 2, 2007 4:42:18 AM (6 years ago)
Author:
thomasb
Message:

Fix of the better fix of the bugfix :-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/steps/mail/move_del.inc

    r847 r848  
    2222// count messages before changing anything 
    2323$old_count = $IMAP->messagecount(); 
     24$old_pages = ceil($old_count / $IMAP->page_size); 
    2425 
    2526// move messages 
     
    6566 
    6667 
    67 $remaining = $old_count - $IMAP->page_size * $IMAP->list_page; 
     68$msg_count = $IMAP->messagecount(); 
     69$pages = ceil($msg_count / $IMAP->page_size); 
     70$nextpage_count = $old_count - $IMAP->page_size * $IMAP->list_page; 
     71$remaining = $msg_count - $IMAP->page_size * ($IMAP->list_page - 1); 
    6872 
    6973// jump back one page (user removed the whole last page) 
    70 if ($IMAP->list_page > 1 && $remaining <= 0) 
     74if ($IMAP->list_page > 1 && $nextpage_count <= 0 && $remaining == 0) 
    7175{ 
    7276  $IMAP->set_page($IMAP->list_page-1); 
     
    7680 
    7781// update message count display 
    78 $msg_count = $IMAP->messagecount(); 
    79 $pages = ceil($msg_count / $IMAP->page_size); 
    8082$OUTPUT->set_env('pagecount', $pages); 
    8183$OUTPUT->set_env('current_page', $IMAP->list_page); 
     
    9395 
    9496// add new rows from next page (if any) 
    95 if ($_POST['_from']!='show' && ($jump_back || $remaining > 0)) 
     97if ($_POST['_from']!='show' && ($jump_back || $nextpage_count > 0)) 
    9698{ 
    9799  $sort_col   = isset($_SESSION['sort_col'])   ? $_SESSION['sort_col']   : $CONFIG['message_sort_col']; 
Note: See TracChangeset for help on using the changeset viewer.