X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fhtml%2FElements%2FTicketList;h=1a531274f7cbbb73f0151d48a7628d6a8d4be6bc;hp=593a77bc99a71c6f5a45238d07ab4695fe40c7e6;hb=9c68254528b6f2c7d8c1921b452fa56064783782;hpb=ef20b2b6b1feb47ad02b5ff7525f1a0fd11d0fa4 diff --git a/rt/html/Elements/TicketList b/rt/html/Elements/TicketList index 593a77bc9..1a531274f 100644 --- a/rt/html/Elements/TicketList +++ b/rt/html/Elements/TicketList @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# You should have received a copy of the GNU General Public License %# along with this program; if not, write to the Free Software -%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,7 +43,7 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} - +
% if ($ShowHeader) { <& /Elements/CollectionAsTable/Header, @@ -69,7 +67,7 @@ <& /Elements/CollectionAsTable/Row, Format => \@Format, i => $i, record => $record, maxitems => $maxitems &> % } -
+ % if ($Rows && $ShowNavigation) {
@@ -77,9 +75,7 @@ % if (($TotalFound % $Rows) == 0) { % $oddRows = 0; % } else { $oddRows = 1; } -% my $pages = int($TotalFound/$Rows)+$oddRows; -% $pages = 1 if $pages < 1; -<&|/l, $Page, $pages &>Page [_1] of [_2] +<&|/l, $Page, int($TotalFound/$Rows)+$oddRows&>Page [_1] of [_2] <%perl> my $prev = $m->comp( @@ -102,27 +98,18 @@ my $next = $m->comp( ); % if ($Page > 1) { -<&|/l&>Previous Page +<&|/l&>Previous Page % } % if (($Page * $Rows) < $TotalFound) { -<&|/l&>Next Page +<&|/l&>Next Page % } % } <%INIT> my $maxitems = 0; $Format ||= $RT::DefaultSearchResultFormat; - -# DisplayFormat lets us use a "temporary" format for display, while -# still using our original format for next/prev page links. -# bulk update uses this feature to add checkboxes - - -$DisplayFormat ||= $Format; - # Scrub the html of the format string to remove any potential nasties. $Format = $m->comp('/Elements/ScrubHTML', Content => $Format); -$DisplayFormat = $m->comp('/Elements/ScrubHTML', Content => $DisplayFormat); unless ($Collection) { @@ -130,13 +117,13 @@ unless ($Collection) { $Collection->FromSQL($Query); } -my (@Format) = $m->comp('/Elements/CollectionAsTable/ParseFormat', Format => $DisplayFormat); +my (@Format) = $m->comp('/Elements/CollectionAsTable/ParseFormat', Format => $Format); # Find the maximum number of items in any row, so we can pad the table. my $item = 0; foreach my $col (@Format) { $item++; - if ( $col->{title} && ($col->{title} eq 'NEWLINE') ) { + if ( $col->{title} eq 'NEWLINE' ) { $item = 0; } else { @@ -144,20 +131,10 @@ foreach my $col (@Format) { } } -if ($OrderBy =~ /\|/) { - # Multiple Sorts - my @OrderBy = split /\|/,$OrderBy; - my @Order = split /\|/,$Order; - $Collection->OrderByCols( - map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } } ( 0 - .. $#OrderBy ) );; -} else { - $Collection->OrderBy(FIELD => $OrderBy, ORDER => $Order); -} +$Collection->OrderBy(FIELD => $OrderBy, ORDER => $Order); $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 +$Collection->GotoPage($Page-1); # SB uses page 0 as the first page my $TotalFound = $Collection->CountAll(); @@ -172,7 +149,6 @@ $Order => undef $OrderBy => undef $BaseURL => undef $Format => $RT::DefaultSearchResultFormat -$DisplayFormat => undef $ShowNavigation => 1 $ShowHeader => 1