Merge branch 'master' of https://github.com/jgoodman/Freeside
[freeside.git] / rt / share / html / Elements / SelectQueue
index b0a191a..7276af0 100755 (executable)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
@@ -107,7 +107,21 @@ if ( defined $session{$cache_key} &&
 if ( not defined $session{$cache_key} and not $Lite ) {
     my $q = RT::Queues->new($session{'CurrentUser'});
     $q->UnLimit;
-    
+
+    if ( $Default ) {
+        my $d = RT::Queue->new($session{'CurrentUser'});
+        $d->Load($Default);
+        unless ( $d->CurrentUserHasRight('SeeQueue') ) {
+            if ( $d->id ) {
+                push @{$session{$cache_key}{queues}}, {
+                    Id          => $d->id,
+                    Name        => '#' . $d->id,
+                    Description => '#' . $d->id,
+                };
+            }
+        }
+    }
+
     while (my $queue = $q->Next) {
         if ($ShowAllQueues || $queue->CurrentUserHasRight($CheckQueueRight)) {
             push @{$session{$cache_key}{queues}}, {