1 <& /elements/header.html, 'Towers and sectors' &>
3 <script type="text/javascript">
5 var toggles = $('ul.tower_sector_list input[type=checkbox]');
6 toggles.on('click', function() {
9 <& elements/gmap.html, features => \@features, overlays => \@overlays &>
11 <& /elements/footer.html &>
14 die "access denied" unless
15 $FS::CurrentUser::CurrentUser->access_right('Configuration');
17 my $conf = new FS::Conf;
19 my @features; # geoJSON structure
26 foreach my $tower (qsearch('towers', {})) {
27 my $towernum = $tower->towernum;
28 $towers{$towernum} = $tower;
29 next if !$tower->latitude or !$tower->longitude;
31 $tower_coord{$towernum} =
32 [ $tower->longitude + 0,
34 ($tower->altitude || 0) + 0,
37 # should figure out bounds to include coverage areas
41 id => 'tower/'.$towernum,
44 coordinates => $tower_coord{$towernum},
50 url => $fsurl.'images/jcartier-antenna-square-21x51.png',
51 anchor => { x => 10, y => 4 }
54 content => include('.tower', $tower),
55 bounds => $tower_bounds{$towernum},
59 # XXX show sector coverage zones
60 } # foreach $svc_broadband
66 % my $can_edit = $FS::CurrentUser::CurrentUser->access_right('Configuration');
69 % # XXX open within the InfoWindow, or at least in a popup
70 <a target="_blank" href="<% $fsurl %>edit/tower.html?<% $tower->towernum %>">
72 Tower #<% $tower->towernum %> | <% $tower->towername %>
77 <ul class="tower_sector_list">
78 % foreach my $sector ($tower->tower_sector) { # default sector?
80 <input type="checkbox" value="<% $sector->sectornum %>">
81 <% $sector->sectorname %>