[Rt-commit] r13061 - in rt/branches/3.8-TESTING: share/html/Elements
kyoki at bestpractical.com
kyoki at bestpractical.com
Mon Jun 9 15:06:52 EDT 2008
Author: kyoki
Date: Mon Jun 9 15:06:48 2008
New Revision: 13061
Modified:
rt/branches/3.8-TESTING/ (props changed)
rt/branches/3.8-TESTING/share/html/Elements/TicketList
Log:
Modified: rt/branches/3.8-TESTING/share/html/Elements/TicketList
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Elements/TicketList (original)
+++ rt/branches/3.8-TESTING/share/html/Elements/TicketList Mon Jun 9 15:06:48 2008
@@ -80,67 +80,24 @@
%if ($Rows && $ShowNavigation) {
<hr />
-% my $oddRows = ($TotalFound && $TotalFound % $Rows == 0 )? 0 : 1;
-% my $pages = int($TotalFound/$Rows)+$oddRows;
-% $pages = 1 if $pages < 1;
-<&|/l, $Page, $pages &>Page </&>
-
-<%perl>
-my $prev = $m->comp(
- '/Elements/QueryString',
- Query => $Query,
- Format => $Format,
- Rows => $Rows,
- OrderBy => $OrderBy,
- Order => $Order,
- Page => ( $Page - 1 )
-);
-
-my %show;
-$show{1} = 1;
-$show{$_} = 1 for (($Page - 2)..($Page + 2));
-$show{$pages} = 1;
-my $dots;
-for my $number (1..$pages){
- if ($show{$number}){
- $dots = undef;
- if ($number == $Page){
- $number = ("<em>$number </em>");
- }
- my $num = $m->comp(
- '/Elements/QueryString',
- Query => $Query,
- Format => $Format,
- Rows => $Rows,
- OrderBy => $OrderBy,
- Order => $Order,
- Page => $number
- );
- $m->out("<a href=\"$BaseURL$num\">$number </a>");
- }
- elsif (not $dots){
- $dots = 1;
- $m->out(" ... ");
- }
+<%PERL>
+my $oddRows = ($TotalFound && $TotalFound % $Rows == 0 )? 0 : 1;
+my $pages = int($TotalFound/$Rows)+$oddRows;
+$pages = 1 if $pages < 1;
+my @url_params = (Query => $Query,
+ Format => $Format,
+ Rows => $Rows,
+ OrderBy => $OrderBy,
+ Order => $Order);
+$m->comp( '/Elements/CollectionListPaging',
+ BaseURL => $BaseURL,
+ Rows => $Rows,
+ TotalFound => $TotalFound,
+ CurrentPage => $Page,
+ Pages => $pages,
+ URLParams => \@url_params);
}
-
-my $next = $m->comp(
- '/Elements/QueryString',
- Query => $Query,
- Format => $Format,
- Rows => $Rows,
- OrderBy => $OrderBy,
- Order => $Order,
- Page => ( $Page + 1 )
-);
-</%perl>
-% if ($Page > 1) {
-<a href="<%$BaseURL%><%$prev%>"><&|/l&>Previous</&></a>
-% }
-% if (($Page * $Rows) < $TotalFound) {
-<a href="<%$BaseURL%><%$next%>"><&|/l&>Next</&></a>
-% }
-% }
+</%PERL>
<%INIT>
unless ($Collection) {
$Collection = RT::Tickets->new( $session{'CurrentUser'} );
More information about the Rt-commit
mailing list