X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Ftower.html;h=93b7235b7ea6caa5d4da563950f566a8eefe8ca8;hb=635874f1ea13ab971d2f8b95bfd0ca25eed0aaef;hp=660788849a2aba61a9211ec470f641c907aa8e38;hpb=0b8b48e7c6306be3b7418cb23e8318317d041caf;p=freeside.git diff --git a/httemplate/edit/tower.html b/httemplate/edit/tower.html index 660788849..93b7235b7 100644 --- a/httemplate/edit/tower.html +++ b/httemplate/edit/tower.html @@ -12,8 +12,8 @@ 'altitude', 'height', 'veg_height', - 'up_rate', - 'down_rate', + 'up_rate_limit', + 'down_rate_limit', { field => 'sectornum', type => 'tower_sector', o2m_table => 'tower_sector', @@ -32,8 +32,8 @@ 'height' => 'Height (feet)', 'veg_height' => 'Vegetation height (feet)', 'color' => 'Color', - 'up_rate' => 'Up Rate (Kbps)', - 'down_rate' => 'Down Rate (Kbps)', + 'up_rate_limit' => 'Up Rate Limit(Kbps)', + 'down_rate_limit' => 'Down Rate Limit(Kbps)', }, &> <%init> @@ -43,19 +43,23 @@ my $m2_error_callback = sub { # reconstruct the list my @fields = qw( sectorname ip_addr height freq_mhz direction width tilt v_width margin - sector_range up_rate down_rate + 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 {