[freeside-commits] freeside/httemplate/view svc_broadband.cgi, 1.25, 1.26
Mark Wells
mark at wavetail.420.am
Wed Dec 28 15:55:34 PST 2011
Update of /home/cvs/cvsroot/freeside/httemplate/view
In directory wavetail.420.am:/tmp/cvs-serv5724/httemplate/view
Modified Files:
svc_broadband.cgi
Log Message:
broadband_nas export, #15284
Index: svc_broadband.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/svc_broadband.cgi,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -w -d -r1.25 -r1.26
--- svc_broadband.cgi 13 Dec 2011 05:09:32 -0000 1.25
+++ svc_broadband.cgi 28 Dec 2011 23:55:32 -0000 1.26
@@ -2,6 +2,7 @@
table => 'svc_broadband',
labels => \%labels,
fields => \@fields,
+ svc_callback => \&svc_callback,
&>
<%init>
@@ -97,4 +98,25 @@
include('/elements/coord-links.html', $s->latitude, $s->longitude, $d);
}
+sub svc_callback {
+ # trying to move to the callback style
+ my ($cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt) = @_;
+ # 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
+};
+
+
</%init>
More information about the freeside-commits
mailing list