X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FCollectionList;h=44f76241020f7fdcc8bee689f1d51d46c1e4a915;hp=522db581150e9a7d99548ea451cf16982bfb24a6;hb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924 diff --git a/rt/share/html/Elements/CollectionList b/rt/share/html/Elements/CollectionList index 522db5811..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', @@ -184,6 +186,7 @@ if ( $Rows && $ShowNavigation && $TotalFound > $Rows ) { <%ARGS> $Class => '' $Collection => undef +$TotalFound => undef $Format => undef $DisplayFormat => undef @Order => ()