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';
-
-%init>
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;
+}
+%shared>
<%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 +-