X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fsvc_broadband.cgi;h=de39f6ae48f84caeb65945f14115c3e6e80ab9c0;hp=22cbb1f44f0705af4faf210f5f597766b83b14d4;hb=b429a422185206c645c84ec1c3540494d336b943;hpb=b0329dafd35e0296ec61fef4c35a687ff8866764;ds=sidebyside diff --git a/httemplate/view/svc_broadband.cgi b/httemplate/view/svc_broadband.cgi index 22cbb1f44..de39f6ae4 100644 --- a/httemplate/view/svc_broadband.cgi +++ b/httemplate/view/svc_broadband.cgi @@ -13,9 +13,17 @@ my %labels = map { $_ => ( ref($fields->{$_}) ); } 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 }, @@ -24,8 +32,9 @@ my @fields = ( { field => 'ip_addr', value => \&ip_addr }, { field => 'sectornum', value => \§ornum }, 'mac_addr', - 'latitude', - 'longitude', + #'latitude', + #'longitude', + { field => 'coordinates', value => \&coordinates }, 'altitude', 'vlan_profile', 'authkey', @@ -46,8 +55,9 @@ sub router { 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 .= '
Netmask: ' . $addr_block->NetAddr->mask . '
Gateway: ' . $addr_block->ip_gateway; @@ -72,4 +82,19 @@ sub sectornum { $link . $tower_sector->description. ( $link ? '' : ''); } +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); +} +