X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Frouter.pm;h=7a9fda398e53f7ac71f222a803f5e0dead0f2cef;hp=3f9459a0131672f865bcd2bd688af3aa9fea34d6;hb=20f38e4c256094bd938b732950e8f93319f851a5;hpb=0354f39ed0e74fd2eae1d9da13906625b4f56591 diff --git a/FS/FS/router.pm b/FS/FS/router.pm index 3f9459a01..7a9fda398 100755 --- a/FS/FS/router.pm +++ b/FS/FS/router.pm @@ -5,7 +5,7 @@ use vars qw( @ISA ); use FS::Record qw( qsearchs qsearch ); use FS::addr_block; -@ISA = qw( FS::Record ); +@ISA = qw( FS::Record FS::m2m_Common ); =head1 NAME @@ -82,10 +82,12 @@ sub check { my $error = $self->ut_numbern('routernum') - || $self->ut_text('routername'); + || $self->ut_text('routername') + || $self->ut_agentnum_acl('agentnum', 'Broadband global configuration') + ; return $error if $error; - ''; + $self->SUPER::check; } =item addr_block @@ -100,18 +102,6 @@ sub addr_block { return qsearch('addr_block', { routernum => $self->routernum }); } -=item router_field - -Returns a list of FS::router_field objects assigned to this object. - -=cut - -sub router_field { - my $self = shift; - - return qsearch('router_field', { routernum => $self->routernum }); -} - =item part_svc_router Returns a list of FS::part_svc_router objects associated with this @@ -137,17 +127,23 @@ sub part_svc { $self->part_svc_router; } -=back +=item agent -=head1 VERSION +Returns the agent associated with this router, if any. + +=cut -$Id: +sub agent { + qsearchs('agent', { 'agentnum' => shift->agentnum }); +} + +=back =head1 BUGS =head1 SEE ALSO -FS::svc_broadband, FS::router, FS::addr_block, FS::router_field, FS::part_svc, +FS::svc_broadband, FS::router, FS::addr_block, FS::part_svc, schema.html from the base documentation. =cut