[Rt-commit] [rtir] 10/18: Restore NamedValues support to SelectRTIRQueue

Jesse Vincent jesse at bestpractical.com
Wed Mar 11 03:36:46 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 35ba31b3ba30e89379feed52d270562d321abbc6
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Mar 10 21:27:46 2015 -0700

    Restore NamedValues support to SelectRTIRQueue
---
 html/RTIR/Elements/SelectRTIRQueue | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/html/RTIR/Elements/SelectRTIRQueue b/html/RTIR/Elements/SelectRTIRQueue
index 51bf29f..802edac 100644
--- a/html/RTIR/Elements/SelectRTIRQueue
+++ b/html/RTIR/Elements/SelectRTIRQueue
@@ -50,7 +50,7 @@
   <option value=""><% $DefaultLabel %></option>
 %     }
 %     for my $object (@{$session{$cache_key}{objects}}) {
-  <option value="<%  $object->{Id} %>"\
+  <option value="<%   ($NamedValues ? $object->{Name} : $object->{Id}) %>"\
 % if ($object->{Id} eq ($Default||'') || $object->{Name} eq ($Default||'')) {
  selected="selected"\
 % }
@@ -59,6 +59,7 @@
 %     }
 </select>
 <%args>
+$NamedValues => 0
 $CheckRight => 'CreateTicket'
 $ShowNullOption => 0
 $ShowAll => 1
@@ -67,13 +68,12 @@ $DefaultLabel => "-"
 $Default => 0
 $OnChange => undef
 $CacheNeedsUpdate => RT->System->QueueCacheNeedsUpdate
-$Lifecycle => undef
+$Lifecycle => ''
 $LimitToConstituency => 0
 $Constituency => undef
 </%args>
 <%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 ||""),
     $session{'CurrentUser'}->Id, $CheckRight || "", $ShowAll;
@@ -88,7 +88,11 @@ if ( defined $session{$cache_key} && defined $CacheNeedsUpdate &&
 
 if ( not defined $session{$cache_key} ) {
     my $collection = RT::Queues->new($session{'CurrentUser'});
-    $collection->Limit(FIELD => 'Lifecycle', VALUE => $Lifecycle);
+    if ($Lifecycle) {
+        $collection->Limit(FIELD => 'Lifecycle', VALUE => $Lifecycle);
+    } else {
+        $collection->UnLimit();
+    }
     $m->callback( CallbackName => 'ModifyCollection', ARGSRef => \%ARGS,
                   Collection => $collection );
 
@@ -110,8 +114,8 @@ if ( not defined $session{$cache_key} ) {
     }
 
     while (my $object = $collection->Next) {
-
-        next if ($LimitToConstituency && ($object->FirstCustomFieldValue('RTIR Constituency') ||'') 
+        next if ($LimitToConstituency && 
+            ($object->FirstCustomFieldValue('RTIR Constituency') ||'') 
             ne ($Constituency||''));
         if ($ShowAll
             or not $CheckRight

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


More information about the rt-commit mailing list