X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fsvc_broadband.cgi;h=ae7f50fca0e80056a618e941f6e0d6e0d19e06bc;hb=e0a26680d75fc2000bde195eba7946805a3aaa28;hp=8a108f891d6e7cf1284e528c0eb7616a1950267b;hpb=1350cca5dd7297a37fea8417a51d6a435635e32e;p=freeside.git diff --git a/httemplate/edit/svc_broadband.cgi b/httemplate/edit/svc_broadband.cgi index 8a108f891..ae7f50fca 100644 --- a/httemplate/edit/svc_broadband.cgi +++ b/httemplate/edit/svc_broadband.cgi @@ -2,21 +2,6 @@ '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, @@ -35,7 +20,7 @@ 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 performance_profile authkey ) + qw( mac_addr latitude longitude altitude vlan_profile performance_profile authkey plan_id ) ); my $fixedblock = ''; @@ -63,12 +48,12 @@ my $callback = sub { 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{ @@ -93,7 +78,8 @@ my $callback = sub { && $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;