diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2012-07-02 14:24:21 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2012-07-02 14:24:21 -0700 |
| commit | 85e677b86fc37c54e6de2b06340351a28f5a5916 (patch) | |
| tree | 11148e2c292bd1a43b7cf6c2f5212a6ca8b03e75 /rt/share/html/Elements/CollectionList | |
| parent | e5ab051ccdb7637d8dd2f0ed9b4fe9aaaf1d1100 (diff) | |
| parent | 92aedddd3684167abb60cd3f1d77bbc156c592e6 (diff) | |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'rt/share/html/Elements/CollectionList')
| -rw-r--r-- | rt/share/html/Elements/CollectionList | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/rt/share/html/Elements/CollectionList b/rt/share/html/Elements/CollectionList index 522db5811..402a272b4 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-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (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 ) { @@ -68,7 +68,7 @@ if ( $Rows ) { # collection is ordered or not if ( @OrderBy && ($AllowSorting || !$Collection->{'order_by'}) ) { if ( $OrderBy[0] =~ /\|/ ) { - @OrderBy = split /\|/, $OrderBy[0]; + @OrderBy = grep length($_), split /\|/, $OrderBy[0]; @Order = split /\|/,$Order[0]; } $Collection->OrderByCols( @@ -105,13 +105,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('<table border="0" cellspacing="0" cellpadding="1"' . - ' width="100%" class="' . - ($Collection->isa('RT::Tickets') ? 'ticket-list' : 'collection') . '">'); +$m->out('<table class="' . + ($Collection->isa('RT::Tickets') ? 'ticket-list' : 'collection') . ' collection-as-table">'); if ( $ShowHeader ) { $m->comp('/Elements/CollectionAsTable/Header', @@ -184,6 +185,7 @@ if ( $Rows && $ShowNavigation && $TotalFound > $Rows ) { <%ARGS> $Class => '' $Collection => undef +$TotalFound => undef $Format => undef $DisplayFormat => undef @Order => () |
