X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Ftower.html;h=7f096a74865fde78b7a51230438ad5ee581c0670;hb=49fc33db77d202f175a4d8a33e3eab1e52080a4d;hp=0de3b324cdb444600409e868373d8bbb2795821a;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;p=freeside.git diff --git a/httemplate/browse/tower.html b/httemplate/browse/tower.html index 0de3b324c..7f096a748 100644 --- a/httemplate/browse/tower.html +++ b/httemplate/browse/tower.html @@ -8,9 +8,10 @@ 'count_query' => 'SELECT COUNT(*) FROM tower', 'disableable' => 1, 'disabled_statuspos' => 1, - 'header' => [ 'Name', 'Sectors', ], + 'header' => [ 'Name', 'Sectors', 'Coordinates'], 'fields' => [ $tower_sub, $sector_sub, + $coord_sub, ], 'links' => [ ], ) @@ -22,6 +23,7 @@ die "access denied" my $num_svc_links = sub { my ($query_string, $sectors) = @_; + return if !$sectors; my $num_svc_broadband = FS::svc_broadband->count("sectornum IN($sectors)"); my $num_svc_acct = FS::svc_acct->count("sectornum IN($sectors)"); @@ -48,9 +50,24 @@ 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, }, + { '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, },