[freeside-commits] freeside/httemplate/search report_svc_hardware.html, 1.2, 1.3 svc_hardware.cgi, 1.2, 1.3
Mark Wells
mark at wavetail.420.am
Wed Feb 15 18:13:02 PST 2012
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv972/httemplate/search
Modified Files:
report_svc_hardware.html svc_hardware.cgi
Log Message:
svc_hardware revision number, #16266
Index: svc_hardware.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/svc_hardware.cgi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- svc_hardware.cgi 29 Apr 2011 08:58:19 -0000 1.2
+++ svc_hardware.cgi 16 Feb 2012 02:13:00 -0000 1.3
@@ -7,6 +7,7 @@
'header' => [ '#',
'Service',
'Device type',
+ '', #revision
'Serial #',
'Hardware addr.',
'IP addr.',
@@ -16,21 +17,22 @@
'fields' => [ 'svcnum',
'svc',
'model',
+ 'revision',
'serial',
'hw_addr',
'ip_addr',
'smartcard',
\&FS::UI::Web::cust_fields,
],
- 'links' => [ ($link_svc) x 7,
+ 'links' => [ ($link_svc) x 8,
( map { $_ ne 'Cust. Status' ?
$link_cust : '' }
FS::UI::Web::cust_header() )
],
- 'align' => 'rllllll' . FS::UI::Web::cust_aligns(),
- 'color' => [ ('') x 7,
+ 'align' => 'rlllllll' . FS::UI::Web::cust_aligns(),
+ 'color' => [ ('') x 8,
FS::UI::Web::cust_colors() ],
- 'style' => [ $svc_cancel_style, ('') x 6,
+ 'style' => [ $svc_cancel_style, ('') x 7,
FS::UI::Web::cust_styles() ],
)
%>
@@ -39,7 +41,6 @@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('List services');
-
my $addl_from = '
LEFT JOIN cust_svc USING ( svcnum )
LEFT JOIN part_svc USING ( svcpart )
@@ -66,9 +67,9 @@
push @extra_sql, "hw_addr LIKE '%$hw_addr%'";
}
+if ( $cgi->param('ip_addr') ) {
my $ip = NetAddr::IP->new($cgi->param('ip_addr'));
-if ( $ip ) {
- push @extra_sql, "ip_addr = '".lc($ip->addr)."'";
+ push @extra_sql, "ip_addr = '".lc($ip->addr)."'" if $ip;
}
if ( lc($cgi->param('smartcard')) =~ /^(\w+)$/ ) {
@@ -81,9 +82,14 @@
if ( $cgi->param('classnum') =~ /^(\d+)$/ ) {
push @extra_sql, "hardware_type.classnum = $1";
- if ( $cgi->param('classnum'.$1.'typenum') =~ /^(\d+)$/ ) {
- push @extra_sql, "svc_hardware.typenum = $1";
}
+
+if ( $cgi->param('model') =~ /^([\w\s]+)$/ ) {
+ push @extra_sql, "hardware_type.model = '$1'";
+}
+
+if ( $cgi->param('typenum') =~ /^(\d+)$/ ) {
+ push @extra_sql, "svc_hardware.typenum = $1";
}
if ( $cgi->param('svcpart') =~ /^(\d+)$/ ) {
@@ -103,6 +109,7 @@
'part_svc.svc',
'cust_main.custnum',
'hardware_type.model',
+ 'hardware_type.revision',
'cust_pkg.cancel',
FS::UI::Web::cust_sql_fields(),
),
@@ -111,7 +118,6 @@
'order_by' => "ORDER BY $orderby",
'addl_from' => $addl_from,
};
-
my $count_query = "SELECT COUNT(*) FROM svc_hardware $addl_from $extra_sql";
my $link_svc = [ $p.'view/svc_hardware.cgi?', 'svcnum' ];
my $link_cust = [ $p.'view/cust_main.cgi?', 'custnum' ];
Index: report_svc_hardware.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/report_svc_hardware.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- report_svc_hardware.html 29 Apr 2011 08:58:19 -0000 1.2
+++ report_svc_hardware.html 16 Feb 2012 02:13:00 -0000 1.3
@@ -7,15 +7,19 @@
<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',
@@ -71,6 +75,7 @@
include('/elements/select-hardware_type.html',
'field' => 'classnum'.$classnum.'typenum',
'classnum' => $classnum,
+ 'prefix' => $classnum,
'empty_label' => 'any',
);
}
More information about the freeside-commits
mailing list