ACLs for advanced customer and service searching, RT#18157
[freeside.git] / httemplate / search / elements / search-html.html
index d1f4b2f..53167c2 100644 (file)
 
             </TD>
 
-%           unless ( $opt{'disable_download'} || $type eq 'html-print' ) { 
+%           if ( $curuser->access_right('Download report data')
+%                 and !$opt{'disable_download'}
+%                 and $type ne 'html-print' ) { 
 
               <TD ALIGN="right">
 
 %                                       ? '<A HREF="'. $e->{'link'}. '">'
 %                                       : ''
 %                                   ).
+%                                   ( $e->{'onclick'} # don't use with 'link'
+%                                       ? '<A HREF="#" onclick="' .
+%                                         $e->{'onclick'}.'">'
+%                                       : ''
+%                                   ).
 %                                   ( $e->{'size'}
 %                                      ? '<FONT SIZE="'.uc($e->{'size'}).'">'
 %                                      : ''
 %                                       : ''
 %                                   ).
 %                                   ( $e->{'size'} ? '</FONT>' : '' ).
-%                                   ( $e->{'link'} ? '</A>'    : '' ).
+%                                   ( $e->{'link'} || $e->{'onclick'} 
+%                                       ? '</A>'
+%                                       : '' ).
 %                                   '</td>';
 %
 %                                 } @$rowref ).
 %   } 
 <%init>
 
+my $curuser = $FS::CurrentUser::CurrentUser;
+
 my %args = @_;
 my $type           = $args{'type'};
 my $header         = $args{'header'};