X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_svc.cgi;h=fae8961543ccb9370ed2247147d60830dd5958a6;hb=f62a68016f32b443084705b0e7851497b308f81d;hp=8ca0196497f58d1c9d84da016e2ec5d571dde495;hpb=9f2280fbce022ab9bcfc46fe94483730b0aeb0f8;p=freeside.git diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 8ca019649..fae896154 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -9,26 +9,31 @@ Service Part #<% $part_svc->svcpart ? $part_svc->svcpart : "(NEW)" %>

Service
+ +Self-service access: +
+ {disabled} eq 'Y' ? ' CHECKED' : '' %>> Disable new orders
+ {'preserve'} eq 'Y' ? ' CHECKED' : '' %>> Preserve this service on package cancellation
+ +
- -% #YUCK. false laziness w/part_svc.pm. go away virtual fields, please % my %vfields; -% foreach my $svcdb ( FS::part_svc->svc_tables() ) { -% eval "use FS::$svcdb;"; -% 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); -% $vfields{$svcdb}->{$field} = $pvf; -% #warn "\$vfields{$svcdb}->{$field} = $pvf"; -% } #next $field -% } #next $svcdb -% % #code duplication w/ edit/part_svc.cgi, should move this hash to part_svc.pm % # and generalize the subs % # condition sub is tested to see whether to disable display of this choice @@ -80,6 +85,7 @@ Service
% #'form_action' => 'process/part_svc.cgi', % 'form_action' => 'part_svc.cgi', #self % 'form_text' => [ qw( svc svcpart ) ], +% 'form_select' => [ 'selfservice_access' ], % 'form_checkbox' => [ 'disabled', 'preserve' ], % 'layer_callback' => sub { % my $layer = shift; @@ -139,7 +145,11 @@ Service
% ) % } fields($layer); % } -% push @fields, 'usergroup' if $layer eq 'svc_acct'; #kludge +% push @fields, 'usergroup' +% if $layer eq 'svc_acct' +% or ( $layer eq 'svc_broadband' and +% $conf->exists('svc_broadband-radius') ); # double kludge +% # (but we do want to check the config, right?) % $part_svc->svcpart($clone) if $clone; #haha, undone below % % @@ -320,7 +330,9 @@ Service
% 'curr_value' => $value, % 'element_name' => "${layer}__${field}", % 'element_etc' => $disabled, -% 'multiple' => ($flag eq 'S'), +% 'multiple' => ($def->{multiple} || +% $flag eq 'S'), +% # allow the table def to force 'multiple' % ); % % } elsif ( $def->{type} eq 'communigate_pro-accessmodes' ) { @@ -370,7 +382,8 @@ Service
% % $html .= include('/elements/progress-init.html', % $layer, #form name -% [ qw(svc svcpart disabled preserve exportnum), +% [ qw(svc svcpart selfservice_access disabled preserve +% exportnum), % @fields ], % 'process/part_svc.cgi', % $p.'browse/part_svc.cgi', @@ -400,6 +413,7 @@ Table <% $widget->html %> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); +my $conf = FS::Conf->new; my $part_svc; my $clone = ''; if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {#clone