diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2013-05-14 00:28:33 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2013-05-14 00:28:33 -0700 |
| commit | 7c41eea8dca02a399739c29a0dfbda7efdd6df86 (patch) | |
| tree | dcbd7f399dffcb899b64f18a00d49cb8d9034c4b /httemplate/view | |
| parent | 7a33a40d9f17d73e7f14410070675da02e25ad5e (diff) | |
svc_cable, RT#22009
Diffstat (limited to 'httemplate/view')
| -rw-r--r-- | httemplate/view/elements/svc_Common.html | 5 | ||||
| -rw-r--r-- | httemplate/view/elements/svc_devices.html | 10 | ||||
| -rw-r--r-- | httemplate/view/svc_phone.cgi | 1 |
3 files changed, 12 insertions, 4 deletions
diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html index 997ac142a..3c1cc66fa 100644 --- a/httemplate/view/elements/svc_Common.html +++ b/httemplate/view/elements/svc_Common.html @@ -119,6 +119,11 @@ function areyousure(href) { <BR> +<& 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 &> <TR> -% if ( $table eq 'phone_device' ) { +% if ( $table eq 'phone_device' || $table eq 'cable_device' ) { <TH CLASS="grid" BGCOLOR="#cccccc">Type</TH> % } <TH CLASS="grid" BGCOLOR="#cccccc">MAC Addr</TH> @@ -58,7 +58,8 @@ % if $device->can('export_links'); <TR> -% 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> % } <% $td %><% $device->mac_addr %></TD> @@ -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(); </%init> diff --git a/httemplate/view/svc_phone.cgi b/httemplate/view/svc_phone.cgi index ed95c4cea..408364aeb 100644 --- a/httemplate/view/svc_phone.cgi +++ b/httemplate/view/svc_phone.cgi @@ -67,6 +67,7 @@ my $html_foot = sub { ### # Devices ### + #remove this when svc_phone isa device_Common, as elements/svc_Common will display it my $devices = include('/view/elements/svc_devices.html', 'svc_x' => $svc_phone, 'table' => 'phone_device', |
