X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Ftower.html;h=b8fce52eb9a1851588cdf9a48cfcf7ee37c58c7a;hb=f48ffc61601d08024aeff19ecd07d7420fc4e5b3;hp=dfebc0031ef9bb83288dae536a6c2e71f4d93dfb;hpb=ec34b8903d969fe8ac4ff6947a92e16e07f71fa0;p=freeside.git diff --git a/httemplate/edit/tower.html b/httemplate/edit/tower.html index dfebc0031..b8fce52eb 100644 --- a/httemplate/edit/tower.html +++ b/httemplate/edit/tower.html @@ -19,6 +19,7 @@ # type => 'tower_sector', # o2m_table => 'tower_sector', # m2_label => 'Sector', +# m2_label_callback => sub { 'Sector #'.shift->sectornum; }, # m2_error_callback => $m2_error_callback, # }, { type => 'tower_sectors', @@ -50,16 +51,20 @@ my $m2_error_callback = sub { # reconstruct the list sectorname ip_addr height freq_mhz direction width tilt v_width db_high db_low 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 {