+sub svc_callback {
+ # trying to move to the callback style
+ my ($cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt) = @_;
+
+ if ( $part_svc->part_svc_column('latitude')->columnflag eq 'F'
+ && $part_svc->part_svc_column('longitude')->columnflag eq 'F'
+ )
+ {
+ @$fields = grep { !ref($_) || $_->{field} ne 'coordinates' } @$fields;
+ }
+
+ # again, we assume at most one of these exports per part_svc
+ my ($nas_export) = $part_svc->part_export('broadband_nas');
+ if ( $nas_export ) {
+ my $nas = qsearchs('nas', { 'svcnum' => $svc_x->svcnum });
+ if ( $nas ) {
+ $svc_x->set($_, $nas->$_) foreach (fields('nas'));
+ push @$fields, qw(shortname secret type ports server community);
+ $opt->{'labels'}{'shortname'} = 'Short name';
+ $opt->{'labels'}{'secret'} = 'Shared secret';
+ $opt->{'labels'}{'type'} = 'Type';
+ $opt->{'labels'}{'ports'} = 'Ports';
+ $opt->{'labels'}{'server'} = 'Server';
+ $opt->{'labels'}{'community'} = 'Community';
+ } #if $nas
+ } #$nas_export
+};
+
+