[Rt-commit] r5317 - rt/branches/3.4-RELEASE/lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Tue May 30 16:13:04 EDT 2006


Author: ruz
Date: Tue May 30 16:13:02 2006
New Revision: 5317

Modified:
   rt/branches/3.4-RELEASE/lib/RT/Ticket_Overlay.pm

Log:
* If current user changes owner from somebody else to nobody user,
  the action fails with "You can only reassign tickets that you own
  or that are unowned", but we must change owner if he has no right
  to own tickets in dest queue. Do it with Force and with SystemUser
  context.

Modified: rt/branches/3.4-RELEASE/lib/RT/Ticket_Overlay.pm
==============================================================================
--- rt/branches/3.4-RELEASE/lib/RT/Ticket_Overlay.pm	(original)
+++ rt/branches/3.4-RELEASE/lib/RT/Ticket_Overlay.pm	Tue May 30 16:13:02 2006
@@ -1983,11 +1983,16 @@
         )
       )
     {
-        $self->Untake();
+        my $clone = RT::Ticket->new( $RT::SystemUser );
+        $clone->Load( $self->Id );
+        unless ( $clone->Id ) {
+            return ( 0, $self->loc("Couldn't load copy of ticket #[_1].", $self->Id) );
+        }
+        my ($status, $msg) = $clone->SetOwner( $RT::Nobody->Id, 'Force' );
+        $RT::Logger->error("Couldn't set owner on queue change: $msg") unless $status;
     }
 
     return ( $self->_Set( Field => 'Queue', Value => $NewQueueObj->Id() ) );
-
 }
 
 # }}}


More information about the Rt-commit mailing list