X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FSelectQueue;h=f7eda48d340aa1e4cb15af25d7f4f5b1189fa860;hb=7322f2afedcc2f427e997d1535a503613a83f088;hp=e5b053b05fd16b45f41caec88b6c93b58ae43bd9;hpb=3d0a1bb06b895c5be6e3f0517d355442a6b1e125;p=freeside.git diff --git a/rt/share/html/Elements/SelectQueue b/rt/share/html/Elements/SelectQueue index e5b053b05..f7eda48d3 100755 --- a/rt/share/html/Elements/SelectQueue +++ b/rt/share/html/Elements/SelectQueue @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -45,78 +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' -<%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(); -} -