rt 4.0.23
[freeside.git] / rt / lib / RT / Rule.pm
index 071f539..3b3e8b7 100644 (file)
@@ -2,7 +2,7 @@
 #
 # COPYRIGHT:
 #
-# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
 #                                          <sales@bestpractical.com>
 #
 # (Except where explicitly superseded by other copyright notices)
 package RT::Rule;
 use strict;
 use warnings;
+
 use base 'RT::Action';
 
 use constant _Stage => 'TransactionCreate';
 use constant _Queue => undef;
 
+
+
 sub Prepare {
     my $self = shift;
-    return (0) if $self->_Queue && $self->TicketObj->QueueObj->Name ne $self->_Queue;
-    return 1;
+    if ( $self->_Queue ) {
+        my $queue = RT::Queue->new( RT->SystemUser );
+        $queue->Load( $self->TicketObj->__Value('Queue') );
+        if ( $queue->Name ne $self->_Queue ) {
+            return (0);
+        }
+        return 1;
+    }
 }
 
 sub Commit  {
@@ -105,14 +114,6 @@ sub RunScripAction {
 
 }
 
-eval "require RT::Rule_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Rule_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Rule_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Rule_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;