[Rt-commit] rt branch, 4.2/show-queue-name-link, created. rt-4.2.12-58-g220d4b6

? sunnavy sunnavy at bestpractical.com
Tue Oct 6 13:34:38 EDT 2015


The branch, 4.2/show-queue-name-link has been created
        at  220d4b671c10dba4bbdb5c8659dca0dea5251acf (commit)

- Log -----------------------------------------------------------------
commit 220d4b671c10dba4bbdb5c8659dca0dea5251acf
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Oct 7 01:30:16 2015 +0800

    link queue name to active tickets search on ticket display page

diff --git a/share/html/Ticket/Elements/ShowQueue b/share/html/Ticket/Elements/ShowQueue
index d6b298a..94901d9 100644
--- a/share/html/Ticket/Elements/ShowQueue
+++ b/share/html/Ticket/Elements/ShowQueue
@@ -45,18 +45,28 @@
 %# 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

-----------------------------------------------------------------------


More information about the rt-commit mailing list