1 <& elements/svc_Common.html,
2 table => 'svc_broadband',
5 svc_callback => \&svc_callback,
9 my $conf = FS::Conf->new;
10 my $fields = FS::svc_broadband->table_info->{'fields'};
11 my %labels = map { $_ => ( ref($fields->{$_})
12 ? $fields->{$_}{'label'}
19 $labels{'description'} = emt('Description');
20 $labels{'speed_down'} = emt('Download Speed');
21 $labels{'speed_up'} = emt('Upload Speed');
22 $labels{'ip_addr'} = emt('IP Address');
23 $labels{'usergroup'} = emt('RADIUS groups'); #?
25 $labels{'coordinates'} = 'Latitude/Longitude';
29 { field => 'routernum', value => \&router },
32 { field => 'ip_addr', value => \&ip_addr },
33 { field => 'sectornum', value => \§ornum },
37 { field => 'coordinates', value => \&coordinates },
45 { field => 'usergroup', value => \&usergroup }
46 if $conf->exists('svc_broadband-radius');
50 my $router = $svc->router or return '';
51 my $block = $svc->addr_block;
52 $block = '; '.$block->cidr if $block;
53 $router->routernum . ': ' . $router->routername . $block
58 my $ip_addr = $svc->ip_addr;
60 $out .= ' (' . include('/elements/popup_link-ping.html', ip => $ip_addr) . ')'
62 if ( my $addr_block = $svc->addr_block ) {
63 $out .= '<br>Netmask: ' . $addr_block->NetAddr->mask .
64 '<br>Gateway: ' . $addr_block->ip_gateway;
71 my $usergroup = $svc->usergroup;
72 join('<BR>', $svc->radius_groups('long_description'));
76 my $svc_broadband = shift;
77 return '' unless $svc_broadband->sectornum;
78 my $tower_sector = $svc_broadband->tower_sector;
79 my $link = $tower_sector->ip_addr
80 ? '<A HREF="http://'. $tower_sector->ip_addr. '">'
83 $link . $tower_sector->description. ( $link ? '</A>' : '');
87 my $s = shift; #$svc_broadband
88 return '' unless $s->latitude && $s->longitude;
90 my $d = $s->description;
93 if ( my $cust_pkg = $s->cust_svc->cust_pkg ) {
94 $d = $cust_pkg->cust_main->name_short;
95 $agentnum = $cust_pkg->cust_main->agentnum;
99 #'Latitude: '. $s->latitude. ', Longitude: '. $s->longitude. ' '.
100 $s->latitude. ', '. $s->longitude. ' '.
101 include('/elements/coord-links.html',
110 # trying to move to the callback style
111 my ($cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt) = @_;
112 # again, we assume at most one of these exports per part_svc
113 my ($nas_export) = $part_svc->part_export('broadband_nas');
115 my $nas = qsearchs('nas', { 'svcnum' => $svc_x->svcnum });
117 $svc_x->set($_, $nas->$_) foreach (fields('nas'));
118 push @$fields, qw(shortname secret type ports server community);
119 $opt->{'labels'}{'shortname'} = 'Short name';
120 $opt->{'labels'}{'secret'} = 'Shared secret';
121 $opt->{'labels'}{'type'} = 'Type';
122 $opt->{'labels'}{'ports'} = 'Ports';
123 $opt->{'labels'}{'server'} = 'Server';
124 $opt->{'labels'}{'community'} = 'Community';