X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fsvc_broadband.cgi;h=8a108f891d6e7cf1284e528c0eb7616a1950267b;hb=cc647ae934abe5c9d9a5fc12f020adfc566349d9;hp=25fb009acf5903865fe5adf47464058aae6ce0fc;hpb=a1871d3d13c1dafa93b956762c0d23728d261da7;p=freeside.git diff --git a/httemplate/edit/svc_broadband.cgi b/httemplate/edit/svc_broadband.cgi index 25fb009ac..8a108f891 100644 --- a/httemplate/edit/svc_broadband.cgi +++ b/httemplate/edit/svc_broadband.cgi @@ -2,18 +2,19 @@ 'post_url' => popurl(1). 'process/svc_broadband.cgi', 'name' => 'broadband service', 'table' => 'svc_broadband', - 'labels' => { 'svcnum' => 'Service #', + 'labels' => { 'svcnum' => 'Service', 'description' => 'Description', 'ip_addr' => 'IP address', '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', 'altitude' => 'Altitude', 'vlan_profile' => 'VLAN profile', + 'performance_profile' => 'Performance profile', 'authkey' => 'Authentication key', }, 'fields' => \@fields, @@ -29,12 +30,16 @@ die "access denied" # 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 ) + qw( mac_addr latitude longitude altitude vlan_profile performance_profile authkey ) ); +my $fixedblock = ''; + my $callback = sub { my ($cgi, $object, $fieldref) = @_; @@ -48,6 +53,8 @@ my $callback = sub { 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 +67,22 @@ my $callback = sub { } 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;