summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-08-15 15:24:35 -0700
committerMark Wells <mark@freeside.biz>2016-08-15 15:29:37 -0700
commit8d37b300115b2fc8cdc427ae4919f2c612914b48 (patch)
tree974a36eab2df43af80c8a970664e94972ef34d70 /httemplate/search
parentb5a42d9df4a06b10ddb33bb7bb71985fc9c9f6cc (diff)
in grouped payment search, only show tabs when there's more than one group, #71364
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/elements/grouped-search/core14
-rw-r--r--httemplate/search/elements/grouped-search/html6
2 files changed, 12 insertions, 8 deletions
diff --git a/httemplate/search/elements/grouped-search/core b/httemplate/search/elements/grouped-search/core
index ffa8cee39..3d38a8c7e 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 df1471a52..293da338f 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