X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FTicket%2FElements%2FShowQueue;h=59e39b8d173532de235f5450f796765d5f1d2ac0;hb=de9d037528895f7151a9aead6724ce2df95f9586;hp=6742d4a72c9de516be375a024c4a9812461dcd8f;hpb=fc6209f398899f0211cfcedeb81a3cd65e04a941;p=freeside.git diff --git a/rt/share/html/Ticket/Elements/ShowQueue b/rt/share/html/Ticket/Elements/ShowQueue index 6742d4a72..59e39b8d1 100644 --- a/rt/share/html/Ticket/Elements/ShowQueue +++ b/rt/share/html/Ticket/Elements/ShowQueue @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -45,12 +45,30 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<% $QueueObj->Name %> +% if ( $query ) { +<% $value %> +% } else { +<% $value %> +% } <%ARGS> +$Ticket => undef $QueueObj <%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 unless defined $value && length $value;