1 % unless ( $opt{'js_only'} ) {
3 <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>">
7 % foreach my $field ( @fields ) {
11 NAME = "<%$name%>_<%$field%>"
12 ID = "<%$id%>_<%$field%>"
13 SIZE = "<% $size{$field} || 15 %>"
14 VALUE = "<% scalar($cgi->param($name."_$field"))
15 || $tower_sector->get($field) |h %>"
18 <FONT SIZE="-1"><% $label{$field} %></FONT>
30 my $name = $opt{'element_name'} || $opt{'field'} || 'sectornum';
31 my $id = $opt{'id'} || 'sectornum';
33 my $curr_value = $opt{'curr_value'} || $opt{'value'};
36 if ( $opt{'onchange'} ) {
37 $onchange = $opt{'onchange'};
38 $onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/;
39 $onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack. all onchange
40 #callbacks should act the same
41 $onchange = 'onChange="'. $onchange. '"';
46 $tower_sector = qsearchs('tower_sector', { 'sectornum' => $curr_value } );
48 $tower_sector = new FS::tower_sector {};
51 my %size = ( 'title' => 12 );
53 tie my %label, 'Tie::IxHash',
54 'sectorname' => 'Name',
55 'ip_addr' => 'IP Address',
57 'freq_mhz' => 'Freq. (MHz)',
58 'direction' => 'Direction', # or a button to set these to 0 for omni
60 'sector_range' => 'Range',
63 my @fields = keys %label;