[Rt-commit] r19590 - rt/3.8/branches/notify_group/sbin

ruz at bestpractical.com ruz at bestpractical.com
Thu May 7 20:37:57 EDT 2009


Author: ruz
Date: Thu May  7 20:37:57 2009
New Revision: 19590

Modified:
   rt/3.8/branches/notify_group/sbin/rt-email-group-admin.in

Log:
* use new format and obsolete old format, we have upgrade script
  for conversion

Modified: rt/3.8/branches/notify_group/sbin/rt-email-group-admin.in
==============================================================================
--- rt/3.8/branches/notify_group/sbin/rt-email-group-admin.in	(original)
+++ rt/3.8/branches/notify_group/sbin/rt-email-group-admin.in	Thu May  7 20:37:57 2009
@@ -361,7 +361,7 @@
 
     push @cur, $id;
 
-    return $action->__Set( Field => 'Argument', Value => join(';', @cur) );
+    return $action->__Set( Field => 'Argument', Value => join(',', @cur) );
 }
 
 =head2 delete NAME
@@ -477,44 +477,8 @@
 
 sub argument_to_list {
     my $action = shift;
-    my $arg = $action->Argument;
-
-    # old variant via Storable
-    {
-        local $@;
-        require Storable;
-        my $old = eval { Storable::thaw( $arg ) };
-        unless ( $@ ) {
-            $arg = __convert_old($old);
-        }
-    }
-
-    return _split_arg( $arg );
-}
-
-sub _split_arg { return split /[^0-9]+/, $_[0] }
-
-sub __convert_old {
-    my $arg = shift;
-    my @res;
-    foreach my $r ( @{ $arg } ) {
-        my $obj;
-        next unless $r->{'Type'};
-        if ( lc $r->{'Type'} eq 'user' ) {
-            $obj = RT::User->new( $RT::SystemUser );
-        } elsif ( lc $r->{'Type'} eq 'user' ) {
-            $obj = RT::Group->new( $RT::SystemUser );
-        } else {
-            next;
-        }
-        $obj->Load( $r->{'Instance'} );
-        my $id = $obj->id;
-        next unless $id;
-
-        push @res, $id;
-    }
-
-    return join ';', @res;
+    require RT::Action::NotifyGroup;
+    return RT::Action::NotifyGroup->__SplitArg( $action->Argument );
 }
 
 sub _get_our_actions {


More information about the Rt-commit mailing list