[freeside-commits] branch FREESIDE_3_BRANCH updated. 06f1d6ac3ee0bb702cfe667e39f1ccc2729b0510

Mark Wells mark at 420.am
Mon Aug 15 15:29:56 PDT 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  06f1d6ac3ee0bb702cfe667e39f1ccc2729b0510 (commit)
      from  4ecc6084bae83c5564ac27abb166bbac658946dd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 06f1d6ac3ee0bb702cfe667e39f1ccc2729b0510
Author: Mark Wells <mark at freeside.biz>
Date:   Mon Aug 15 15:24:35 2016 -0700

    in grouped payment search, only show tabs when there's more than one group, #71364

diff --git a/httemplate/search/elements/grouped-search/core b/httemplate/search/elements/grouped-search/core
index ffa8cee..3d38a8c 100644
--- a/httemplate/search/elements/grouped-search/core
+++ b/httemplate/search/elements/grouped-search/core
@@ -131,12 +131,14 @@ for my $i (0 .. scalar(@groups) - 1) {
 }
 
 if ( $opt{show_combined} ) {
-  # set up group 0 as a combined view
-  unshift @groups, $totals;
-  unshift @group_labels, 'All ' . PL($opt{name_singular}) .
-                         ' (' . $totals->num_rows . ')';
-  unshift @group_footers, []; # the total footer will suffice
-  unshift @queries, $base_query->clone;
+  if ( @groups > 1 ) {
+    # set up group 0 as a combined view
+    unshift @groups, $totals;
+    unshift @group_labels, 'All ' . PL($opt{name_singular}) .
+                           ' (' . $totals->num_rows . ')';
+    unshift @group_footers, []; # the total footer will suffice
+    unshift @queries, $base_query->clone;
+  }
 }
 
 my @total_footer;
diff --git a/httemplate/search/elements/grouped-search/html b/httemplate/search/elements/grouped-search/html
index df1471a..293da33 100644
--- a/httemplate/search/elements/grouped-search/html
+++ b/httemplate/search/elements/grouped-search/html
@@ -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

-----------------------------------------------------------------------

Summary of changes:
 httemplate/search/elements/grouped-search/core |   14 ++++++++------
 httemplate/search/elements/grouped-search/html |    6 ++++--
 2 files changed, 12 insertions(+), 8 deletions(-)




More information about the freeside-commits mailing list