svc_pbx devices, for RT#24968
[freeside.git] / FS / FS / svc_cable.pm
index 672a34d..12a1dbb 100644 (file)
@@ -1,11 +1,10 @@
 package FS::svc_cable;
-use base qw( FS::svc_Common ); #qw( FS::device_Common FS::svc_Common );
+use base qw( FS::MAC_Mixin
+             FS::svc_Common
+           ); #FS::device_Common
 
 use strict;
 use Tie::IxHash;
-use FS::Record qw( qsearchs ); # qw( qsearch qsearchs );
-use FS::cable_provider;
-use FS::cable_model;
 
 =head1 NAME
 
@@ -115,6 +114,22 @@ sub table_info {
   };
 }
 
+=item label
+
+Returns the MAC address and serial number.
+
+=cut
+
+sub label {
+  my $self = shift;
+  my @label = ();
+  push @label, 'MAC:'. $self->mac_addr_pretty
+    if $self->mac_addr;
+  push @label, 'Serial#'. $self->serialnum
+    if $self->serialnum;
+  return join(', ', @label);
+}
+
 =item insert
 
 Adds this record to the database.  If there is an error, returns the error,
@@ -157,24 +172,10 @@ sub check {
 
 Returns the cable_provider object for this record.
 
-=cut
-
-sub cable_provider {
-  my $self = shift;
-  qsearchs('cable_provider', { 'providernum'=>$self->providernum } );
-}
-
 =item cable_model
 
 Returns the cable_model object for this record.
 
-=cut
-
-sub cable_model {
-  my $self = shift;
-  qsearchs('cable_model', { 'modelnum'=>$self->modelnum } );
-}
-
 =back
 
 =head1 BUGS