X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FSelectQueue;h=ae645a773b9ae5f36138a33c664869b5801ddb1d;hb=6799b211d676af19ca6156c7b5e4e8ee401438f0;hp=76440d1241019eb86f5bf5fddf2f94d8f5c3b2d6;hpb=2c09925cad2ade037e6ae953e4ed6fc056811f2f;p=freeside.git
diff --git a/rt/share/html/Elements/SelectQueue b/rt/share/html/Elements/SelectQueue
index 76440d124..ae645a773 100755
--- a/rt/share/html/Elements/SelectQueue
+++ b/rt/share/html/Elements/SelectQueue
@@ -45,92 +45,14 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-% if ($Lite) {
-% my $d = RT::Queue->new($session{'CurrentUser'});
-% $d->Load($Default);
-
-% }
-% else {
-
-% }
+<& SelectObject,
+ %ARGS,
+ ObjectType => "Queue",
+ CheckRight => $CheckQueueRight,
+ ShowAll => $ShowAllQueues,
+ CacheNeedsUpdate => RT->System->QueueCacheNeedsUpdate,
+ &>
<%args>
$CheckQueueRight => 'CreateTicket'
-$ShowNullOption => 1
$ShowAllQueues => 1
-$Name => undef
-$Verbose => undef
-$NamedValues => 0
-$DefaultLabel => "-"
-$Default => 0
-$Lite => 0
-$OnChange => undef
-$Multiple => 0
-$Size => 6
-$Class => 'select-queue'
%args>
-<%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;
-
- if ( $Default ) {
- my $d = RT::Queue->new($session{'CurrentUser'});
- $d->Load($Default);
- unless ( $d->CurrentUserHasRight('SeeQueue') ) {
- if ( $d->id ) {
- push @{$session{$cache_key}{queues}}, {
- Id => $d->id,
- Name => '#' . $d->id,
- Description => '#' . $d->id,
- };
- }
- }
- }
-
- 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>