[Rt-commit] r14887 - rt/branches/3.6-EXPERIMENTAL-PAGING/html/Elements

ruz at bestpractical.com ruz at bestpractical.com
Wed Aug 6 21:38:10 EDT 2008


Author: ruz
Date: Wed Aug  6 21:38:06 2008
New Revision: 14887

Modified:
   rt/branches/3.6-EXPERIMENTAL-PAGING/html/Elements/TicketList

Log:
* show something better in html than negative values and page 10 of 1

Modified: rt/branches/3.6-EXPERIMENTAL-PAGING/html/Elements/TicketList
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-PAGING/html/Elements/TicketList	(original)
+++ rt/branches/3.6-EXPERIMENTAL-PAGING/html/Elements/TicketList	Wed Aug  6 21:38:06 2008
@@ -71,11 +71,15 @@
 
 </table>
 
-% if ($Rows && $ShowNavigation) {
+% if ( $Rows && $ShowNavigation ) {
 <hr>
-% my $pages = int($TotalFound/$Rows) + (($TotalFound % $Rows) == 0)? 0 : 1;
+% if ( $TotalFound >= 0 ) {
+% my $pages = int($TotalFound/$Rows) + (($TotalFound % $Rows) == 0? 0 : 1);
 % $pages = 1 if $pages < 1;
 <&|/l, $Page, $pages &>Page [_1] of [_2]</&>
+% } else {
+<&|/l, $Page &>Page [_1] of some</&>
+% }
 
 <%perl>
 my $prev = $m->comp(
@@ -98,10 +102,10 @@
 );
 </%perl>
 % if ($Page > 1) {
-<a href="<%$BaseURL%><%$prev%>"><&|/l&>Previous Page</&></a>
+<a href="<% $BaseURL %><% $prev %>"><&|/l&>Previous Page</&></a>
 % }
-% if (($Page * $Rows) < $TotalFound) {
-<a href="<%$BaseURL%><%$next%>"><&|/l&>Next Page</&></a>
+% if ( $TotalFound < 0 || ($Page * $Rows) < $TotalFound ) {
+<a href="<% $BaseURL %><% $next %>"><&|/l&>Next Page</&></a>
 % }
 % }
 <%INIT>
@@ -154,7 +158,7 @@
 $Collection->RowsPerPage($Rows) if ($Rows);
 $Page = 1 unless $Page > 0; # workaround problems with Page = '' or undef
 $Collection->GotoPage( $Page - 1 ); # SB uses page 0 as the first page
-my $TotalFound =  $Collection->CountAll();
+my $TotalFound =  $Collection->CountAll;
 
 </%INIT>
 <%ARGS>


More information about the Rt-commit mailing list