[Rt-commit] r7933 - in rtir/branches/2.3-EXPERIMENTAL: .

jesse at bestpractical.com jesse at bestpractical.com
Fri May 25 15:54:11 EDT 2007


Author: jesse
Date: Fri May 25 15:54:10 2007
New Revision: 7933

Added:
   rtir/branches/2.3-EXPERIMENTAL/html/Callbacks/RTIR/Elements/SelectOwner/
   rtir/branches/2.3-EXPERIMENTAL/html/Callbacks/RTIR/Elements/SelectOwner/UpdateObjectList
Modified:
   rtir/branches/2.3-EXPERIMENTAL/   (props changed)

Log:
 r57117 at pinglin:  jesse | 2007-05-25 15:50:34 -0400
 * Added a callback to make use of the new SelectOwner callback in RT so that we can use constituency to make choices in the SelectOwner dropdown


Added: rtir/branches/2.3-EXPERIMENTAL/html/Callbacks/RTIR/Elements/SelectOwner/UpdateObjectList
==============================================================================
--- (empty file)
+++ rtir/branches/2.3-EXPERIMENTAL/html/Callbacks/RTIR/Elements/SelectOwner/UpdateObjectList	Fri May 25 15:54:10 2007
@@ -0,0 +1,21 @@
+<%args>
+$objects => undef
+</%args>
+<%init>
+
+
+# If we're looking at rights on a particular ticket, then we don't want to add other queues for equivalence.
+foreach my $object (@$objects) {
+    return unless ($object->isa('RT::Queue'));
+}
+my @new_objects;
+foreach my $object (@$objects) {
+    if ($object->isa('RT::Queue') && $object->Name =~ /^(?:Incidents|Investigations|Incident Reports)$/) {
+        my $queues = RT::Queues->new($RT::SystemUser);
+        $queues->Limit(FIELD =>'Name', OPERATOR => 'STARTSWITH', VALUE  => $object->Name);
+        while (my $queue = $queues->Next) { warn "Adding ".$queue->Name; unshift @new_objects,$queue; }
+
+    }
+}
+push @$objects, @new_objects;
+</%init>


More information about the Rt-commit mailing list