default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / search / report_svc_hardware.html
index 4a763b0..b0bfc08 100755 (executable)
@@ -7,20 +7,24 @@
       <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
     </TR>
 
-    <TR><TD>
-    <% include('/elements/selectlayers.html',
-                  'field'           => 'classnum',
-                  'label'           => '',
-                  'options'         => \@classnums,
-                  'labels'          => \%class_labels,
-                  'layer_callback'  => \&layer_callback,
-                  'html_between'    => '</TD><TD>',
-              ) %>
+    <& /elements/tr-td-label.html, label => 'Device type' &>
+%#    <% include('/elements/selectlayers.html',
+%#                  'field'           => 'classnum',
+%#                  'label'           => '',
+%#                  'options'         => \@classnums,
+%#                  'labels'          => \%class_labels,
+%#                  'layer_callback'  => \&layer_callback,
+%#                  'html_between'    => '</TD><TD>',
+%#              ) %>
+    <TD>
+      <& /elements/select-hardware_type.html,
+          'empty_label' => '(all)'
+       &>
     </TD></TR>
 
     <% include('/elements/tr-input-text.html',
                   'field' => 'serial',
-                  'label' => 'Serial #',
+                  'label' => 'Serial number',
               ) %>
     <% include('/elements/tr-input-text.html',
                   'field' => 'hw_addr',
                   'field' => 'ip_addr',
                   'label' => 'IP address',
               ) %>
+    <% include('/elements/tr-input-text.html',
+                  'field' => 'smartcard',
+                  'label' => 'Smartcard #',
+              ) %>
     <% include('/elements/tr-select-table.html',
                   'field'     => 'statusnum',
                   'label'     => 'Service status',
                   'table'     => 'hardware_status',
                   'name_col'  => 'label',
                   'empty_label' => 'any',
+                  'hashref'   => {},
+                  'extra_sql' => ' WHERE hardware_status.disabled IS NULL
+OR (SELECT COUNT(*) FROM svc_hardware 
+  WHERE svc_hardware.statusnum = hardware_status.statusnum) > 0',
               ) %>
  
   </TABLE>
@@ -49,7 +61,7 @@
 <%init>
 
 die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('List packages'); #?
+  unless $FS::CurrentUser::CurrentUser->access_right('Services: Hardware: Advanced search');
 
 my $title = 'Hardware Service Report';
 
@@ -63,6 +75,7 @@ sub layer_callback {
   include('/elements/select-hardware_type.html',
               'field'       => 'classnum'.$classnum.'typenum',
               'classnum'    => $classnum,
+              'prefix'      => $classnum,
               'empty_label' => 'any',
           );
 }