summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-11-17 21:52:29 -0800
committerIvan Kohler <ivan@freeside.biz>2013-11-17 21:52:29 -0800
commitc2c351d0bf1e8c930290510c0ffcf3d455dad871 (patch)
treeb89c15bcd8a59f2fb37d3a11e1da0a27d669ff29
parent952fcd191c3a6f12dfc4da510441460fcb93b0a8 (diff)
svc_cable label, RT#26013
-rwxr-xr-xFS/FS/svc_broadband.pm19
-rw-r--r--FS/FS/svc_cable.pm20
2 files changed, 21 insertions, 18 deletions
diff --git a/FS/FS/svc_broadband.pm b/FS/FS/svc_broadband.pm
index 6073902e8..b9c89cef7 100755
--- a/FS/FS/svc_broadband.pm
+++ b/FS/FS/svc_broadband.pm
@@ -3,6 +3,7 @@ use base qw(
FS::svc_Radius_Mixin
FS::svc_Tower_Mixin
FS::svc_IP_Mixin
+ FS::svc_MAC_Mixin
FS::svc_Common
);
@@ -262,7 +263,7 @@ sub smart_search {
=item label
-Returns the IP address.
+Returns the IP address, MAC address and description.
=cut
@@ -419,22 +420,6 @@ sub _check_duplicate {
'';
}
-=item mac_addr_formatted CASE DELIMITER
-
-Format the MAC address (for use by exports). If CASE starts with "l"
-(for "lowercase"), it's returned in lowercase. DELIMITER is inserted
-between octets.
-
-=cut
-
-sub mac_addr_formatted {
- my $self = shift;
- my ($case, $delim) = @_;
- my $addr = $self->mac_addr;
- $addr = lc($addr) if $case =~ /^l/i;
- join( $delim || '', $addr =~ /../g );
-}
-
#class method
sub _upgrade_data {
my $class = shift;
diff --git a/FS/FS/svc_cable.pm b/FS/FS/svc_cable.pm
index 672a34d7b..4b4239389 100644
--- a/FS/FS/svc_cable.pm
+++ b/FS/FS/svc_cable.pm
@@ -1,5 +1,7 @@
package FS::svc_cable;
-use base qw( FS::svc_Common ); #qw( FS::device_Common FS::svc_Common );
+use base qw( FS::svc_MAC_Mixin
+ FS::svc_Common
+ ); #FS::device_Common
use strict;
use Tie::IxHash;
@@ -115,6 +117,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,