X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FSelectQueue;h=16ffb82dfc89154cdfbc2bd757c631456d0eab1a;hp=0cfdd915d9eaf005d221f0d662d1d04ff6e48ae2;hb=01721976fa3324f41a3093cda68bc38a7eec5ff5;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924 diff --git a/rt/share/html/Elements/SelectQueue b/rt/share/html/Elements/SelectQueue index 0cfdd915d..16ffb82df 100755 --- a/rt/share/html/Elements/SelectQueue +++ b/rt/share/html/Elements/SelectQueue @@ -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,72 +45,14 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -% if ($Lite) { -% my $d = new RT::Queue($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 -$Default => 0 -$Lite => 0 -$OnChange => undef -$Multiple => 0 -$Class => 'select-queue' -<%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 ( 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}{queues}}, { - Id => $queue->Id, - Name => $queue->Name, - Description => $queue->Description, - }; - } - } - $session{$cache_key}{lastupdated} = time(); -} -