[freeside-commits] freeside/httemplate/edit svc_broadband.cgi, 1.17, 1.18
Jeff Finucane,420,,
jeff at wavetail.420.am
Fri Sep 26 20:01:46 PDT 2008
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail.420.am:/tmp/cvs-serv7676/httemplate/edit
Modified Files:
svc_broadband.cgi
Log Message:
per address block ip auto assignment and auto router selection
Index: svc_broadband.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_broadband.cgi,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- svc_broadband.cgi 28 Jun 2008 19:25:24 -0000 1.17
+++ svc_broadband.cgi 27 Sep 2008 03:01:44 -0000 1.18
@@ -8,7 +8,7 @@
'speed_down' => 'Download speed',
'speed_up' => 'Upload speed',
'blocknum' => 'Router/Block',
- 'block_disp' => 'Router/Block',
+ 'block_label' => 'Router/Block',
'mac_addr' => 'MAC address',
'latitude' => 'Latitude',
'longitude' => 'Longitude',
@@ -29,12 +29,16 @@
# If it's stupid but it works, it's still stupid.
# -Kristian
+my $conf = new FS::Conf;
+
my @fields = (
qw( description ip_addr speed_down speed_up blocknum ),
{ field=>'block_label', type=>'fixed' },
qw( mac_addr latitude longitude altitude vlan_profile authkey )
);
+my $fixedblock = '';
+
my $callback = sub {
my ($cgi, $object, $fieldref) = @_;
@@ -48,6 +52,8 @@
if ($columndef->columnflag eq 'F') {
$fieldref->{'type'} = 'fixed';
$fieldref->{'value'} = $columndef->columnvalue;
+ $fixedblock = $fieldref->{value}
+ if $fieldref->{field} eq 'blocknum';
}
if ($object->svcnum) {
@@ -60,9 +66,22 @@
} else {
- $fieldref->{type} = 'hidden' if $fieldref->{field} eq 'block_label';
+ if ($fieldref->{field} eq 'block_label') {
+ if ($fixedblock) {
+ $object->blocknum($fixedblock);
+ $fieldref->{value} = $object->addr_block->label;
+ }else{
+ $fieldref->{type} = 'hidden';
+ }
+ }
if ($fieldref->{field} eq 'blocknum') {
+ if ( $fixedblock or $conf->exists('auto_router') ) {
+ $fieldref->{type} = 'hidden';
+ $fieldref->{value} = $fixedblock;
+ return;
+ }
+
my $cust_pkg = qsearchs( 'cust_pkg', {pkgnum => $cgi->param('pkgnum')} );
die "No cust_pkg entry!" unless $cust_pkg;
More information about the freeside-commits
mailing list