combine ticket notification scrips, #15353
[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     <TR><TD>
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></TR>
20
21     <% include('/elements/tr-input-text.html',
22                   'field' => 'serial',
23                   'label' => 'Serial number',
24               ) %>
25     <% include('/elements/tr-input-text.html',
26                   'field' => 'hw_addr',
27                   'label' => 'Hardware address',
28               ) %>
29     <% include('/elements/tr-input-text.html',
30                   'field' => 'ip_addr',
31                   'label' => 'IP address',
32               ) %>
33     <% include('/elements/tr-input-text.html',
34                   'field' => 'smartcard',
35                   'label' => 'Smartcard #',
36               ) %>
37     <% include('/elements/tr-select-table.html',
38                   'field'     => 'statusnum',
39                   'label'     => 'Service status',
40                   'table'     => 'hardware_status',
41                   'name_col'  => 'label',
42                   'empty_label' => 'any',
43                   'hashref'   => {},
44                   'extra_sql' => ' WHERE hardware_status.disabled IS NULL
45 OR (SELECT COUNT(*) FROM svc_hardware 
46   WHERE svc_hardware.statusnum = hardware_status.statusnum) > 0',
47               ) %>
48  
49   </TABLE>
50
51 <BR>
52 <INPUT TYPE="submit" VALUE="Search">
53
54 </FORM>
55
56 <% include('/elements/footer.html') %>
57 <%init>
58
59 die "access denied"
60   unless $FS::CurrentUser::CurrentUser->access_right('List packages'); #?
61
62 my $title = 'Hardware Service Report';
63
64 my @classes = qsearch('hardware_class', {});
65 my @classnums = ('', map { $_->classnum } @classes);
66 my %class_labels = ('' => 'Select hardware class',
67                      map { $_->classnum => $_->classname } @classes);
68
69 sub layer_callback {
70   my $classnum = shift or return '';
71   include('/elements/select-hardware_type.html',
72               'field'       => 'classnum'.$classnum.'typenum',
73               'classnum'    => $classnum,
74               'empty_label' => 'any',
75           );
76 }
77   
78 </%init>
79