summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authormark <mark>2011-04-29 08:58:19 +0000
committermark <mark>2011-04-29 08:58:19 +0000
commit91fd4ea0e91ee9e6717e0b12e01eebb8f8b21322 (patch)
tree9d2cb55cb767422e00e6cadd6c91714a77e87943 /httemplate
parent4cd3537f6e3e14a596c67478bb83b2095303ec50 (diff)
svc_dish and svc_hardware fixes, #11454
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/browse/hardware_status.html2
-rw-r--r--httemplate/edit/hardware_status.html24
-rw-r--r--httemplate/edit/svc_dish.cgi5
-rw-r--r--httemplate/edit/svc_hardware.cgi6
-rwxr-xr-xhttemplate/search/report_svc_hardware.html10
-rw-r--r--httemplate/search/svc_hardware.cgi26
-rw-r--r--httemplate/view/svc_dish.cgi5
-rw-r--r--httemplate/view/svc_hardware.cgi2
8 files changed, 65 insertions, 15 deletions
diff --git a/httemplate/browse/hardware_status.html b/httemplate/browse/hardware_status.html
index 9695ed399..89ae83035 100644
--- a/httemplate/browse/hardware_status.html
+++ b/httemplate/browse/hardware_status.html
@@ -2,6 +2,8 @@
'title' => 'Hardware Statuses',
'name' => 'hardware statuses',
'menubar' => $menubar,
+ 'disableable' => 1,
+ 'disabled_statuspos' => 2,
'query' => { 'table' => 'hardware_status', },
'count_query' => 'SELECT COUNT(*) FROM hardware_status',
'header' => [ '#', 'Status' ],
diff --git a/httemplate/edit/hardware_status.html b/httemplate/edit/hardware_status.html
index ee5f25db8..23e5b6eba 100644
--- a/httemplate/edit/hardware_status.html
+++ b/httemplate/edit/hardware_status.html
@@ -1,12 +1,20 @@
<% include( 'elements/edit.html',
- 'name' => 'Hardware Status',
- 'table' => 'hardware_status',
- 'labels' => {
- 'statusnum' => 'Status number',
- 'label' => 'Description' ,
- },
- 'viewall_dir' => 'browse',
- )
+ 'name_singular' => 'Hardware Status',
+ 'table' => 'hardware_status',
+ 'labels' => {
+ 'statusnum' => 'Status number',
+ 'label' => 'Description' ,
+ 'disabled' => 'Disable status'
+ },
+ 'fields' => [
+ 'label',
+ { field => 'disabled',
+ type => 'checkbox',
+ value => 'Y',
+ },
+ ],
+ 'viewall_dir' => 'browse',
+ )
%>
<%init>
diff --git a/httemplate/edit/svc_dish.cgi b/httemplate/edit/svc_dish.cgi
index 77a223933..57df49846 100644
--- a/httemplate/edit/svc_dish.cgi
+++ b/httemplate/edit/svc_dish.cgi
@@ -21,6 +21,11 @@ my @fields = (
label => 'DISH Account #',
},
{
+ field => 'installdate',
+ type => 'input-date-field',
+ label => 'Install date',
+ },
+ {
field => 'note',
type => 'textarea',
rows => 4,
diff --git a/httemplate/edit/svc_hardware.cgi b/httemplate/edit/svc_hardware.cgi
index e6cb22bcb..cde74490e 100644
--- a/httemplate/edit/svc_hardware.cgi
+++ b/httemplate/edit/svc_hardware.cgi
@@ -35,12 +35,18 @@ my @fields = (
label => 'IP address',
},
{
+ field => 'smartcard',
+ type => 'text',
+ label => 'Smartcard #',
+ },
+ {
field => 'statusnum',
type => 'select-table',
table => 'hardware_status',
label => 'Service status',
name_col => 'label',
disable_empty => 1,
+ hashref => { 'disabled' => '' },
},
{
field => 'note',
diff --git a/httemplate/search/report_svc_hardware.html b/httemplate/search/report_svc_hardware.html
index 4a763b0b4..07a6241e3 100755
--- a/httemplate/search/report_svc_hardware.html
+++ b/httemplate/search/report_svc_hardware.html
@@ -20,7 +20,7 @@
<% include('/elements/tr-input-text.html',
'field' => 'serial',
- 'label' => 'Serial #',
+ 'label' => 'Serial number',
) %>
<% include('/elements/tr-input-text.html',
'field' => 'hw_addr',
@@ -30,12 +30,20 @@
'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>
diff --git a/httemplate/search/svc_hardware.cgi b/httemplate/search/svc_hardware.cgi
index ffbb9f3b6..2ff868ef5 100644
--- a/httemplate/search/svc_hardware.cgi
+++ b/httemplate/search/svc_hardware.cgi
@@ -10,6 +10,7 @@
'Serial #',
'Hardware addr.',
'IP addr.',
+ 'Smartcard',
FS::UI::Web::cust_header(),
],
'fields' => [ 'svcnum',
@@ -18,16 +19,19 @@
'serial',
'hw_addr',
'ip_addr',
+ 'smartcard',
\&FS::UI::Web::cust_fields,
],
- 'links' => [ ($link_svc) x 6,
+ 'links' => [ ($link_svc) x 7,
( map { $_ ne 'Cust. Status' ?
$link_cust : '' }
FS::UI::Web::cust_header() )
],
- 'align' => 'rllll' . FS::UI::Web::cust_aligns(),
- 'color' => [ ('') x 4, FS::UI::Web::cust_colors() ],
- 'style' => [ ('') x 4, FS::UI::Web::cust_styles() ],
+ 'align' => 'rllllll' . FS::UI::Web::cust_aligns(),
+ 'color' => [ ('') x 7,
+ FS::UI::Web::cust_colors() ],
+ 'style' => [ $svc_cancel_style, ('') x 6,
+ FS::UI::Web::cust_styles() ],
)
%>
<%init>
@@ -67,6 +71,10 @@ if ( $ip ) {
push @extra_sql, "ip_addr = '".lc($ip->addr)."'";
}
+if ( lc($cgi->param('smartcard')) =~ /^(\w+)$/ ) {
+ push @extra_sql, "LOWER(smartcard) LIKE '%$1%'";
+}
+
if ( $cgi->param('statusnum') =~ /^(\d+)$/ ) {
push @extra_sql, "statusnum = $1";
}
@@ -78,6 +86,10 @@ if ( $cgi->param('classnum') =~ /^(\d+)$/ ) {
}
}
+if ( $cgi->param('svcpart') =~ /^(\d+)$/ ) {
+ push @extra_sql, "cust_svc.svcpart = $1";
+}
+
my ($orderby) = $cgi->param('orderby') =~ /^(\w+( ASC| DESC)?)$/i;
$orderby ||= 'svcnum';
@@ -91,6 +103,7 @@ my $sql_query = {
'part_svc.svc',
'cust_main.custnum',
'hardware_type.model',
+ 'cust_pkg.cancel',
FS::UI::Web::cust_sql_fields(),
),
'hashref' => {},
@@ -103,4 +116,9 @@ 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' ];
+my $svc_cancel_style = sub {
+ my $svc = shift;
+ ( $svc->getfield('cancel') == 0 ) ? '' : 's';
+};
+
</%init>
diff --git a/httemplate/view/svc_dish.cgi b/httemplate/view/svc_dish.cgi
index d4aa8bfdf..768c1372f 100644
--- a/httemplate/view/svc_dish.cgi
+++ b/httemplate/view/svc_dish.cgi
@@ -12,5 +12,8 @@ my %labels = map { $_ => ( ref($fields->{$_})
: $fields->{$_}
);
} keys %$fields;
-my @fields = qw( acctnum note );
+my @fields = ('acctnum',
+ { field => 'installdate', type => 'date' },
+ 'note'
+ );
</%init>
diff --git a/httemplate/view/svc_hardware.cgi b/httemplate/view/svc_hardware.cgi
index 9cea341d7..8201e9db0 100644
--- a/httemplate/view/svc_hardware.cgi
+++ b/httemplate/view/svc_hardware.cgi
@@ -20,5 +20,5 @@ my $status = { field => 'statusnum',
type => 'text',
value => sub { $_[0]->status_label }
};
-my @fields = ($model, qw( serial hw_addr ip_addr ), $status, 'note' );
+my @fields = ($model, qw( serial hw_addr ip_addr smartcard ), $status, 'note' );
</%init>