no need for FS calendar buttons in RT 4.2
[freeside.git] / rt / share / html / Elements / SelectQueue
index 0cfdd91..16ffb82 100755 (executable)
@@ -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
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-% if ($Lite) {
-%     my $d = new RT::Queue($session{'CurrentUser'});
-%     $d->Load($Default);
-<input name="<%$Name%>" size="25" value="<%$d->Name%>" class="<%$Class%>" />
-% }
-% else {
-<select name="<%$Name%>" <% ($Multiple) ? 'multiple="multiple"' : '' %> <% ($OnChange) ? 'onchange="'.$OnChange.'"' : '' |n %> class="<%$Class%>">
-%     if ($ShowNullOption) {
-  <option value="">-</option>
-%     }
-%     for my $queue (@{$session{$cache_key}{queues}}) {
-  <option value="<% ($NamedValues ? $queue->{Name} : $queue->{Id}) %>" 
-
-% if ($queue->{Id} eq ($Default||'') || $queue->{Name} eq ($Default||'')) {
- selected="selected"
-% }
-
->
-    <%$queue->{Name}%>
-
-%             if ($Verbose and $queue->{Description}) {
-    (<%$queue->{Description}%>)
-%             }
-  </option>
-%     }
-</select>
-% }
+<& 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'
 </%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 ( 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();
-}
-</%init>