%#
%# 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)
$Collection->FromSQL($Query);
}
-my $TotalFound = $Collection->CountAll();
+$TotalFound = $Collection->CountAll() unless defined $TotalFound;
return '' if !$TotalFound && !$ShowEmpty;
if ( $Rows ) {
}
}
-$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',
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 = '';
<%ARGS>
$Class => ''
$Collection => undef
+$TotalFound => undef
$Format => undef
$DisplayFormat => undef
@Order => ()