X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_svc.cgi;h=18319b34167505d89884ba9112a0917027e89d9b;hp=b2862f5a3b4ebe0dd7f77f9e1f6695844207a706;hb=032f01f95762edfb8dac47c95309f0f98ced223c;hpb=3595c874f8e476e58b98b7ab6d86918d4dbb1d5c diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index b2862f5a3..18319b341 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -65,6 +65,9 @@ blank slipip as well as a fixed shell something like /bin/true or

<% + +my %vfields; + #these might belong somewhere else for other user interfaces #pry need to eventually create stuff that's shared amount UIs my %defs = ( @@ -80,7 +83,10 @@ my %defs = ( select_key => 'popnum', select_label => 'city', }, - 'username' => 'Username', + 'username' => { + desc => 'Username', + type => 'disabled', + }, 'quota' => '', '_password' => 'Password', 'gid' => 'GID (when blank, defaults to UID)', @@ -106,34 +112,48 @@ my %defs = ( 'dstsvc' => 'service to which mail is to be forwarded', 'dst' => 'someone@another.domain.com to use when dstsvc is 0', }, - 'svc_charge' => { - 'amount' => 'amount', - }, - 'svc_wo' => { - 'worker' => 'Worker', - '_date' => 'Date', - }, +# 'svc_charge' => { +# 'amount' => 'amount', +# }, +# 'svc_wo' => { +# 'worker' => 'Worker', +# '_date' => 'Date', +# }, 'svc_www' => { #'recnum' => '', #'usersvc' => '', }, 'svc_broadband' => { - 'actypenum' => 'This is the actypenum that refers to the type of AC that can be provisioned for this service. This field must be set fixed.', '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.', - 'acnum' => 'acnum of a specific AC that this service is restricted to. Not required', 'ip_addr' => 'IP address. Leave blank for automatic assignment.', - 'ip_netmask' => 'Mask length, aka. netmask bits. (Eg. 255.255.255.0 == 24)', - 'mac_addr' => 'MAC address which is used by some ACs for access control. Specified by 6 colon seperated hex octets. (Eg. 00:00:0a:bc:1a:2b)', - 'location' => 'Defines the physically location at which this service was installed. This is not necessarily the billing address', + 'blocknum' => 'Address block.', }, ); + foreach my $svcdb (grep dbdef->table($_), keys %defs ) { + my $self = "FS::$svcdb"->new; + $vfields{$svcdb} = {}; + foreach my $field ($self->virtual_fields) { # svc_Common::virtual_fields with a null svcpart returns all of them + my $pvf = $self->pvf($field); + my @list = $pvf->list; + if (scalar @list) { + $defs{$svcdb}->{$field} = { desc => $pvf->label, + type => 'select', + select_list => \@list }; + } else { + $defs{$svcdb}->{$field} = $pvf->label; + } #endif + $vfields{$svcdb}->{$field} = $pvf; + warn "\$vfields{$svcdb}->{$field} = $pvf"; + } #next $field + } #next $svcdb + my @dbs = $hashref->{svcdb} ? ( $hashref->{svcdb} ) : qw( svc_acct svc_domain svc_forward svc_www svc_broadband ); - tie my %svcdb, 'Tie::IxHash', map { $_=>$_ } @dbs; + tie my %svcdb, 'Tie::IxHash', map { $_=>$_ } grep dbdef->table($_), @dbs; my $widget = new HTML::Widgets::SelectLayers( #'selected_layer' => $p_svcdb, 'selected_layer' => $hashref->{svcdb} || 'svc_acct', @@ -151,17 +171,18 @@ my %defs = ( my @part_export = map { qsearch( 'part_export', {exporttype => $_ } ) } keys %{FS::part_export::export_info($layer)}; - $html .= '

'. table(). + $html .= '

'. table(). table(). "Exports"; foreach my $part_export ( @part_export ) { - $html .= 'svcpart ) #null svcpart search causing error + && qsearchs( 'export_svc', { exportnum => $part_export->exportnum, svcpart => $clone || $part_svc->svcpart }); - $html .= '> '. $part_export->exporttype. ' to '. $part_export->machine. - ''; + $html .= '>'. $part_export->exportnum. ': '. $part_export->exporttype. + ' to '. $part_export->machine. ''; $count++; $html .= '' unless $count % $columns; } @@ -188,28 +209,44 @@ my %defs = ( $html .= "$field"; $html .= "- $desc" if $desc; $html .= ""; + $flag = '' if ref($def) && $def->{type} eq 'disabled'; $html .= qq!Off". - qq!Default ". - qq!Fixed ". - '
'; + ''; + unless ( ref($def) && $def->{type} eq 'disabled' ) { + $html .= + qq!Default ". + qq!Fixed "; + $html .= '
'; + } if ( ref($def) ) { if ( $def->{type} eq 'select' ) { $html .= qq!'; } elsif ( $def->{type} eq 'radius_usergroup_selector' ) { $html .= FS::svc_acct::radius_usergroup_selector( [ split(',', $value) ], "${layer}__${field}" ); + } elsif ( $def->{type} eq 'disabled' ) { + $html .= + qq!!; } else { $html .= 'unknown type'. $def->{type}; } @@ -217,6 +254,11 @@ my %defs = ( $html .= qq!!; } + + if($vfields{$layer}->{$field}) { + $html .= qq!
Excluded "; + } $html .= "\n"; } $part_svc->svcpart('') if $clone; #undone