X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Felements%2Fsvc_devices.html;h=c9f5eda781a3107cf4c9ae8914429a6e274fe80f;hp=38c6d091918047e779d0b837a7b2cbda9e95b0e6;hb=f3ac48703be75c0e2aec161487057eafeb8fc74f;hpb=f3e0ac2b009c4edd5692cb587ff709dac2223ebe diff --git a/httemplate/view/elements/svc_devices.html b/httemplate/view/elements/svc_devices.html index 38c6d0919..c9f5eda78 100644 --- a/httemplate/view/elements/svc_devices.html +++ b/httemplate/view/elements/svc_devices.html @@ -15,7 +15,7 @@ %if ( @devices || $num_part_device || $table eq 'dsl_device' ) { % my $svcnum = $svc_x->svcnum; - Devices + Devices (Add device)
@@ -30,7 +30,7 @@ <& /elements/table-grid.html &> -% if ( $table eq 'phone_device' ) { +% if ( $table ne 'dsl_device' ) { # ( $table eq 'phone_device' || $table eq 'cable_device' || $table eq 'pbx_device' ) { Type % } MAC Addr @@ -58,10 +58,11 @@ % 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 %> + <% $td %><% $device->mac_addr_pretty %> <% $td %><% $export_links %> <% $td %>( % unless ( $opt{'no_edit'} ) { @@ -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 ne 'dsl_device' ) { # ( $table eq 'phone_device' || $table eq 'cable_device' || $table eq 'pbx_device' ) { my $sth = dbh->prepare("SELECT COUNT(*) FROM part_device") #WHERE disabled = '' OR disabled IS NULL;"); or die dbh->errstr; @@ -92,6 +93,8 @@ 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() + : $table ? $svc_x->$table() + : ();