X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fsearch-html.html;h=5c8001fad59770a7fd4b2d6387aa768166ac163c;hb=e7a9ba25d437b6a145a6260594c27f9dc0ac0495;hp=d1f4b2f1e5d7e2f5c997cf288ab2d1472928a863;hpb=1ee0b1290d186a706a256ca72347dc746c6c6688;p=freeside.git diff --git a/httemplate/search/elements/search-html.html b/httemplate/search/elements/search-html.html index d1f4b2f1e..5c8001fad 100644 --- a/httemplate/search/elements/search-html.html +++ b/httemplate/search/elements/search-html.html @@ -130,11 +130,13 @@ -% unless ( $opt{'disable_download'} || $type eq 'html-print' ) { +% if ( $curuser->access_right('Download report data') +% and !$opt{'disable_download'} +% and $type ne 'html-print' ) { - + - Download full results
+ <% $opt{'download_label'} || 'Download full results' %>
% $cgi->param('_type', "$xlsname.xls" ); as query_string %>">Excel spreadsheet
@@ -296,6 +298,11 @@ % ? '' % : '' % ). +% ( $e->{'onclick'} # don't use with 'link' +% ? '' +% : '' +% ). % ( $e->{'size'} % ? '' % : '' @@ -310,7 +317,9 @@ % : '' % ). % ( $e->{'size'} ? '' : '' ). -% ( $e->{'link'} ? '' : '' ). +% ( $e->{'link'} || $e->{'onclick'} +% ? '' +% : '' ). % ''; % % } @$rowref ). @@ -328,15 +337,21 @@ % map { % if ( ref($_) eq 'CODE' ) { % &{$_}($row); +% } elsif ( ref($row) eq 'ARRAY' and +% $_ =~ /^\d+$/ ) { +% # for the 'straight SQL' case: specify fields +% # by position +% encode_entities($row->[$_]); % } else { -% $row->$_(); +% encode_entities($row->$_()); % } % } % @{$opt{'fields'}} % % ) { % -% my $class = ( $field =~ /^ +my $curuser = $FS::CurrentUser::CurrentUser; + my %args = @_; my $type = $args{'type'}; my $header = $args{'header'};