X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Ffiber_olt.pm;h=e26e829ea88b2734ea5ddbe148dffecf2300d120;hb=208cc650f3e441400d88f738cb4af78809497aa5;hp=d083e9eb6651498386ec247545655c8ba28eb20d;hpb=0fc158f576b404002225284b5dfc1634502f7569;p=freeside.git diff --git a/FS/FS/fiber_olt.pm b/FS/FS/fiber_olt.pm index d083e9eb6..e26e829ea 100644 --- a/FS/FS/fiber_olt.pm +++ b/FS/FS/fiber_olt.pm @@ -4,6 +4,7 @@ use base qw( FS::Record ); use strict; use FS::Record qw( qsearch qsearchs ); use FS::svc_fiber; +use FS::olt_site; =head1 NAME @@ -38,6 +39,8 @@ FS::Record. The following fields are currently supported: =item serial - serial number +=item sitenum - the L where this OLT is installed + =item disabled - set to 'Y' to make this OLT unavailable for new connections =back @@ -88,6 +91,7 @@ sub check { $self->ut_numbern('oltnum') || $self->ut_text('oltname') || $self->ut_text('serial') + || $self->ut_foreign_keyn('sitenum', 'olt_site', 'sitenum') || $self->ut_flag('disabled') ; return $error if $error; @@ -95,6 +99,32 @@ sub check { $self->SUPER::check; } +=item site_description + +Returns the OLT's site description. + +=cut + +sub site_description { + my $self = shift; + return '' if !$self->sitenum; + my $olt_site = FS::olt_site->by_key($self->sitenum); + return $olt_site->description; +} + +=item description + +Returns the OLT's site name and unit name. + +=cut + +sub description { + my $self = shift; + my $desc = $self->oltname; + $desc = $self->site_description . '/' . $desc if $self->sitenum; + return $desc; +} + # 3.x stub sub svc_fiber { @@ -106,7 +136,7 @@ sub svc_fiber { =head1 SEE ALSO -L, L +L, L, L =cut