diff options
Diffstat (limited to 'httemplate/search/elements/search.html')
-rw-r--r-- | httemplate/search/elements/search.html | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html index 1312cac41..4bfe8b091 100644 --- a/httemplate/search/elements/search.html +++ b/httemplate/search/elements/search.html @@ -194,9 +194,6 @@ my(%opt) = @_; my $curuser = $FS::CurrentUser::CurrentUser; -my $type = $cgi->param('_type') =~ /^(csv|\w*\.xls|select|html(-print)?)$/ - ? $1 : 'html' ; - my %align = ( 'l' => 'left', 'r' => 'right', @@ -207,22 +204,6 @@ my %align = ( $opt{align} = [ map $align{$_}, split(//, $opt{align}) ], unless !$opt{align} || ref($opt{align}); -if($type =~ /csv|xls/) { - my $h = $opt{'header'}; - my @del; - my $i = 0; - do { - if( ref($h->[$i]) and exists($h->[$i]->{'nodownload'}) ) { - splice(@{$opt{$_}}, $i, 1) foreach - qw(header footer fields links link_onclicks - align color size style cell_style xls_format); - } - else { - $i++; - } - } while ( exists($h->[$i]) ); -} - $opt{disable_download} = 0 if $opt{disable_download} && $curuser->access_right('Configuration download'); @@ -310,22 +291,25 @@ if ( $opt{'disableable'} ) { if ( $cgi->param('showdisabled') ) { $cgi->param('showdisabled', 0); $opt{'html_posttotal'} .= - '( <a href="'. $cgi->self_url. qq!">hide disabled $items</a> )!; #" + '( <a href="'. $cgi->self_url. qq!">hide disabled $items</a> )!; $cgi->param('showdisabled', 1); } else { $cgi->param('showdisabled', 1); $opt{'html_posttotal'} .= - '( <a href="'. $cgi->self_url. qq!">show disabled $items</a> )!; #" + '( <a href="'. $cgi->self_url. qq!">show disabled $items</a> )!; $cgi->param('showdisabled', 0); } } +my $type = $cgi->param('_type') =~ /^(csv|\w*\.xls|select|html(-print)?)$/ + ? $1 : 'html'; + my $limit = ''; my($confmax, $maxrecords, $offset ); -if ( !$type =~ /^(csv|\w*.xls)$/) { -# html mode +unless ( $type =~ /^(csv|\w*\.xls)$/ ) { + unless (exists($opt{count_query}) && length($opt{count_query})) { ( $opt{count_query} = $opt{query} ) =~ s/^\s*SELECT\s*(.*?)\s+FROM\s/SELECT COUNT(*) FROM /i; #silly vim:/ |