X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fsvc_broadband.cgi;h=75e673c4f89332ce4b53cb7bc3f11b38ff8096e8;hb=c13c6407510f6fd1783ce0fbd97800afa27c30b5;hp=05ae632bdd308cbddeb0986f076e035d236b0c22;hpb=eb9d1063e1203231ee0c6922ea5638370f7b5ece;p=freeside.git diff --git a/httemplate/view/svc_broadband.cgi b/httemplate/view/svc_broadband.cgi index 05ae632bd..75e673c4f 100644 --- a/httemplate/view/svc_broadband.cgi +++ b/httemplate/view/svc_broadband.cgi @@ -17,7 +17,6 @@ my %labels = map { $_ => ( ref($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'); @@ -32,7 +31,7 @@ my @fields = ( 'speed_up', { field => 'ip_addr', value => \&ip_addr }, { field => 'sectornum', value => \§ornum }, - 'mac_addr', + { field => 'mac_addr', value => \&mac_addr }, #'latitude', #'longitude', { field => 'coordinates', value => \&coordinates }, @@ -48,10 +47,11 @@ push @fields, sub router { my $svc = shift; - my $router = $svc->router or return ''; + my $router = $svc->router; my $block = $svc->addr_block; + $router = $router->routernum . ': ' . $router->routername if $router; $block = '; '.$block->cidr if $block; - $router->routernum . ': ' . $router->routername . $block + $router . $block } sub ip_addr { @@ -67,6 +67,11 @@ sub ip_addr { $out; } +sub mac_addr { + my $svc = shift; + join(':', $svc->mac_addr =~ /../g); +} + sub usergroup { my $svc = shift; my $usergroup = $svc->usergroup; @@ -89,14 +94,22 @@ sub coordinates { return '' unless $s->latitude && $s->longitude; my $d = $s->description; + my $agentnum; unless ($d) { - my $cust_pkg = $s->cust_svc->cust_pkg; - $d = $cust_pkg->cust_main->name_short if $cust_pkg; + if ( my $cust_pkg = $s->cust_svc->cust_pkg ) { + $d = $cust_pkg->cust_main->name_short; + $agentnum = $cust_pkg->cust_main->agentnum; + } } #'Latitude: '. $s->latitude. ', Longitude: '. $s->longitude. ' '. $s->latitude. ', '. $s->longitude. ' '. - include('/elements/coord-links.html', $s->latitude, $s->longitude, $d); + include('/elements/coord-links.html', + $s->latitude, + $s->longitude, + $d, + $agentnum + ); } sub svc_callback {