rt 4.2.13 ticket#13852
[freeside.git] / rt / share / html / Ticket / Elements / ShowQueue
index d6b298a..1e4b444 100644 (file)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
+% if ( $query ) {
+<a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $query |u,n %>"><% $value %></a>
+% } else {
 <% $value %>
+% }
 <%ARGS>
 $Ticket => undef
 $QueueObj
 </%ARGS>
 <%INIT>
 my $value = $QueueObj->Name;
+my $query;
 
 if ( $Ticket and $Ticket->CurrentUserHasRight('SeeQueue') ) {
     # Grab the queue name anyway if the current user can
     # see the queue based on his role for this ticket
     $value = $QueueObj->__Value('Name');
+    if ( $session{CurrentUser}->Privileged ) {
+        my @statuses = $QueueObj->ActiveStatusArray();
+        s{(['\\])}{\\$1}g for @statuses;
+        $query = "Queue = " . $QueueObj->id . " AND ( ". join(" OR ", map {"Status = '$_'"} @statuses) . " )";
+    }
 }
 
 $value = '#'. $QueueObj->id