[Rt-commit] [rtir] 03/08: Also override AutoOpenInactive

Kevin Falcone falcone at bestpractical.com
Fri Apr 18 21:20:54 EDT 2014


This is an automated email from the git hooks/post-receive script.

falcone pushed a commit to branch 3.2/test-fixes
in repository rtir.

commit 3daf9a485bdbdf340a40a204bf83864a7ba98aa1
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Apr 18 14:56:16 2014 -0400

    Also override AutoOpenInactive
    
    Tests do a fresh install, so pointed out that only overriding AutoOpen
    is insufficient to make this override work.
---
 lib/RT/IR.pm | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index a5d0889..4abe138 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -716,9 +716,11 @@ if ( RT::IR->HasConstituency ) {
     };
 }
 
-# Skip the global AutoOpen scrip on Blocks and Incident Reports
+# Skip the global AutoOpen and AutoOpenInactive scrip on Blocks and Incident Reports
 # This points to RTIR wanting to muck with the global scrips using the 4.2 scrips
 # organization, although it possibly messes with Admins expectations of 'contained Queues'
+# We have to hit both because the first is installed on upgraded RTs while the latter is
+# installed on fresh 4.2 installs and Admins are free to configure either.
 require RT::Action::AutoOpen;
 {
     no warnings 'redefine';
@@ -731,6 +733,18 @@ require RT::Action::AutoOpen;
         return $self->$prepare(@_);
     };
 }
+require RT::Action::AutoOpenInactive;
+{
+    no warnings 'redefine';
+    my $prepare = RT::Action::AutoOpenInactive->can('Prepare');
+    *RT::Action::AutoOpenInactive::Prepare = sub {
+        my $self = shift;
+        my $ticket = $self->TicketObj;
+        my $type = RT::IR::TicketType( Ticket => $ticket );
+        return 1 if $type && ( $type eq 'Block' || $type eq 'Report' );
+        return $self->$prepare(@_);
+    };
+}
 
 if ( RT::IR->HasConstituency ) {
     # Queue {Comment,Correspond}Address for multiple constituencies

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list