X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fgrouped-search%2Fhtml;h=cb9c96ce6157db37fb6983d58bef904290fa6051;hp=df1471a5292d41d6fa210cd005b39bfd675ce66f;hb=f30eaaf66cd0a947f388a03edd4522ba92a367bb;hpb=9aee669886202be7035e6c6049fc71bc99dd3013 diff --git a/httemplate/search/elements/grouped-search/html b/httemplate/search/elements/grouped-search/html index df1471a52..cb9c96ce6 100644 --- a/httemplate/search/elements/grouped-search/html +++ b/httemplate/search/elements/grouped-search/html @@ -5,14 +5,16 @@ my $conf = FS::Conf->new; my %opt = @_; $opt{'name'} ||= PL($opt{'name_singular'}); +my $amount_field = $opt{amount_field}; + my $group_info = $m->comp('core', %opt); 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'}); @@ -34,7 +36,7 @@ my $footer = $group_info->{group_footers}[$curr_group]; my $total_footer = $group_info->{total_footer} || []; # pagination my ($limit, $offset); -my $maxrecords = $conf->config('maxsearchrecordsperpage') || 50; +my $maxrecords = $conf->config('maxsearchrecordsperpage') || 100; if ( $cgi->param('maxrecords') =~ /^(\d+)$/ ) { $maxrecords = $1; } @@ -67,8 +69,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 @@ -88,6 +92,8 @@ for (my $i = 0; $i < $group_info->{num}; $i++) { # } #} +my $conf = FS::Conf->new; +my $money = $conf->config('money_char') || '$'; <& /elements/header.html, $opt{title} &> @@ -104,14 +110,22 @@ for (my $i = 0; $i < $group_info->{num}; $i++) { &>
+% if ( $group->num_rows > 0 ) { +

<% emt('[quant,_1,_2]', $group->num_rows, $opt{name_singular}) %> for <% emt($money.$group->$amount_field()) %> +

%# download links -

<% emt('Download full results') %>
+

<% emt('Download results:') %> % $cgi->param('type', 'xls'); -<% emt('as Excel spreadsheet') %>
+<% emt('Spreadsheet') %> | % $cgi->param('type', 'html-print'); -<% emt('as printable copy') %>
+<% emt('webpage') %> +% if ( ref($query) && $query->{table} eq 'cust_pay' ) { +% $cgi->param('type', 'deposit_slip'); + | <% emt('deposit slip') %> +% } % $cgi->delete('type');

+% } <% $pager %>