X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fsvc_broadband.pm;h=35de8b3d94c50e05efa88cf76fc2aabf896fdff4;hp=ad7dedcdd62ddf5513f71159d291e56f256c54e8;hb=573139dbd6c37808697bfa72a3a468bb0980d4dd;hpb=7aef2e455fe8a4722036f231ee8609ac63b2a9c9 diff --git a/FS/FS/svc_broadband.pm b/FS/FS/svc_broadband.pm index ad7dedcdd..35de8b3d9 100755 --- a/FS/FS/svc_broadband.pm +++ b/FS/FS/svc_broadband.pm @@ -2,12 +2,13 @@ package FS::svc_broadband; use strict; use vars qw(@ISA $conf); +use NetAddr::IP; use FS::Record qw( qsearchs qsearch dbh ); use FS::svc_Common; use FS::cust_svc; use FS::addr_block; use FS::part_svc_router; -use NetAddr::IP; +use FS::tower_sector; @ISA = qw( FS::svc_Radius_Mixin FS::svc_Common ); @@ -95,8 +96,10 @@ sub table_info { 'longname_plural' => 'Fixed (username-less) broadband services', 'display_weight' => 50, 'cancel_weight' => 70, + 'ip_field' => 'ip_addr', 'fields' => { - 'description' => 'Descriptive label for this particular device.', + 'svcnum' => 'Service', + 'description' => 'Descriptive label for this particular device', 'speed_down' => 'Maximum download speed for this service in Kbps. 0 denotes unlimited.', 'speed_up' => 'Maximum upload speed for this service in Kbps. 0 denotes unlimited.', 'ip_addr' => 'IP address. Leave blank for automatic assignment.', @@ -347,12 +350,18 @@ sub check { my $lat_lower = $nw_coords ? 1 : -90; my $lon_upper = $nw_coords ? -1 : 180; + # remove delimiters + my $mac_addr = uc($self->get('mac_addr')); + $mac_addr =~ s/[-: ]//g; + $self->set('mac_addr', $mac_addr); + my $error = $self->ut_numbern('svcnum') || $self->ut_numbern('blocknum') + || $self->ut_foreign_keyn('sectornum', 'tower_sector', 'sectornum') || $self->ut_textn('description') - || $self->ut_number('speed_up') - || $self->ut_number('speed_down') + || $self->ut_numbern('speed_up') + || $self->ut_numbern('speed_down') || $self->ut_ipn('ip_addr') || $self->ut_hexn('mac_addr') || $self->ut_hexn('auth_key') @@ -472,6 +481,16 @@ sub NetAddr { new NetAddr::IP ($self->ip_addr); } +=item tower_sector + +=cut + +sub tower_sector { + my $self = shift; + return '' unless $self->sectornum; + qsearchs('tower_sector', { sectornum => $self->sectornum }); +} + =item addr_block Returns the FS::addr_block record (i.e. the address block) for this broadband service.