From 04f53daab621710db56b075e1aaf56e7c52f9ba9 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Mon, 10 Oct 2016 23:54:05 -0700 Subject: export tower/sector data to TowerCoverage API, #39776 --- httemplate/edit/process/tower.html | 3 +- httemplate/elements/tr-tower_sector.html | 24 -------------- httemplate/elements/tr-tower_sectors.html | 54 ++++++++++++++++++++++++++++--- httemplate/search/tower-map.html | 15 +++++++++ 4 files changed, 67 insertions(+), 29 deletions(-) delete mode 100644 httemplate/elements/tr-tower_sector.html (limited to 'httemplate') diff --git a/httemplate/edit/process/tower.html b/httemplate/edit/process/tower.html index 588a68e8d..cfbb4ffa3 100644 --- a/httemplate/edit/process/tower.html +++ b/httemplate/edit/process/tower.html @@ -4,7 +4,8 @@ process_o2m => { 'table' => 'tower_sector', 'fields' => [qw( sectorname ip_addr height freq_mhz direction width - downtilt v_width db_high db_low + downtilt v_width db_high db_low power line_loss + antenna_gain hardware_typenum sector_range )], }, diff --git a/httemplate/elements/tr-tower_sector.html b/httemplate/elements/tr-tower_sector.html deleted file mode 100644 index 871c7fd9c..000000000 --- a/httemplate/elements/tr-tower_sector.html +++ /dev/null @@ -1,24 +0,0 @@ -% unless ( $opt{'js_only'} ) { - - <% include('tr-td-label.html', %opt) %> - > - -% } -% - <% include( '/elements/sector.html', %opt ) %> -% -% unless ( $opt{'js_only'} ) { - - - - -% } -<%init> - -my( %opt ) = @_; - -my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; - -$opt{'label'} ||= 'Sector'; - - diff --git a/httemplate/elements/tr-tower_sectors.html b/httemplate/elements/tr-tower_sectors.html index 4e8f3fb47..106fc76f6 100644 --- a/httemplate/elements/tr-tower_sectors.html +++ b/httemplate/elements/tr-tower_sectors.html @@ -1,3 +1,11 @@ +<%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; +} + <%init> my %opt = @_; my $tower = $opt{'object'}; @@ -7,8 +15,9 @@ my $cgi = $opt{'cgi'}; my $tabcounter = 0; my @fields = qw( - sectorname ip_addr height freq_mhz direction width tilt v_width db_high - db_low sector_range + sectorname ip_addr height freq_mhz direction width downtilt v_width + db_high db_low sector_range + power line_loss antenna_gain hardware_typenum ); my @sectors; @@ -74,6 +83,11 @@ my $id = $opt{id} || $opt{field} || 'sectornum'; border: none; text-align: left; } + .ui-tabs p { + margin-top: 8px; + margin-bottom: 8px; + } + @@ -216,6 +230,38 @@ $(function() {

+ + + <% 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 +

-

+
<% emt('dB (low quality)') %> -
+
diff --git a/httemplate/search/tower-map.html b/httemplate/search/tower-map.html index 559d83d08..d87e19ea6 100755 --- a/httemplate/search/tower-map.html +++ b/httemplate/search/tower-map.html @@ -8,6 +8,9 @@ html { height: 100% } span.is_up { font-weight: bold; color: green } span.is_down { font-weight: bold; color: red } #search_location { width: 300px } + +.sector_list li { list-style: none } +.sector_list li a { width: 150px }
@@ -300,4 +303,16 @@ Tower #<% $tower->towernum %> | <% $tower->towername %>
<% emt('Show coverage') %> + -- cgit v1.2.1