From a97e5cbca3e7b9e7d59ecbe34057426b2ff7b34d Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 14 May 2013 00:28:55 -0700 Subject: svc_cable (2.3 backport), RT#22009 Conflicts: FS/FS/access_right.pm FS/MANIFEST httemplate/docs/part_svc-table.html httemplate/view/svc_phone.cgi --- httemplate/view/elements/svc_Common.html | 5 +++++ httemplate/view/elements/svc_devices.html | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'httemplate/view/elements') diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html index 2d1201b51..e5cf9f6ca 100644 --- a/httemplate/view/elements/svc_Common.html +++ b/httemplate/view/elements/svc_Common.html @@ -106,6 +106,11 @@ function areyousure(href) {
+<& svc_devices.html, + 'svc_x' => $svc_x, + 'table' => $svc_x->device_table, +&> + % if ( defined($opt{'html_foot'}) ) { <% ref($opt{'html_foot'}) diff --git a/httemplate/view/elements/svc_devices.html b/httemplate/view/elements/svc_devices.html index 38c6d0919..745eabd9d 100644 --- a/httemplate/view/elements/svc_devices.html +++ b/httemplate/view/elements/svc_devices.html @@ -30,7 +30,7 @@ <& /elements/table-grid.html &> -% if ( $table eq 'phone_device' ) { +% if ( $table eq 'phone_device' || $table eq 'cable_device' ) { Type % } MAC Addr @@ -58,7 +58,8 @@ % if $device->can('export_links'); -% if ( $table eq 'phone_device' ) { #$devices->can('part_device') +% #$devices->can('part_device') +% if ( $table eq 'phone_device' || $svc_x->isa('FS::device_Common') ) { <% $td %><% $device->part_device->devicename |h %> % } <% $td %><% $device->mac_addr %> @@ -84,7 +85,7 @@ my $table = $opt{'table'}; #part_device, dsl_device my $svc_x = $opt{'svc_x'}; my $num_part_device = 0; -if ( $table eq 'phone_device' ) { +if ( $table eq 'phone_device' || $table eq 'cable_device' ) { my $sth = dbh->prepare("SELECT COUNT(*) FROM part_device") #WHERE disabled = '' OR disabled IS NULL;"); or die dbh->errstr; @@ -92,6 +93,7 @@ if ( $table eq 'phone_device' ) { $num_part_device = $sth->fetchrow_arrayref->[0]; } -my @devices = $svc_x->$table(); +my @devices = $svc_x->isa('FS::device_Common') ? $svc_x->device_objects() + : $svc_x->$table(); -- cgit v1.2.1