X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FSelectQueue;h=9fdca7412cff4bf9d0521131dffa6ec007f48f5a;hb=44dd00a3ff974a17999e86e64488e996edc71e3c;hp=76440d1241019eb86f5bf5fddf2f94d8f5c3b2d6;hpb=73a6a80a9ca5edbd43d139b7cb25bfee4abfd35e;p=freeside.git diff --git a/rt/share/html/Elements/SelectQueue b/rt/share/html/Elements/SelectQueue index 76440d124..9fdca7412 100755 --- a/rt/share/html/Elements/SelectQueue +++ b/rt/share/html/Elements/SelectQueue @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -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' -<%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(); -} -