X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fsearch-html.html;h=32f26e86680366058971c87506970aad3e931870;hb=f09bfd28e16b27d8d62c81abebb8062223ce0114;hp=e5e6ca9542c19cd1675e69b2c4d223078a97521c;hpb=4ef5b3b917b7802a136551ad567dc9d649700f53;p=freeside.git diff --git a/httemplate/search/elements/search-html.html b/httemplate/search/elements/search-html.html index e5e6ca954..32f26e866 100644 --- a/httemplate/search/elements/search-html.html +++ b/httemplate/search/elements/search-html.html @@ -1,4 +1,3 @@ -% % if ( exists($opt{'redirect'}) && $opt{'redirect'} % && scalar(@$rows) == 1 && $total == 1 % && $type ne 'html-print' @@ -103,7 +102,7 @@ % $cgi->delete('maxrecords'); % $cgi->param('_dummy', 1); - ( show query_string %>;maxrecords=' + this.options[this.selectedIndex].value;"> % foreach my $max ( map { $_ * $confmax } qw( 1 5 10 25 ) ) { @@ -144,18 +143,18 @@ Download full results
% $cgi->param('_type', "$xlsname.xls" ); - as Excel spreadsheet
+ as query_string %>">Excel spreadsheet
% $cgi->param('_type', 'csv'); - as CSV file
+ as query_string %>">CSV file
% if ( defined($opt{xml_elements}) ) { % $cgi->param('_type', 'xml'); - as XML file
+ as query_string %>">XML file
% } % $cgi->param('_type', 'html-print'); - as printable copy + as query_string %>">printable copy % $cgi->param('_type', "html" ); @@ -191,11 +190,26 @@ % my $h2 = 0; % my $colspan = 0; +% my @fields = @{ $opt{'sort_fields'} || $opt{'fields'} || [] }; +% my $order_by = $cgi->param('order_by'); % foreach my $header ( @{ $opt{header} } ) { +% +% my $field = shift @fields; +% % $colspan-- if $colspan > 0; % next if $colspan; % % my $label = ref($header) ? $header->{label} : $header; +% unless ( ref($field) || !$field ) { +% if ( $order_by eq $field ) { +% $cgi->param('order_by', "$field DESC"); +% } else { +% $cgi->param('order_by', $field); +% } +% $label = qq($label); +% } +% % $colspan = ref($header) ? $header->{colspan} : 0; % my $rowspan = 1; % my $style = ''; @@ -465,7 +479,7 @@ my $confmax = $args{'confmax'}; my $maxrecords = $args{'maxrecords'}; my $offset = $args{'offset'}; my %opt = %{ $args{'opt'} }; -my $self_url = $opt{'url'} || $cgi->self_url; +my $self_url = $opt{'url'} || $cgi->url('-path_info' => 1, '-full' =>1); my $count_sth = dbh->prepare($opt{'count_query'}) or die "Error preparing $opt{'count_query'}: ". dbh->errstr;