checkpoint tax editors and correct a blunder
[freeside.git] / httemplate / search / elements / search.html
index c6021e5..40c71d8 100644 (file)
@@ -93,6 +93,8 @@ Example:
     
     #disabling things
     'disable_download' => '', # set true to hide the CSV/Excel download links
+    'disable_total'    => '', # set true to hide the total"
+    'disable_maxselect' => '', # set true to disable record/page selection
     'disable_nonefound' => '', # set true to disable the "No matching Xs found"
                                # message
    
@@ -291,6 +293,17 @@ Example:
 
         <% include( '/elements/header-popup.html', $opt{'title'} ) %>
 
+%     } elsif ( $type eq 'select' ) {
+
+        <% include( '/elements/header-popup.html', $opt{'title'} ) %>
+        <% defined($opt{'html_init'}) 
+              ? ( ref($opt{'html_init'})
+                    ? &{$opt{'html_init'}}()
+                    : $opt{'html_init'}
+                )
+              : ''
+        %>
+
 %     } else {
 %
 %       my @menubar = ();
@@ -319,7 +332,9 @@ Example:
 %       unless ( $opt{'disable_nonefound'} ) { 
           No matching <% $opt{'name'} %> found.<BR>
 %       } 
-%     } else { 
+%     }
+%
+%     if ( $total || $opt{'disableable'} ) { #hmm... and there *are* ones to show??
 
         <TABLE>
           <TR>
@@ -328,14 +343,18 @@ Example:
 
               <FORM>
 
-                <% $total %> total <% $opt{'name'} %>
+%               if (! $opt{'disable_total'}) {
+                  <% $total %> total <% $opt{'name'} %>
+%               }
 
-%               if ( $confmax && $total > $confmax && $type ne 'html-print' ) {
+%               if ( $confmax && $total > $confmax
+%                    && ! $opt{'disable_maxselect'}
+%                    && $type ne 'html-print' )
+%               {
 %                 $cgi->delete('maxrecords');
 %                 $cgi->param('_dummy', 1);
 
 %#                 ( show <SELECT NAME="maxrecords" onChange="this.form.submit();">
-                  ( show <SELECT NAME="maxrecords" onChange="window.location = '<% $cgi->self_url %>;maxrecords=' + this.options[this.selectedIndex].value;">
 
 %                   foreach my $max ( map { $_ * $confmax } qw( 1 5 10 25 ) ) {
                   <OPTION VALUE="<% $max %>" <% ( $maxrecords == $max ) ? 'SELECTED' : '' %>><% $max %></OPTION>
@@ -384,6 +403,11 @@ Example:
 %               $cgi->param('_type', 'html-print'); 
                 as <A HREF="<% $cgi->self_url %>">printable copy</A>
 
+              <% $opt{'extra_choices_callback'}
+                 ? &{$opt{'extra_choices_callback'}}($cgi->query_string)
+                 : ''
+              %>
+
               </TD>
 %             $cgi->param('_type', "html" ); 
 %           } 
@@ -763,7 +787,7 @@ if ( $opt{'disableable'} ) {
 
 }
 
-my $type = $cgi->param('_type') =~ /^(csv|\w*\.xls|html(-print)?)$/
+my $type = $cgi->param('_type') =~ /^(csv|\w*\.xls|select|html(-print)?)$/
            ? $1 : 'html';
 
 my $limit = '';