summaryrefslogtreecommitdiff
path: root/rt/share/html
diff options
context:
space:
mode:
authormark <mark>2011-01-01 00:47:01 +0000
committermark <mark>2011-01-01 00:47:01 +0000
commitc587b5fdc7175c2a752558efccfc3f424cff6c0d (patch)
treef065f2c68393c0300af30b0d5d1889ee7134756f /rt/share/html
parent0bebde603df97eb496150e80a58755b2f792f64a (diff)
limit ticket creation queue dropdowns based on ACL, RT#7778
Diffstat (limited to 'rt/share/html')
-rwxr-xr-xrt/share/html/Elements/SelectQueue17
-rwxr-xr-xrt/share/html/Ticket/Create.html1
2 files changed, 14 insertions, 4 deletions
diff --git a/rt/share/html/Elements/SelectQueue b/rt/share/html/Elements/SelectQueue
index c78afe9ce..5b146a7f6 100755
--- a/rt/share/html/Elements/SelectQueue
+++ b/rt/share/html/Elements/SelectQueue
@@ -55,7 +55,7 @@
% if ($ShowNullOption) {
<option value="">-</option>
% }
-% for my $queue (@{$session{$cache_key}}) {
+% for my $queue (@{$session{$cache_key}{queues}}) {
<option value="<% ($NamedValues ? $queue->{Name} : $queue->{Id}) %>"
% if ($queue->{Id} eq ($Default||'') || $queue->{Name} eq ($Default||'')) {
@@ -90,18 +90,27 @@ my $cache_key = "SelectQueue---"
. $session{'CurrentUser'}->Id
. "---$CheckQueueRight---$ShowAllQueues";
-if (not defined $session{$cache_key} and not $Lite) {
+if ( defined $session{$cache_key} && ref $session{$cache_key} eq 'ARRAY') {
+ delete $session{$cache_key};
+}
+if ( defined $session{$cache_key} &&
+ $session{$cache_key}{lastupdated} <= RT->System->QueueCacheNeedsUpdate ) {
+ delete $session{$cache_key};
+}
+
+if ( not defined $session{$cache_key} and not $Lite ) {
my $q = new RT::Queues($session{'CurrentUser'});
$q->UnLimit;
-
+
while (my $queue = $q->Next) {
if ($ShowAllQueues || $queue->CurrentUserHasRight($CheckQueueRight)) {
- push @{$session{$cache_key}}, {
+ push @{$session{$cache_key}{queues}}, {
Id => $queue->Id,
Name => $queue->Name,
Description => $queue->Description,
};
}
}
+ $session{$cache_key}{lastupdated} = time();
}
</%init>
diff --git a/rt/share/html/Ticket/Create.html b/rt/share/html/Ticket/Create.html
index 094b5a0a9..33e933da0 100755
--- a/rt/share/html/Ticket/Create.html
+++ b/rt/share/html/Ticket/Create.html
@@ -70,6 +70,7 @@
Name => 'Queue',
Default => $QueueObj->Name,
ShowNullOption => 0,
+ ShowAllQueues => 0,
OnChange => "document.getElementsByName('id')[0].value = ''; form.submit()" &>
</td>
<td class="label"><&|/l&>Status</&>: