%if ( @devices || $num_part_device || $table eq 'dsl_device' ) {
% my $svcnum = $svc_x->svcnum;
- Devices
+ <FONT CLASS="fsinnerbox-title">Devices</FONT>
(<A HREF="<%$p%>edit/<%$table%>.html?svcnum=<%$svcnum%>">Add device</A>)
<BR>
<& /elements/table-grid.html &>
<TR>
-% if ( $table eq 'phone_device' ) {
+% if ( $table ne 'dsl_device' ) { # ( $table eq 'phone_device' || $table eq 'cable_device' || $table eq 'pbx_device' ) {
<TH CLASS="grid" BGCOLOR="#cccccc">Type</TH>
% }
<TH CLASS="grid" BGCOLOR="#cccccc">MAC Addr</TH>
% 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>
+ <% $td %><% $device->mac_addr_pretty %>
+ (<% (Net::MAC::Vendor::lookup($device->mac_addr_formatted('U',':')))->[0] %>)
+ </TD>
<% $td %><% $export_links %></TD>
<% $td %>(
% unless ( $opt{'no_edit'} ) {
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;
$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()
+ : ();
</%init>