X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fsearch-html.html;h=32f26e86680366058971c87506970aad3e931870;hb=f09bfd28e16b27d8d62c81abebb8062223ce0114;hp=71e61de610d796e9464e2874c80182a9071ed1e9;hpb=5b66c5f19bd7c820f20d964b8b1c0df291603236;p=freeside.git diff --git a/httemplate/search/elements/search-html.html b/httemplate/search/elements/search-html.html index 71e61de61..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' @@ -32,11 +31,17 @@ % % if ( $type eq 'html-print' ) { - <% include( '/elements/header-popup.html', $opt{'title'} ) %> + <% $opt{nohtmlheader} + ? '' + : include( '/elements/header-popup.html', $opt{'title'} ) + %> % } elsif ( $type eq 'select' ) { - <% include( '/elements/header-popup.html', $opt{'title'} ) %> + <% $opt{nohtmlheader} + ? '' + : include( '/elements/header-popup.html', $opt{'title'} ) + %> <% defined($opt{'html_init'}) ? ( ref($opt{'html_init'}) ? &{$opt{'html_init'}}() @@ -54,9 +59,11 @@ % # @menubar = ( 'Main menu' => $p ); % } - <% include( '/elements/header.html', $opt{'title'}, - include( '/elements/menubar.html', @menubar ) - ) + <% $opt{nohtmlheader} + ? '' + : include( '/elements/header.html', $opt{'title'}, + include( '/elements/menubar.html', @menubar ) + ) %> <% defined($opt{'html_init'}) @@ -95,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 ) ) { @@ -136,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
-% $cgi->param('_type', 'html-print'); - as printable copy +% if ( defined($opt{xml_elements}) ) { +% $cgi->param('_type', 'xml'); + as query_string %>">XML file
+% } - <% $opt{'extra_choices_callback'} - ? &{$opt{'extra_choices_callback'}}($cgi->query_string) - : '' - %> +% $cgi->param('_type', 'html-print'); + as query_string %>">printable copy % $cgi->param('_type', "html" ); @@ -182,8 +189,28 @@ % 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 = ''; % if ( $opt{header2} ) { @@ -198,6 +225,7 @@ <% $style %> > @@ -416,9 +444,11 @@ % } % if ( $type eq 'html-print' ) { +% unless ( $opt{nohtmlheader} ) { +% } % } else { <% defined($opt{'html_foot'}) @@ -429,7 +459,10 @@ : '' %> - <% include( '/elements/footer.html' ) %> + <% $opt{nohtmlheader} + ? '' + : include( '/elements/footer.html' ) + %> % } @@ -446,6 +479,7 @@ my $confmax = $args{'confmax'}; my $maxrecords = $args{'maxrecords'}; my $offset = $args{'offset'}; my %opt = %{ $args{'opt'} }; +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;