X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Ftower.html;h=555b8a39f955d434e942324e704905f9cc426d2f;hb=a6c5bd2d56ad177a8f79ac0aa5c88b389513dc82;hp=82eb872b18945c89faaaffa36c22afc7db05474c;hpb=8e4c66cfb8aaf0aee2d1142636e53d0e17d11d4f;p=freeside.git diff --git a/httemplate/browse/tower.html b/httemplate/browse/tower.html index 82eb872b1..555b8a39f 100644 --- a/httemplate/browse/tower.html +++ b/httemplate/browse/tower.html @@ -1,25 +1,35 @@ -<% include( 'elements/browse.html', - 'title' => 'Towers', - 'name' => 'towers', - 'menubar' => [ 'Add a new tower' => - $p.'edit/tower.html', - ], - 'query' => { 'table' => 'tower', }, - 'count_query' => 'SELECT COUNT(*) FROM tower', - 'disableable' => 1, - 'disabled_statuspos' => 1, - 'header' => [ 'Name', 'Sectors', ], - 'fields' => [ $tower_sub, - $sector_sub, - ], - 'links' => [ ], - ) -%> +<& elements/browse.html, + 'title' => 'Towers', + 'name' => 'towers', + 'menubar' => [ 'Add a new tower' => + $p.'edit/tower.html', + #'Sector coverage maps' => + # $p.'search/sector.html', + 'Tower map' => + $p.'search/tower-map.html', + 'Download CSV for towercoverage.com' => + $p.'misc/tower-export.html?format=tc' + ], + 'query' => { 'table' => 'tower', }, + 'count_query' => 'SELECT COUNT(*) FROM tower', + 'disableable' => 1, + 'disabled_statuspos' => 1, + 'header' => [ 'Name', 'Location', 'Sectors', ], + 'fields' => [ $tower_sub, + $coord_sub, + $sector_sub, + ], + 'links' => [ ], + 'cell_style' => [ $tagdesc_style ], +&> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); +#false laziness w/ browse/part_tag.html +my $tagdesc_style = sub { 'background-color:#'.shift->color }; + my $num_svc_links = sub { my ($query_string, $sectors) = @_; return if !$sectors; @@ -49,12 +59,32 @@ my $num_svc_links = sub { }, }; +my $coord_sub = sub { + my $tower = shift; + + my $coords = $m->scomp("/elements/coord-links.html", $tower->latitude, $tower->longitude, $tower->towername); + + [ + [ + { 'data' => "Latitude: ". $tower->latitude. + "
Longitude: ". $tower->longitude. + "
Altitude: ". $tower->altitude. + "
Height: ". $tower->height. + "
Veg. height: ". $tower->veg_height, + }, + { 'data' => $coords, 'link' => "Coordinates", }, + ], + ] +}; + my $tower_sub = sub { my $tower = shift; - my $sectors = join(',', map { $_->sectornum } $tower->tower_sector); + my $sectors = join(',', + map { $_->sectornum } $tower->tower_sector, $tower->default_sector + ); [ #rows [ - { 'data' => $tower->towername, }, + { 'data' => $tower->towername. ' ', }, { 'data' => ' (edit) ', size => '-1', 'link' => $p.'edit/tower.html?' . $tower->towernum }, ], @@ -73,7 +103,7 @@ my $sector_sub = sub { my $sectornum = $sector->sectornum; [ { - 'data' => $sector->sectorname, + 'data' => $sector->sectorname. ' ', 'link' => ( $sector->ip_addr ? 'http://'. $sector->ip_addr : '' ), },