fix broadband reporting with giant query URLs (large numbers of package defs, etc...
[freeside.git] / httemplate / search / elements / search-html.html
index 6121aea..29e0999 100644 (file)
@@ -62,7 +62,7 @@
 
         <% defined($opt{'html_init'}) 
               ? ( ref($opt{'html_init'})
-                    ? &{$opt{'html_init'}}()
+                    ? &{$opt{'html_init'}}($opt{html_init_data})
                     : $opt{'html_init'}
                 )
               : ''
@@ -95,8 +95,9 @@
 %               {
 %                 $cgi->delete('maxrecords');
 %                 $cgi->param('_dummy', 1);
+%                 my $query = $m->scomp('/elements/create_uri_query');
 
-                  ( show <SELECT NAME="maxrecords" onChange="window.location = '<% "$self_url?". $cgi->query_string %>;maxrecords=' + this.options[this.selectedIndex].value;">
+                  ( show <SELECT NAME="maxrecords" onChange="window.location = '<% "$self_url?$query" %>;maxrecords=' + this.options[this.selectedIndex].value;">
 
 %                   foreach my $max ( map { $_ * $confmax } qw( 1 5 10 25 ) ) {
                   <OPTION VALUE="<% $max %>" <% ( $maxrecords == $max ) ? 'SELECTED' : '' %>><% $max %></OPTION>
 
               <TD ALIGN="right" CLASS="noprint">
 
-                <% $opt{'download_label'} || 'Download full results' %><BR>
+                <% $opt{'download_label'} || 'Download results:' %>
 
 %               $cgi->param('_type', "$xlsname.xls" ); 
-                as <A HREF="<% "$self_url?". $cgi->query_string %>">Excel spreadsheet</A><BR>
+%               my $query = $m->scomp('/elements/create_uri_query');
+                <A HREF="<% "$self_url?$query" %>">Spreadsheet</A>&nbsp;|&nbsp;
 
 %               $cgi->param('_type', 'csv'); 
-                as <A HREF="<% "$self_url?". $cgi->query_string %>">CSV file</A><BR>
+%               my $query = $m->scomp('/elements/create_uri_query');
+                <A HREF="<% "$self_url?$query" %>">CSV</A>&nbsp;|&nbsp;
 
 %             if ( defined($opt{xml_elements}) ) {
 %               $cgi->param('_type', 'xml'); 
-                as <A HREF="<% "$self_url?". $cgi->query_string %>">XML file</A><BR>
+%               my $query = $m->scomp('/elements/create_uri_query');
+                <A HREF="<% "$self_url?$query" %>">XML</A>&nbsp;|&nbsp;
 %             }
 
 %               $cgi->param('_type', 'html-print'); 
-                as <A HREF="<% "$self_url?". $cgi->query_string %>">printable copy</A>
+%               my $query = $m->scomp('/elements/create_uri_query');
+                <A HREF="<% "$self_url?$query" %>">webpage</A>
 
+%# "save search" -- for now, obey disable_download and the 'Download
+%# report data' ACL, because saving a search allows the user to receive
+%# copies of the data.
+                <BR>
+%# XXX should do a check here on whether the user already has this
+%# search saved...
+                <& /elements/popup_link.html,
+                  'action'        => $fsurl.'/edit/saved_search.html?title='.
+                                       uri_escape($opt{title}),
+                  'label'         => 'Save this search',
+                  'actionlabel'   => 'Save this search',
+                  'width'         => 650,
+                  'height'        => 500,
+                &>
               </TD>
 %             $cgi->param('_type', "html" ); 
 %           } 
@@ -293,8 +312,8 @@ my $self_url = $cgi->url('-path_info' => 1, '-full' =>1);
 %     } else {
 %       $cgi->param('order_by', $field);
 %     }
-%     $label = qq(<A HREF="$self_url?). $cgi->query_string.
-%              qq(">$label</A>);
+%     my $query = $m->scomp('/elements/create_uri_query');
+%     $label = qq(<A HREF="$self_url?$query">$label</A>);
 %   }
 %
 %   $colspan = ref($header) ? $header->{colspan} : 0;
@@ -349,6 +368,7 @@ $rows => []
 % }
 
 % my $i = 0; # for row striping # XXX CSS - nth-child
+% my $id = 0;
 % foreach my $row ( @$rows ) {
 %
 %   my $rowstyle = '';
@@ -504,7 +524,11 @@ $rows => []
 %
 %           $tooltip = &{$tooltip}($row)
 %             if ref($tooltip) eq 'CODE';
-%           $tooltip = qq! title="<% $tooltip |h %>"!;
+%           $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};
@@ -521,6 +545,7 @@ $rows => []
 %           elsif ( $tooltip ) {
 %             $a = qq(<A $tooltip>);
 %           }
+%           $id++;
 
 %         }
 %