-<%init>
-my $cache_key = "SelectQueue---"
- . $session{'CurrentUser'}->Id
- . "---$CheckQueueRight---$ShowAllQueues";
-
-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 ( 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 = RT::Queues->new($session{'CurrentUser'});
- $q->UnLimit;
-
- while (my $queue = $q->Next) {
- if ($ShowAllQueues || $queue->CurrentUserHasRight($CheckQueueRight)) {
- push @{$session{$cache_key}{queues}}, {
- Id => $queue->Id,
- Name => $queue->Name,
- Description => $queue->Description,
- };
- }
- }
- $session{$cache_key}{lastupdated} = time();
-}
-</%init>