'tower' => {
'columns' => [
- 'towernum', 'serial', '', '', '', '',
- #'agentnum', 'int', 'NULL', '', '', '',
- 'towername', 'varchar', '', $char_d, '', '',
- 'disabled', 'char', 'NULL', 1, '', '',
- 'latitude', 'decimal', 'NULL', '10,7', '', '',
- 'longitude','decimal', 'NULL', '10,7', '', '',
- 'altitude', 'decimal', 'NULL', '', '', '',
- 'coord_auto', 'char', 'NULL', 1, '', '',
+ 'towernum', 'serial', '', '', '', '',
+ #'agentnum', 'int', 'NULL', '', '', '',
+ 'towername', 'varchar', '', $char_d, '', '',
+ 'disabled', 'char', 'NULL', 1, '', '',
+ 'latitude', 'decimal', 'NULL', '10,7', '', '',
+ 'longitude', 'decimal', 'NULL', '10,7', '', '',
+ 'coord_auto', 'char', 'NULL', 1, '', '',
+ 'altitude', 'decimal', 'NULL', '', '', '',
+ 'height', 'decimal', 'NULL', '', '', '',
+ 'veg_height', 'decimal', 'NULL', '', '', '',
+ 'color', 'varchar', 'NULL', 6, '', '',
],
'primary_key' => 'towernum',
'unique' => [ [ 'towername' ] ], # , 'agentnum' ] ],
'towernum', 'int', '', '', '', '',
'sectorname', 'varchar', '', $char_d, '', '',
'ip_addr', 'varchar', 'NULL', 15, '', '',
+ 'height', 'decimal', 'NULL', '', '', '',
+ 'freq_mhz', 'int', 'NULL', '', '', '',
+ 'direction', 'int', 'NULL', '', '', '',
+ 'width', 'int', 'NULL', '', '', '',
+ #downtilt etc? rfpath has profile files for devices/antennas you upload?
+ 'range', 'decimal', 'NULL', '', '', '', #?
],
'primary_key' => 'sectornum',
'unique' => [ [ 'towernum', 'sectorname' ], [ 'ip_addr' ], ],
'count_query' => 'SELECT COUNT(*) FROM tower',
'disableable' => 1,
'disabled_statuspos' => 1,
- 'header' => [ 'Name', 'Sectors', 'Coordinates'],
+ 'header' => [ 'Name', 'Location', 'Sectors', ],
'fields' => [ $tower_sub,
- $sector_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;
[
[
- { 'data' => "Latitude: " . $tower->latitude . "<br>Longitude: " . $tower->longitude, },
+ { 'data' => "Latitude: ". $tower->latitude.
+ "<br>Longitude: ". $tower->longitude.
+ "<br>Altitude: ". $tower->altitude.
+ "<br>Height: ". $tower->height.
+ "<br>Veg. height: ". $tower->veg_height,
+ },
{ 'data' => $coords, 'link' => "Coordinates", },
],
]
);
[ #rows
[
- { 'data' => $tower->towername, },
+ { 'data' => $tower->towername. ' ', },
{ 'data' => ' (edit) ', size => '-1',
'link' => $p.'edit/tower.html?' . $tower->towernum },
],
my $sectornum = $sector->sectornum;
[
{
- 'data' => $sector->sectorname,
+ 'data' => $sector->sectorname. ' ',
'link' => ( $sector->ip_addr ? 'http://'. $sector->ip_addr : '' ),
},
viewall_dir => 'browse',
fields => [ 'towername',
{ field=>'disabled', type=>'checkbox', value=>'Y', },
- { field => 'default_ip_addr',
+ { field=>'color', type=>'pickcolor' },
+ { field => 'default_ip_addr',
curr_value_callback => $default_ip_addr_callback },
+ 'latitude',
+ 'longitude',
+ 'altitude',
+ 'height',
+ 'veg_height',
{ field => 'sectornum',
type => 'tower_sector',
o2m_table => 'tower_sector',
m2_label => 'Sector',
m2_error_callback => $m2_error_callback,
},
- 'latitude',
- 'longitude',
],
- labels => { 'towernum' => 'Tower',
- 'towername' => 'Name',
- 'sectornum' => 'Sector',
- 'disabled' => 'Disabled',
+ labels => { 'towernum' => 'Tower',
+ 'towername' => 'Name',
+ 'sectornum' => 'Sector',
+ 'disabled' => 'Disabled',
'default_ip_addr' => 'Tower IP address',
- 'latitude' => 'Latitude',
- 'longitude' => 'Longitude',
+ 'latitude' => 'Latitude',
+ 'longitude' => 'Longitude',
+ 'altitude' => 'Altitude',
+ 'height' => 'Height',
+ 'veg_height' => 'Vegetation height',
+ 'color' => 'Color',
},
&>
<%init>
my $m2_error_callback = sub { # reconstruct the list
my ($cgi, $object) = @_;
- my @fields = qw(sectorname ip_addr);
+ my @fields = qw( sectorname ip_addr height freq_mhz direction width range );
map {
my $k = $_;
new FS::tower_sector {