RT# 83179 - set agent num to use default agentnum if configured, and fixed adding...
[freeside.git] / httemplate / search / report_svc_hardware.html
1 <% include('/elements/header.html', $title ) %>
2
3 <FORM ACTION="svc_hardware.cgi" METHOD="GET">
4
5   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
6     <TR>
7       <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
8     </TR>
9
10     <& /elements/tr-td-label.html, label => 'Device type' &>
11 %#    <% include('/elements/selectlayers.html',
12 %#                  'field'           => 'classnum',
13 %#                  'label'           => '',
14 %#                  'options'         => \@classnums,
15 %#                  'labels'          => \%class_labels,
16 %#                  'layer_callback'  => \&layer_callback,
17 %#                  'html_between'    => '</TD><TD>',
18 %#              ) %>
19     <TD>
20       <& /elements/select-hardware_type.html,
21           'empty_label' => '(all)'
22        &>
23     </TD></TR>
24
25     <% include('/elements/tr-input-text.html',
26                   'field' => 'serial',
27                   'label' => 'Serial number',
28               ) %>
29     <% include('/elements/tr-input-text.html',
30                   'field' => 'hw_addr',
31                   'label' => 'Hardware address',
32               ) %>
33     <% include('/elements/tr-input-text.html',
34                   'field' => 'ip_addr',
35                   'label' => 'IP address',
36               ) %>
37     <% include('/elements/tr-input-text.html',
38                   'field' => 'smartcard',
39                   'label' => 'Smartcard #',
40               ) %>
41     <% include('/elements/tr-select-table.html',
42                   'field'     => 'statusnum',
43                   'label'     => 'Service status',
44                   'table'     => 'hardware_status',
45                   'name_col'  => 'label',
46                   'empty_label' => 'any',
47                   'hashref'   => {},
48                   'extra_sql' => ' WHERE hardware_status.disabled IS NULL
49 OR (SELECT COUNT(*) FROM svc_hardware 
50   WHERE svc_hardware.statusnum = hardware_status.statusnum) > 0',
51               ) %>
52  
53   </TABLE>
54
55 <BR>
56 <INPUT TYPE="submit" VALUE="Search">
57
58 </FORM>
59
60 <% include('/elements/footer.html') %>
61 <%init>
62
63 die "access denied"
64   unless $FS::CurrentUser::CurrentUser->access_right('Services: Hardware: Advanced search');
65
66 my $title = 'Hardware Service Report';
67
68 my @classes = qsearch('hardware_class', {});
69 my @classnums = ('', map { $_->classnum } @classes);
70 my %class_labels = ('' => 'Select hardware class',
71                      map { $_->classnum => $_->classname } @classes);
72
73 sub layer_callback {
74   my $classnum = shift or return '';
75   include('/elements/select-hardware_type.html',
76               'field'       => 'classnum'.$classnum.'typenum',
77               'classnum'    => $classnum,
78               'prefix'      => $classnum,
79               'empty_label' => 'any',
80           );
81 }
82   
83 </%init>
84