% unless ( $opt{'js_only'} ) {
% }
<%init>
my( %opt ) = @_;
my $name = $opt{'element_name'} || $opt{'field'} || 'sectornum';
my $id = $opt{'id'} || 'sectornum';
my $curr_value = $opt{'curr_value'} || $opt{'value'};
my $onchange = '';
if ( $opt{'onchange'} ) {
$onchange = $opt{'onchange'};
$onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/;
$onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack. all onchange
#callbacks should act the same
$onchange = 'onChange="'. $onchange. '"';
}
my $tower_sector;
if ( $curr_value ) {
$tower_sector = qsearchs('tower_sector', { 'sectornum' => $curr_value } );
} else {
$tower_sector = new FS::tower_sector {};
}
my %size = ( 'title' => 12 );
tie my %label, 'Tie::IxHash',
'sectorname' => 'Name',
'ip_addr' => 'IP Address',
'height' => 'Height (feet)',
'freq_mhz' => 'Freq. (MHz)',
'direction' => 'Direction (° from north)', # or a button to set these to 0 for omni
'downtilt' => 'Downtilt (° below horizontal)',
'width' => 'Horiz. width (° 0 - 360)',
'v_width' => 'Vert. width (° 0 - 360)',
'sector_range' => 'Range (miles)',
'margin' => 'Signal margin (dB)',
'up_rate_limit' => 'Up rate limit (kbps)',
'down_rate_limit' => 'Down rate limit (kbps)',
;
my @fields = keys %label;
%init>