diff options
Diffstat (limited to 'rt/share/html/Elements/SelectQueue')
-rwxr-xr-x | rt/share/html/Elements/SelectQueue | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/rt/share/html/Elements/SelectQueue b/rt/share/html/Elements/SelectQueue index acd73ae56..0cfdd915d 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> |