X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fsearch-html.html;h=d1f4b2f1e5d7e2f5c997cf288ab2d1472928a863;hb=dac4bb8dc3fcdd36fdcaf445c12134103a9d599e;hp=37178dcc2fe9dd84e3cc8c329c81b2befbc98249;hpb=624b2d44625f69d71175c3348cae635d580c890b;p=freeside.git diff --git a/httemplate/search/elements/search-html.html b/httemplate/search/elements/search-html.html index 37178dcc2..d1f4b2f1e 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' @@ -30,34 +29,36 @@ % } % } % -% if ( $type eq 'html-print' ) { - - <% include( '/elements/header-popup.html', $opt{'title'} ) %> - -% } elsif ( $type eq 'select' ) { - - <% include( '/elements/header-popup.html', $opt{'title'} ) %> - <% defined($opt{'html_init'}) - ? ( ref($opt{'html_init'}) - ? &{$opt{'html_init'}}() - : $opt{'html_init'} - ) - : '' - %> - -% } else { +% unless ( $opt{nohtmlheader} ) { % -% my @menubar = (); -% if ( $opt{'menubar'} ) { -% @menubar = @{ $opt{'menubar'} }; -% #} else { -% # @menubar = ( 'Main menu' => $p ); +% if ( $type eq 'html-print' ) { + <& /elements/header-popup.html, $opt{'title'} &> +% } else { +% if ( $type eq 'select' ) { + <&/elements/header-popup.html, $opt{'title'} &> +% } else { +% +% my @menubar = (); +% if ( $opt{'menubar'} ) { +% @menubar = @{ $opt{'menubar'} }; +% #} else { +% # @menubar = ( 'Main menu' => $p ); +% } + + <& /elements/header.html, $opt{'title'}, + include( '/elements/menubar.html', @menubar ) + &> + +% } % } +% +% } +% +% unless ( $type eq 'html-print' ) { - <% include( '/elements/header.html', $opt{'title'}, - include( '/elements/menubar.html', @menubar ) - ) - %> +% if ( $opt{'add_link'} ) { #or after html_init? + Add a <% $opt{'name_singular'} %>

+% } <% defined($opt{'html_init'}) ? ( ref($opt{'html_init'}) @@ -71,7 +72,7 @@ % unless ( $total ) { % unless ( $opt{'disable_nonefound'} ) { - No matching <% $opt{'name'} %> found.
+

No matching <% $opt{'name'} %> found.
% } % } % @@ -95,7 +96,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,13 +137,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 query_string %>">XML file
+% } % $cgi->param('_type', 'html-print'); - as printable copy + as query_string %>">printable copy % $cgi->param('_type', "html" ); @@ -178,11 +184,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 = ''; @@ -417,9 +438,11 @@ % } % if ( $type eq 'html-print' ) { +% unless ( $opt{nohtmlheader} ) { +% } % } else { <% defined($opt{'html_foot'}) @@ -430,7 +453,10 @@ : '' %> - <% include( '/elements/footer.html' ) %> + <% $opt{nohtmlheader} + ? '' + : include( '/elements/footer.html' ) + %> % } @@ -447,6 +473,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;