[Rt-commit] [rtir] 04/22: When setting a default RTIR queue and no default constituency, intuit the default constituency from the default queue

Jesse Vincent jesse at bestpractical.com
Sun Mar 29 02:50:57 EDT 2015


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

jesse pushed a commit to branch 3.4/remove_old_constituencies
in repository rtir.

commit c74bc57edc0725d8bd7580d6c4429671e66c80ab
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Sat Mar 28 16:32:24 2015 -0700

    When setting a default RTIR queue and no default constituency,
    intuit the default constituency from the default queue
---
 html/RTIR/Elements/SelectRTIRQueue | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/html/RTIR/Elements/SelectRTIRQueue b/html/RTIR/Elements/SelectRTIRQueue
index 76c7aa0..5959c08 100644
--- a/html/RTIR/Elements/SelectRTIRQueue
+++ b/html/RTIR/Elements/SelectRTIRQueue
@@ -75,7 +75,7 @@ $Constituency => undef
 <%init>
 my $Class    = "select-rtir-queue-".$Lifecycle;
 # XXX TODO This cache will need to take constituency into account
-my $cache_key = join "---", "SelectObject", 'rtir-queue-'.$Lifecycle,$LimitToConstituency, ($Constituency ||""),
+my $cache_key = join "---", "SelectObject", 'rtir-queue-'.$Lifecycle,$LimitToConstituency, ($Constituency ||""),$Default,
     $session{'CurrentUser'}->Id, $CheckRight || "", $ShowAll;
 
 if ( defined $session{$cache_key} && ref $session{$cache_key} eq 'ARRAY') {
@@ -87,6 +87,13 @@ if ( defined $session{$cache_key} && defined $CacheNeedsUpdate &&
 }
 
 if ( not defined $session{$cache_key} ) {
+
+    if ($Default && $LimitToConstituency && !$Constituency) {
+        my $default_queue= RT::Queue->new($session{'CurrentUser'});
+        $default_queue->Load($Default);
+        $Constituency = RT::IR->ConstituencyFor($default_queue);
+    }
+
     my $collection = RT::Queues->new($session{'CurrentUser'});
     if ($Lifecycle) {
         $collection->Limit(FIELD => 'Lifecycle', VALUE => $Lifecycle);

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


More information about the rt-commit mailing list