fix unapplied payment report, RT#73048, fallout from #25944
[freeside.git] / httemplate / search / elements / grouped-search / html
index 2ecb688..9c2418a 100644 (file)
@@ -11,8 +11,8 @@ my $redirect;
 
 if ( $group_info->{num} == 0 ) {
   $redirect = $opt{'redirect_empty'};
+  $redirect = &$redirect($cgi) if $redirect && ref($redirect) eq 'CODE';
   if ($redirect) {
-    $redirect = &$redirect($cgi) if ref($redirect) eq 'CODE';
     redirect( $redirect );
   } else { # just print this stuff and exit
     $m->comp('/elements/header.html', $opt{'title'});
@@ -67,8 +67,10 @@ if ( $group->num_rows > scalar(@rows) ) {
 
 # set up tab bar
 my @menubar;
-for (my $i = 0; $i < $group_info->{num}; $i++) {
-  push @menubar, $group_info->{group_labels}[$i], ";group=$i";
+if ($group_info->{num} > 1) {
+  for (my $i = 0; $i < $group_info->{num}; $i++) {
+    push @menubar, $group_info->{group_labels}[$i], ";group=$i";
+  }
 }
 
 # not enabled yet; if we need this at some point, enable it on a per-report
@@ -120,7 +122,7 @@ for (my $i = 0; $i < $group_info->{num}; $i++) {
     border-spacing: 0;
   }
 </STYLE>
-<table class="grid nosplitrows">
+<table class="grid">
   <thead>
   <& /search/elements/search-html.html:header_row,
     'header'      => $opt{'header'},