X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fsearch-html.html;h=e760bc546960aeb203d0e9d2b156f4f7afcdf100;hb=54a357b171aa44f9399b4c146acd2afd3b686075;hp=d7e81282b83d49f8a7140b8e2673f7e352945a49;hpb=3185fe4edea62dd3fa9818cf80902e96fe2a2d21;p=freeside.git
diff --git a/httemplate/search/elements/search-html.html b/httemplate/search/elements/search-html.html
index d7e81282b..e760bc546 100644
--- a/httemplate/search/elements/search-html.html
+++ b/httemplate/search/elements/search-html.html
@@ -253,12 +253,23 @@
% $bgcolor = $bgcolor1;
% }
-
+% 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'}} ] : [];
@@ -341,9 +352,9 @@
% $_ =~ /^\d+$/ ) {
% # for the 'straight SQL' case: specify fields
% # by position
-% $row->[$_];
+% encode_entities($row->[$_]);
% } else {
-% $row->$_();
+% encode_entities($row->$_());
% }
% }
% @{$opt{'fields'}}
@@ -360,6 +371,7 @@
% if ( $links ) {
% my $link = shift @$links;
% my $onclick = shift @$onclicks;
+% my $tooltip = shift @$tooltips;
%
% if ( ! $opt{'agent_virt'}
% || ( $null_link && ! $row->agentnum )
@@ -374,6 +386,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' ) {
@@ -381,11 +401,16 @@
% } else {
% $a = $url. $row->$method();
% }
-% $a = qq();
+% $a = qq();
% }
% elsif ( $onclick ) {
% $a = qq();
% }
+% elsif ( $tooltip ) {
+% $a = qq();
+% }
+% $id++;
+
% }
%
% }
@@ -499,4 +524,5 @@ $count_sth->execute
my $count_arrayref = $count_sth->fetchrow_arrayref;
my $total = $count_arrayref->[0];
+my $id = 0;
%init>