[Rt-commit] r19294 - rtir/2.5/trunk/lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Mon Apr 20 10:49:10 EDT 2009


Author: ruz
Date: Mon Apr 20 10:49:09 2009
New Revision: 19294

Modified:
   rtir/2.5/trunk/lib/RT/IR.pm

Log:
* add OurQueue method to the RT::IR

Modified: rtir/2.5/trunk/lib/RT/IR.pm
==============================================================================
--- rtir/2.5/trunk/lib/RT/IR.pm	(original)
+++ rtir/2.5/trunk/lib/RT/IR.pm	Mon Apr 20 10:49:09 2009
@@ -63,6 +63,24 @@
 use RT::IR::Config;
 RT::IR::Config::Init();
 
+my @QUEUES = ('Incidents', 'Incident Reports', 'Investigations', 'Blocks');
+my %QUEUES = map { lc($_) => $_ } @QUEUES;
+my %TYPE = (
+    'incidents'        => 'Incident',
+    'incident reports' => 'Report',
+    'investigations'   => 'Investigation',
+    'blocks'           => 'Block',
+);
+my %STATES = (
+    'incidents'        => { Active => ['open'], Inactive => ['resolved', 'abandoned'] },
+    'incident reports' => { Active => ['new', 'open'], Inactive => ['resolved', 'rejected'] },
+    'investigations'   => { Active => ['open'], Inactive => ['resolved'] },
+    'blocks'           => {
+        Active => ['pending activation', 'active', 'pending removal'],
+        Inactive => ['removed'],
+    },
+);
+
 =head1 FUNCTIONS
 
 =head2 BusinessHours
@@ -126,6 +144,17 @@
     return $SLAObj;
 }
 
+=head2 OurQueue
+
+=cut
+
+sub OurQueue {
+    my $self = shift;
+    my $queue = shift;
+    $queue = $queue->Name if ref $queue;
+    return $QUEUES{ lc $queue }? 1 : 0;
+}
+
 =head2 TicketType
 
 Returns type of a ticket. Takes either Ticket or Queue argument.
@@ -135,13 +164,6 @@
 
 =cut
 
-my %TYPE = (
-    'incidents'        => 'Incident',
-    'incident reports' => 'Report',
-    'investigations'   => 'Investigation',
-    'blocks'           => 'Block',
-);
-
 sub TicketType {
     my %arg = ( Queue => undef, Ticket => undef, @_);
 
@@ -178,15 +200,6 @@
 
 =cut
 
-my %STATES = (
-    'incidents'        => { Active => ['open'], Inactive => ['resolved', 'abandoned'] },
-    'incident reports' => { Active => ['new', 'open'], Inactive => ['resolved', 'rejected'] },
-    'investigations'   => { Active => ['open'], Inactive => ['resolved'] },
-    'blocks'           => {
-        Active => ['pending activation', 'active', 'pending removal'],
-        Inactive => ['removed'],
-    },
-);
 sub States {
     my %arg = ( Queue => undef, Active => 1, Inactive => 0, @_ );
 


More information about the Rt-commit mailing list