);
} keys %$fields;
+#my %labels = ();
+
+$labels{'description'} = emt('Description');
$labels{'router'} = emt('Router');
+$labels{'speed_down'} = emt('Download Speed');
+$labels{'speed_up'} = emt('Upload Speed');
+$labels{'ip_addr'} = emt('IP Address');
$labels{'usergroup'} = emt('RADIUS groups'); #?
+$labels{'coordinates'} = 'Latitude/Longitude';
+
my @fields = (
'description',
{ field => 'router', value => \&router },
{ field => 'ip_addr', value => \&ip_addr },
{ field => 'sectornum', value => \§ornum },
'mac_addr',
- 'latitude',
- 'longitude',
+ #'latitude',
+ #'longitude',
+ { field => 'coordinates', value => \&coordinates },
'altitude',
'vlan_profile',
'authkey',
sub ip_addr {
my $svc = shift;
my $ip_addr = $svc->ip_addr;
- my $out = $ip_addr . ' (' .
- include('/elements/popup_link-ping.html', ip => $ip_addr) . ')';
+ my $out = $ip_addr;
+ $out .= ' (' . include('/elements/popup_link-ping.html', ip => $ip_addr) . ')'
+ if $ip_addr;
if ( my $addr_block = $svc->addr_block ) {
$out .= '<br>Netmask: ' . $addr_block->NetAddr->mask .
'<br>Gateway: ' . $addr_block->ip_gateway;
$link . $tower_sector->description. ( $link ? '</A>' : '');
}
+sub coordinates {
+ my $s = shift; #$svc_broadband
+ return '' unless $s->latitude && $s->longitude;
+
+ my $d = $s->description;
+ unless ($d) {
+ my $cust_pkg = $s->cust_svc->cust_pkg;
+ $d = $cust_pkg->cust_main->name_short if $cust_pkg;
+ }
+
+ #'Latitude: '. $s->latitude. ', Longitude: '. $s->longitude. ' '.
+ $s->latitude. ', '. $s->longitude. ' '.
+ include('/elements/coord-links.html', $s->latitude, $s->longitude, $d);
+}
+
</%init>