X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fgrouped-search%2Fcore;h=b15fe86598ae0af4e597fb8111204764526d3ab2;hb=7b0bbc4117a7959b9f7b7b2cf999b8188ba34160;hp=fe47fb7d1fe0a2cf043a4f2483b93bccf0c17ec6;hpb=062f38f2f5d0da64c6fd0702d4df2e805473a1f5;p=freeside.git diff --git a/httemplate/search/elements/grouped-search/core b/httemplate/search/elements/grouped-search/core index fe47fb7d1..b15fe8659 100644 --- a/httemplate/search/elements/grouped-search/core +++ b/httemplate/search/elements/grouped-search/core @@ -110,7 +110,7 @@ for my $i (0 .. scalar(@groups) - 1) { push @group_labels, $label; my @footer; - if ($opt{'subtotal_row'}) { + if ($opt{'subtotal_row'} and @groups > 1) { for( my $col = 0; exists($opt{'subtotal_row'}[$col]) or exists($opt{'header'}[$col]); $col++ @@ -130,6 +130,17 @@ for my $i (0 .. scalar(@groups) - 1) { push @queries, $detail_query; } +if ( $opt{show_combined} ) { + 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; if ($opt{'total_row'}) { for( my $col = 0;