X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Ftower.html;h=e35fa615cfebe1d8ce5d1ffcb8f3fd7481d59aca;hb=2f6f9c28f41be0f92139fb5593df61040cb31b17;hp=fa3838dcf27a6902ab0a4130acb7e68b462c1dc7;hpb=dba6b1030a2694cbb69371c171e4ebb8c52db830;p=freeside.git diff --git a/httemplate/edit/tower.html b/httemplate/edit/tower.html index fa3838dcf..e35fa615c 100644 --- a/httemplate/edit/tower.html +++ b/httemplate/edit/tower.html @@ -12,10 +12,13 @@ 'altitude', 'height', 'veg_height', + 'up_rate_limit', + 'down_rate_limit', { field => 'sectornum', type => 'tower_sector', o2m_table => 'tower_sector', m2_label => 'Sector', + m2_label_callback => sub { 'Sector #'.shift->sectornum; }, m2_error_callback => $m2_error_callback, }, ], @@ -26,10 +29,12 @@ 'default_ip_addr' => 'Tower IP address', 'latitude' => 'Latitude', 'longitude' => 'Longitude', - 'altitude' => 'Altitude', - 'height' => 'Height', - 'veg_height' => 'Vegetation height', + 'altitude' => 'Altitude (feet)', + 'height' => 'Height (feet)', + 'veg_height' => 'Vegetation height (feet)', 'color' => 'Color', + 'up_rate_limit' => 'Up Rate Limit(Kbps)', + 'down_rate_limit' => 'Down Rate Limit(Kbps)', }, &> <%init> @@ -38,19 +43,24 @@ my $m2_error_callback = sub { # reconstruct the list my ($cgi, $object) = @_; my @fields = qw( - sectorname ip_addr height freq_mhz direction width sector_range + sectorname ip_addr height freq_mhz direction width tilt v_width margin + sector_range up_rate_limit down_rate_limit ); - map { - my $k = $_; - new FS::tower_sector { - 'towernum' => $object->towernum, - 'sectornum' => scalar( $cgi->param($k) ), - map { $_ => scalar( $cgi->param($k.'_'.$_) ) } @fields, - }; - } grep length($cgi->param($_.'_sectorname')), - grep /^sectornum\d+$/, - ($cgi->param); + my @sectors; + foreach my $k ($cgi->param) { + if ($k =~ /^sectornum\d+$/) { + my $sectornum = $cgi->param($k); + my $sector = FS::tower_sector->new({ + 'sectornum' => $sectornum, + 'towernum' => $object->towernum, + map { $_ => scalar($cgi->param($k.'_'.$_)) } @fields, + }); + push @sectors, $sector if length($sector->sectorname) && $sector->sectorname ne '_default'; + } + } + + return @sectors; }; my $default_ip_addr_callback = sub {