X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_svc.pm;h=3ae79a6df3447c5b243afa5dacb1833d86808646;hp=164bad079bafa597cf5464ab87670d27b6ba4d4b;hb=552ab4d038b22d47d981dd19e8ab2d1fd421e494;hpb=46ef8524cf2e6db7b851967062ce92ffb0773d10 diff --git a/FS/FS/part_svc.pm b/FS/FS/part_svc.pm index 164bad079..3ae79a6df 100644 --- a/FS/FS/part_svc.pm +++ b/FS/FS/part_svc.pm @@ -53,6 +53,8 @@ L, and L, among others. =item disabled - Disabled flag, empty or `Y' +=item preserve - Preserve after cancellation, empty or 'Y' + =back =head1 METHODS @@ -381,6 +383,7 @@ sub check { || $self->ut_text('svc') || $self->ut_alpha('svcdb') || $self->ut_enum('disabled', [ '', 'Y' ] ) + || $self->ut_enum('preserve', [ '', 'Y' ] ) ; return $error if $error; @@ -669,7 +672,8 @@ the following keys: =item def_label - Optional description of the field in the context of service definitions -=item type - Currently "text", "select", "disabled", or "radius_usergroup_selector" +=item type - Currently "text", "select", "checkbox", "textarea", "disabled", +some components specified by "select-.*.html", and a bunch more... =item disable_default - This field should not allow a default value in service definitions @@ -758,7 +762,7 @@ sub process { map { my $f = $svcdb.'__'.$_; - if ( $param->{ $f.'_flag' } =~ /^[MA]$/ ) { + if ( $param->{ $f.'_flag' } =~ /^[MAH]$/ ) { $param->{ $f } = delete( $param->{ $f.'_classnum' } ); } if ( $param->{ $f.'_flag' } =~ /^S$/ ) { @@ -812,6 +816,9 @@ sub process_bulk_cust_svc { my $param = thaw(decode_base64(shift)); warn Dumper($param) if $DEBUG; + local($FS::svc_Common::noexport_hack) = 1 + if $param->{'noexport'}; + my $old_part_svc = qsearchs('part_svc', { 'svcpart' => $param->{'old_svcpart'} } ); @@ -860,6 +867,34 @@ sub process_bulk_cust_svc { } +sub _upgrade_data { #class method + my ($class, %opts) = @_; + + my @part_svc_column = qsearch('part_svc_column', { 'columnname' => 'usergroup' }); + foreach my $col ( @part_svc_column ) { + next if $col->columnvalue =~ /^[\d,]+$/ || !$col->columnvalue; + my @groupnames = split(',',$col->columnvalue); + my @groupnums; + my $error = ''; + foreach my $groupname ( @groupnames ) { + my $g = qsearchs('radius_group', { 'groupname' => $groupname } ); + unless ( $g ) { + $g = new FS::radius_group { + 'groupname' => $groupname, + 'description' => $groupname, + }; + $error = $g->insert; + die $error if $error; + } + push @groupnums, $g->groupnum; + } + $col->columnvalue(join(',',@groupnums)); + $error = $col->replace; + die $error if $error; + } + +} + =head1 BUGS Delete is unimplemented.