RT# 82137 - default payment amount now has processing fee in total if processing...
[freeside.git] / httemplate / elements / tower_sector.html
1 % unless ( $opt{'js_only'} ) {
2
3   <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>">
4
5   <TABLE>
6     <TR>
7 %     foreach my $field ( @fields ) {
8
9         <TD>
10           <INPUT TYPE  = "text"
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 %>"
16                  <% $onchange %>
17           ><BR>
18           <FONT SIZE="-1"><% $label{$field} %></FONT>
19         </TD>
20 %     }
21     </TR>
22   </TABLE>
23
24
25 % }
26 <%init>
27
28 my( %opt ) = @_;
29
30 my $name = $opt{'element_name'} || $opt{'field'} || 'sectornum';
31 my $id = $opt{'id'} || 'sectornum';
32
33 my $curr_value = $opt{'curr_value'} || $opt{'value'};
34
35 my $onchange = '';
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. '"';
42 }
43
44 my $tower_sector;
45 if ( $curr_value ) {
46   $tower_sector = qsearchs('tower_sector', { 'sectornum' => $curr_value } );
47 } else {
48   $tower_sector = new FS::tower_sector {};
49 }
50
51 my %size = ( 'title' => 12 );
52
53 tie my %label, 'Tie::IxHash',
54   'sectorname'   => 'Name',
55   'ip_addr'      => 'IP Address',
56   'height'       => 'Height (feet)',
57   'freq_mhz'     => 'Freq. (MHz)',
58   'direction'    => 'Direction (&deg; from north)', # or a button to set these to 0 for omni
59   'downtilt'     => 'Downtilt (&deg; below horizontal)',
60   'width'        => 'Horiz. width (&deg; 0 - 360)',
61   'v_width'      => 'Vert. width (&deg; 0 - 360)',
62   'sector_range' => 'Range (miles)',
63   'margin'       => 'Signal margin (dB)',
64   'up_rate_limit' => 'Up rate limit (kbps)',
65   'down_rate_limit' => 'Down rate limit (kbps)',
66 ;
67
68 my @fields = keys %label;
69
70 </%init>