X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FCollectionList;h=44f76241020f7fdcc8bee689f1d51d46c1e4a915;hp=a57006e5e9b4b993467956e4ea5f0518dd9ff780;hb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;hpb=fc6209f398899f0211cfcedeb81a3cd65e04a941 diff --git a/rt/share/html/Elements/CollectionList b/rt/share/html/Elements/CollectionList index a57006e5e..44f762410 100644 --- a/rt/share/html/Elements/CollectionList +++ b/rt/share/html/Elements/CollectionList @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -51,7 +51,7 @@ if (!$Collection && $Class eq 'RT::Tickets') { $Collection->FromSQL($Query); } -my $TotalFound = $Collection->CountAll(); +$TotalFound = $Collection->CountAll() unless defined $TotalFound; return '' if !$TotalFound && !$ShowEmpty; if ( $Rows ) { @@ -71,6 +71,7 @@ if ( @OrderBy && ($AllowSorting || !$Collection->{'order_by'}) ) { @OrderBy = split /\|/, $OrderBy[0]; @Order = split /\|/,$Order[0]; } + @OrderBy = grep length, @OrderBy; $Collection->OrderByCols( map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } } ( 0 .. $#OrderBy ) @@ -105,13 +106,14 @@ foreach my $col (@Format) { } } -$Class ||= ref $Collection; -$Class =~ s/s$//; -$Class =~ s/:/_/g; +$Class ||= $Collection->ColumnMapClassName; +if ($Class =~ /::/) { # older passed in value + $Class =~ s/s$//; + $Class =~ s/:/_/g; +} -$m->out(''); +$m->out('
'); if ( $ShowHeader ) { $m->comp('/Elements/CollectionAsTable/Header', @@ -133,7 +135,9 @@ if ( $ShowHeader ) { my ($i, $column_map) = (0, {}); while ( my $record = $Collection->Next ) { # Every ten rows, flush the buffer and put something on the page. - $m->flush_buffer unless ++$i % 10; + #broken w/FS, causes rows to be output prematurely + #$m->flush_buffer unless ++$i % 10; + ++$i; my $warning = 0; my $Classes = ''; @@ -182,6 +186,7 @@ if ( $Rows && $ShowNavigation && $TotalFound > $Rows ) { <%ARGS> $Class => '' $Collection => undef +$TotalFound => undef $Format => undef $DisplayFormat => undef @Order => ()