X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fsearch-html.html;h=e5e6ca9542c19cd1675e69b2c4d223078a97521c;hb=7b125e587a4d1ee0aca692e23ea7897f671855ae;hp=60dd65a5c9d1653fa2fd5343929c77f58470549d;hpb=b9ec1f7c51efb5122b7dc88ccadb34e9e99a3b6f;p=freeside.git diff --git a/httemplate/search/elements/search-html.html b/httemplate/search/elements/search-html.html index 60dd65a5c..e5e6ca954 100644 --- a/httemplate/search/elements/search-html.html +++ b/httemplate/search/elements/search-html.html @@ -1,5 +1,6 @@ % -% if ( exists($opt{'redirect'}) && scalar(@$rows) == 1 && $total == 1 +% if ( exists($opt{'redirect'}) && $opt{'redirect'} +% && scalar(@$rows) == 1 && $total == 1 % && $type ne 'html-print' % ) { % my $redirect = $opt{'redirect'}; @@ -31,11 +32,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'}}() @@ -53,9 +60,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'}) @@ -94,7 +103,7 @@ % $cgi->delete('maxrecords'); % $cgi->param('_dummy', 1); - ( show % foreach my $max ( map { $_ * $confmax } qw( 1 5 10 25 ) ) { @@ -135,18 +144,18 @@ Download full results
% $cgi->param('_type', "$xlsname.xls" ); - as Excel spreadsheet
+ as Excel spreadsheet
% $cgi->param('_type', 'csv'); - as CSV file
+ as CSV file
-% $cgi->param('_type', 'html-print'); - as printable copy +% if ( defined($opt{xml_elements}) ) { +% $cgi->param('_type', 'xml'); + as XML file
+% } - <% $opt{'extra_choices_callback'} - ? &{$opt{'extra_choices_callback'}}($cgi->query_string) - : '' - %> +% $cgi->param('_type', 'html-print'); + as printable copy % $cgi->param('_type', "html" ); @@ -181,8 +190,13 @@ % my $h2 = 0; +% my $colspan = 0; % foreach my $header ( @{ $opt{header} } ) { +% $colspan-- if $colspan > 0; +% next if $colspan; +% % my $label = ref($header) ? $header->{label} : $header; +% $colspan = ref($header) ? $header->{colspan} : 0; % my $rowspan = 1; % my $style = ''; % if ( $opt{header2} ) { @@ -197,6 +211,7 @@ <% $style %> > @@ -345,7 +360,9 @@ % } % $a = qq(); % } -% +% elsif ( $onclick ) { +% $a = qq(); +% } % } % % } @@ -391,11 +408,12 @@ % } -% if ( $opt{'footer'} ) { +% if ( $opt{'footer'} ) { % foreach my $footer ( @{ $opt{'footer'} } ) { +% $footer = &{$footer}() if ref($footer) eq 'CODE'; <% $footer %> % } @@ -412,9 +430,11 @@ % } % if ( $type eq 'html-print' ) { +% unless ( $opt{nohtmlheader} ) { +% } % } else { <% defined($opt{'html_foot'}) @@ -425,7 +445,10 @@ : '' %> - <% include( '/elements/footer.html' ) %> + <% $opt{nohtmlheader} + ? '' + : include( '/elements/footer.html' ) + %> % } @@ -442,6 +465,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 $count_sth = dbh->prepare($opt{'count_query'}) or die "Error preparing $opt{'count_query'}: ". dbh->errstr;