X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fsearch-html.html;h=bee33cfe84f4c94dcf3a4fb05c83b86a388f7f9c;hb=03dfd875f74410d283060a4e54eaedf845bfcd39;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..bee33cfe8 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
@@ -251,12 +253,29 @@ % $bgcolor = $bgcolor1; % } - +% my $rowstyle = ''; +% if ( $row eq $opt{'footer_data'} ) { +% $rowstyle = ' STYLE="border-top: dashed 1px black; font-style: italic"'; +% $bgcolor = '#dddddd'; +% } + +% my $trid = ''; +% if ( $opt{'link_field' } ) { +% my $link_field = $opt{'link_field'}; +% if ( ref($link_field) eq 'CODE' ) { +% $trid = &{$link_field}($row); +% } else { +% $trid = $row->$link_field(); +% } +% } + > + % if ( $opt{'fields'} ) { % % my $links = $opt{'links'} ? [ @{$opt{'links'}} ] : ''; % my $onclicks = $opt{'link_onclicks'} ? [ @{$opt{'link_onclicks'}} ] : []; +% my $tooltips = $opt{'tooltips'} ? [ @{$opt{'tooltips'}} ] : []; % my $aligns = $opt{'align'} ? [ @{$opt{'align'}} ] : ''; % my $colors = $opt{'color'} ? [ @{$opt{'color'}} ] : []; % my $sizes = $opt{'size'} ? [ @{$opt{'size'}} ] : []; @@ -296,6 +315,11 @@ % ? '' % : '' % ). +% ( $e->{'onclick'} # don't use with 'link' +% ? '' +% : '' +% ). % ( $e->{'size'} % ? '' % : '' @@ -310,7 +334,9 @@ % : '' % ). % ( $e->{'size'} ? '' : '' ). -% ( $e->{'link'} ? '' : '' ). +% ( $e->{'link'} || $e->{'onclick'} +% ? '' +% : '' ). % ''; % % } @$rowref ). @@ -328,15 +354,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 =~ /^agentnum ) @@ -359,6 +392,14 @@ % if ref($onclick) eq 'CODE'; % $onclick = qq( onClick="$onclick") if $onclick; % +% $tooltip = &{$tooltip}($row) +% if ref($tooltip) eq 'CODE'; +% $tooltip = qq! id="a$id" !. +% qq! onmouseover="return overlib(!. +% $m->interp->apply_escapes($tooltip, 'h', 'js_string'). +% qq!, FGCLASS, 'tooltip', REF, 'a$id', !. +% qq!REFC, 'LL', REFP, 'UL')"! if $tooltip; +% % if ( $link ) { % my( $url, $method ) = @{$link}; % if ( ref($method) eq 'CODE' ) { @@ -366,11 +407,16 @@ % } else { % $a = $url. $row->$method(); % } -% $a = qq(); +% $a = qq(); % } % elsif ( $onclick ) { % $a = qq(); % } +% elsif ( $tooltip ) { +% $a = qq(); +% } +% $id++; + % } % % } @@ -463,6 +509,8 @@ % } <%init> +my $curuser = $FS::CurrentUser::CurrentUser; + my %args = @_; my $type = $args{'type'}; my $header = $args{'header'}; @@ -482,4 +530,5 @@ $count_sth->execute my $count_arrayref = $count_sth->fetchrow_arrayref; my $total = $count_arrayref->[0]; +my $id = 0;