[freeside-commits] freeside/FS/FS svc_broadband.pm, 1.13, 1.14 addr_block.pm, 1.6, 1.7
Ivan,,,
ivan at wavetail.420.am
Sat Mar 15 22:13:15 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv18879
Modified Files:
svc_broadband.pm addr_block.pm
Log Message:
bring some sanity to address block selection in svc_broadband service definition edit
Index: addr_block.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/addr_block.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- addr_block.pm 12 Sep 2003 00:14:48 -0000 1.6
+++ addr_block.pm 16 Mar 2008 05:13:13 -0000 1.7
@@ -158,8 +158,18 @@
sub NetAddr {
my $self = shift;
+ new NetAddr::IP ($self->ip_gateway, $self->ip_netmask);
+}
- return new NetAddr::IP ($self->ip_gateway, $self->ip_netmask);
+=item cidr
+
+Returns a CIDR string for this block's address and netmask, i.e. 10.4.20.0/24
+
+=cut
+
+sub cidr {
+ my $self = shift;
+ $self->NetAddr->cidr;
}
=item next_free_addr
Index: svc_broadband.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_broadband.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- svc_broadband.pm 13 Feb 2008 23:49:37 -0000 1.13
+++ svc_broadband.pm 16 Mar 2008 05:13:13 -0000 1.14
@@ -97,7 +97,13 @@
'speed_down' => 'Maximum download speed for this service in Kbps. 0 denotes unlimited.',
'speed_up' => 'Maximum upload speed for this service in Kbps. 0 denotes unlimited.',
'ip_addr' => 'IP address. Leave blank for automatic assignment.',
- 'blocknum' => 'Address block.',
+ 'blocknum' => { 'label' => 'Address block',
+ 'type' => 'select',
+ 'select_table' => 'addr_block',
+ 'select_key' => 'blocknum',
+ 'select_label' => 'cidr',
+ 'disable_inventory' => 1,
+ },
},
};
}
@@ -253,7 +259,7 @@
sub NetAddr {
my $self = shift;
- return new NetAddr::IP ($self->ip_addr);
+ new NetAddr::IP ($self->ip_addr);
}
=item addr_block
@@ -264,8 +270,7 @@
sub addr_block {
my $self = shift;
-
- return qsearchs('addr_block', { blocknum => $self->blocknum });
+ qsearchs('addr_block', { blocknum => $self->blocknum });
}
=back
@@ -278,8 +283,7 @@
sub allowed_routers {
my $self = shift;
-
- return map { $_->router } qsearch('part_svc_router', { svcpart => $self->svcpart });
+ map { $_->router } qsearch('part_svc_router', { svcpart => $self->svcpart });
}
=head1 BUGS
More information about the freeside-commits
mailing list