X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Faccess_right.pm;h=ef8cc6cd800400e52e5a3489e103498a7b7e48c9;hb=f9a181e4c2e505df84de16190ee3b75011326f3f;hp=4f8d1e9a081fce134e0306e735eb84285d04ade5;hpb=3e2c08dba947ea254c60cbd621776c0f5dddb2e8;p=freeside.git diff --git a/FS/FS/access_right.pm b/FS/FS/access_right.pm index 4f8d1e9a0..ef8cc6cd8 100644 --- a/FS/FS/access_right.pm +++ b/FS/FS/access_right.pm @@ -145,6 +145,41 @@ sub _upgrade_data { # class method if $error; } + my %migrate = ( + 'Post payment' => [ 'Post check payment', 'Post cash payment' ], + 'Process payment' => [ 'Process credit card payment', 'Process Echeck payment' ], + 'Post refund' => [ 'Post check refund', 'Post cash refund' ], + 'Refund payment' => [ 'Refund credit card payment', 'Refund Echeck payment' ], + ); + + foreach my $oldright (keys %migrate) { + my @old = qsearch('access_right', { 'righttype'=>'FS::access_group', + 'rightname'=>$oldright, + } + ); + + foreach my $old ( @old ) { + + foreach my $newright ( @{ $migrate{$oldright} } ) { + my %hash = ( + 'righttype' => 'FS::access_group', + 'rightobjnum' => $old->rightobjnum, + 'rightname' => $newright, + ); + next if qsearchs('access_right', \%hash); + my $access_right = new FS::access_right \%hash; + my $error = $access_right->insert; + die $error if $error; + } + + #after the WEST stuff is sorted, etc. + #my $error = $old->delete; + #die $error if $error; + + } + + } + ''; } @@ -153,8 +188,6 @@ sub _upgrade_data { # class method =head1 BUGS -The author forgot to customize this manpage. - =head1 SEE ALSO L, schema.html from the base documentation.