%shared> # kind of a hack... my ($export) = FS::tower_sector->part_export; my $antenna_types; # will be an ordered hash if ($export and $export->can('get_antenna_types')) { $antenna_types = $export->get_antenna_types; } %shared> <%init> my %opt = @_; my $tower = $opt{'object'}; my $towernum = $tower->towernum; my $cgi = $opt{'cgi'}; my $tabcounter = 0; my @fields = qw( sectorname ip_addr height freq_mhz direction width downtilt v_width db_high db_low sector_range power line_loss antenna_gain hardware_typenum up_rate_limit down_rate_limit ); my @sectors; if ( $cgi->param('error') ) { foreach my $k ($cgi->param) { if ($k =~ /^sectornum\d+$/) { my $sectornum = $cgi->param($k); my $sector = FS::tower_sector->new({ 'sectornum' => $sectornum, 'towernum' => $towernum, map { $_ => scalar($cgi->param($k.'_'.$_)) } @fields, }); push @sectors, $sector if length($sector->sectorname); } } } elsif ( $towernum ) { @sectors = $tower->tower_sector; } # else new mode, no sectors yet my $id = $opt{id} || $opt{field} || 'sectornum'; %init> <& tablebreak-tr-title.html, value => 'Sectors' &>
<% emt('feet above ground') %>
° °
<% emt('MHz') %>
<% emt('dBm') %>
<% emt('dB antenna gain') %>
<% emt('dB line loss') %>
% if ( $antenna_types ) {
<& /elements/select.html, field => $id.'_hardware_typenum', options => [ '', keys %$antenna_types ], labels => $antenna_types, curr_value => $sector->hardware_typenum, &>
% } % # this next section might not be necessary if you enter an antenna type° °