'post_url' => popurl(1). 'process/svc_broadband.cgi',
'name' => 'broadband service',
'table' => 'svc_broadband',
- 'labels' => { 'svcnum' => 'Service',
- 'description' => 'Description',
- 'ip_addr' => 'IP address',
- 'speed_down' => 'Download speed',
- 'speed_up' => 'Upload speed',
- 'blocknum' => 'Router/Block',
- 'block_label' => 'Router/Block',
- 'mac_addr' => 'MAC address',
- 'latitude' => 'Latitude',
- 'longitude' => 'Longitude',
- 'altitude' => 'Altitude',
- 'vlan_profile' => 'VLAN profile',
- 'performance_profile' => 'Performance profile',
- 'authkey' => 'Authentication key',
- },
'fields' => \@fields,
'field_callback' => $callback,
'dummy' => $cgi->query_string,
my @fields = (
qw( description ip_addr speed_down speed_up blocknum ),
{ field=>'block_label', type=>'fixed' },
- qw( mac_addr latitude longitude altitude vlan_profile performance_profile authkey )
+ qw( mac_addr latitude longitude altitude vlan_profile performance_profile authkey plan_id )
);
my $fixedblock = '';
if $fieldref->{field} eq 'blocknum';
$fieldref->{value} = $object->addr_block->label
- if $fieldref->{field} eq 'block_label';
+ if $fieldref->{field} eq 'block_label' && $object->addr_block;
} else {
if ($fieldref->{field} eq 'block_label') {
- if ($fixedblock) {
+ if ($fixedblock && $object->addr_block) {
$object->blocknum($fixedblock);
$fieldref->{value} = $object->addr_block->label;
}else{
&& $FS::CurrentUser::CurrentUser->agentnum($_->agentnum)
}
map { $_->addr_block } $object->allowed_routers;
- my @options = map { $_->blocknum } @addr_block;
+ my @options = map { $_->blocknum }
+ sort { $a->label cmp $b->label } @addr_block;
my %option_labels = map { ( $_->blocknum => $_->label ) } @addr_block;
$fieldref->{type} = 'select';
$fieldref->{options} = \@options;