[Rt-commit] r20106 - rt/3.8/trunk/lib/RT/Report

ruz at bestpractical.com ruz at bestpractical.com
Mon Jul 6 21:49:32 EDT 2009


Author: ruz
Date: Mon Jul  6 21:49:32 2009
New Revision: 20106

Modified:
   rt/3.8/trunk/lib/RT/Report/Tickets.pm

Log:
* add empty rows only when we group only by Status, otherwise
  this code breaks table

Modified: rt/3.8/trunk/lib/RT/Report/Tickets.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Report/Tickets.pm	(original)
+++ rt/3.8/trunk/lib/RT/Report/Tickets.pm	Mon Jul  6 21:49:32 2009
@@ -140,7 +140,7 @@
     my $self = shift;
     my %args = ref $_[0]? %{ $_[0] }: (@_);
 
-    $self->{'_group_by_field'} = $args{'FIELD'};
+    push @{ $self->{'_group_by_field'} ||= [] }, $args{'FIELD'};
     %args = $self->_FieldToFunction( %args );
 
     $self->SUPER::GroupBy( \%args );
@@ -269,7 +269,7 @@
 
 sub AddEmptyRows {
     my $self = shift;
-    if ( $self->{'_group_by_field'} eq 'Status' ) {
+    if ( @{ $self->{'_group_by_field'} || [] } == 1 && $self->{'_group_by_field'}[0] eq 'Status' ) {
         my %has = map { $_->__Value('Status') => 1 } @{ $self->ItemsArrayRef || [] };
 
         foreach my $status ( grep !$has{$_}, RT::Queue->new($self->CurrentUser)->StatusArray ) {


More information about the Rt-commit mailing list