projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'patch-7' of https://github.com/gjones2/Freeside (#13854 as this bug...
[freeside.git]
/
httemplate
/
search
/
elements
/
search.html
diff --git
a/httemplate/search/elements/search.html
b/httemplate/search/elements/search.html
index
a8e9f08
..
5a16a22
100644
(file)
--- a/
httemplate/search/elements/search.html
+++ b/
httemplate/search/elements/search.html
@@
-2,7
+2,7
@@
Example:
Example:
-
include( 'elements/search.html'
,
+
<& elements/search.html
,
###
# required
###
# required
@@
-162,24
+162,29
@@
Example:
# Excel-specific listref of ( hashrefs or coderefs )
# each hashref: http://search.cpan.org/dist/Spreadsheet-WriteExcel/lib/Spreadsheet/WriteExcel.pm#Format_methods_and_Format_properties
'xls_format' => => [],
# Excel-specific listref of ( hashrefs or coderefs )
# each hashref: http://search.cpan.org/dist/Spreadsheet-WriteExcel/lib/Spreadsheet/WriteExcel.pm#Format_methods_and_Format_properties
'xls_format' => => [],
-
- )
+
+
+ # miscellany
+ 'download_label' => 'Download this report',
+ # defaults to 'Download full results'
+ &>
</%doc>
% if ( $type eq 'csv' ) {
%
<% include('search-csv.html', header=>$header, rows=>$rows, opt=>\%opt ) %>
%
</%doc>
% if ( $type eq 'csv' ) {
%
<% include('search-csv.html', header=>$header, rows=>$rows, opt=>\%opt ) %>
%
-% #} elsif ( $type eq 'excel' ) {
% } elsif ( $type =~ /\.xls$/ ) {
%
% } elsif ( $type =~ /\.xls$/ ) {
%
-<% include('search-xls.html', header=>$header, rows=>$rows, opt=>\%opt ) %>
+<& 'search-xls.html', header=>$header, rows=>$rows, opt=>\%opt &>\
+% # prevent the caller from polluting our output stream
+% $m->abort;
%
% } elsif ( $type eq 'xml' ) {
%
<% include('search-xml.html', rows=>$rows, opt=>\%opt ) %>
%
%
% } elsif ( $type eq 'xml' ) {
%
<% include('search-xml.html', rows=>$rows, opt=>\%opt ) %>
%
-% } else {
# regular HTML
+% } else {
%
<% include('search-html.html',
type => $type,
%
<% include('search-html.html',
type => $type,
@@
-205,6
+210,11
@@
my $curuser = $FS::CurrentUser::CurrentUser;
my $type = $cgi->param('_type') =~ /^(csv|\w*\.xls|xml|select|html(-print)?)$/
? $1 : 'html' ;
my $type = $cgi->param('_type') =~ /^(csv|\w*\.xls|xml|select|html(-print)?)$/
? $1 : 'html' ;
+if ( !$curuser->access_right('Download report data') ) {
+ $opt{'disable_download'} = 1;
+ $type = 'html';
+}
+
my %align = (
'l' => 'left',
'r' => 'right',
my %align = (
'l' => 'left',
'r' => 'right',
@@
-363,6
+373,8
@@
unless ( $type =~ /^(csv|\w*.xls)$/) {
$maxrecords ||= $confmax;
}
$maxrecords ||= $confmax;
}
+ $opt{'disable_maxselect'} ||= $conf->exists('disable_maxselect');
+
$limit = $maxrecords ? "LIMIT $maxrecords" : '';
$offset = $cgi->param('offset') =~ /^(\d+)$/ ? $1 : 0;
$limit = $maxrecords ? "LIMIT $maxrecords" : '';
$offset = $cgi->param('offset') =~ /^(\d+)$/ ? $1 : 0;