summaryrefslogtreecommitdiff
path: root/rt/share/html/Elements/CollectionList
diff options
context:
space:
mode:
Diffstat (limited to 'rt/share/html/Elements/CollectionList')
-rw-r--r--rt/share/html/Elements/CollectionList18
1 files changed, 10 insertions, 8 deletions
diff --git a/rt/share/html/Elements/CollectionList b/rt/share/html/Elements/CollectionList
index 522db5811..0c816fe2f 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 ) {
@@ -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 => ()