[Rt-commit] rt branch, 5.0/queue-list-all-statuses, created. rt-5.0.1-330-g7f53ffa042

? sunnavy sunnavy at bestpractical.com
Tue May 4 13:45:27 EDT 2021


The branch, 5.0/queue-list-all-statuses has been created
        at  7f53ffa0428f3e9cf130817031ae7fe778d9e691 (commit)

- Log -----------------------------------------------------------------
commit 7f53ffa0428f3e9cf130817031ae7fe778d9e691
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed May 5 01:32:26 2021 +0800

    Add QueueListAllStatuses to show tickets info of all statuses

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 9abf52a08d..b1b8b2b78a 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2073,7 +2073,7 @@ user's customized homepage ("RT at a glance").
 Set(
     $HomepageComponents,
     [
-        qw(QuickCreate QueueList MyAdminQueues MySupportQueues MyReminders RefreshHomepage Dashboards SavedSearches FindUser MyAssets FindAsset FindGroup) # loc_qw
+        qw(QuickCreate QueueList QueueListAllStatuses MyAdminQueues MySupportQueues MyReminders RefreshHomepage Dashboards SavedSearches FindUser MyAssets FindAsset FindGroup) # loc_qw
     ]
 );
 
diff --git a/share/html/Elements/QueueList b/share/html/Elements/QueueList
index 6fa9f2c88b..351adb26ae 100644
--- a/share/html/Elements/QueueList
+++ b/share/html/Elements/QueueList
@@ -49,7 +49,7 @@
 
 <div class="ticket-overview">
 <&|/Widgets/TitleBox,
-    title => loc("Queue list"),
+    title => $Title,
     class => "fullwidth",
     bodyclass => "",
     titleright_raw => qq[<span class="fas fa-cog icon-bordered fa-2x" alt="$alt" data-toggle="tooltip" data-placement="top" data-original-title="$alt"></span>],
@@ -57,6 +57,7 @@
 &>
 <& $comp,
    queues => $session{$cache_key}{objects},
+   Statuses => \@Statuses
 &>
 </&>
 </div>
@@ -74,4 +75,6 @@ my $cache_key = SetObjectSessionCache(
 </%INIT>
 <%ARGS>
 $SplitByLifecycle => 1
+ at Statuses => qw/initial active/
+$Title => loc('Queue list')
 </%ARGS>
diff --git a/share/html/Elements/QueueList b/share/html/Elements/QueueListAllStatuses
similarity index 69%
copy from share/html/Elements/QueueList
copy to share/html/Elements/QueueListAllStatuses
index 6fa9f2c88b..6a5f5a105a 100644
--- a/share/html/Elements/QueueList
+++ b/share/html/Elements/QueueListAllStatuses
@@ -45,33 +45,4 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-% my $alt = loc('Edit');
-
-<div class="ticket-overview">
-<&|/Widgets/TitleBox,
-    title => loc("Queue list"),
-    class => "fullwidth",
-    bodyclass => "",
-    titleright_raw => qq[<span class="fas fa-cog icon-bordered fa-2x" alt="$alt" data-toggle="tooltip" data-placement="top" data-original-title="$alt"></span>],
-    titleright_href => RT->Config->Get('WebPath').'/Prefs/QueueList.html',
-&>
-<& $comp,
-   queues => $session{$cache_key}{objects},
-&>
-</&>
-</div>
-<%INIT>
-my $unwanted = $session{'CurrentUser'}->UserObj->Preferences('QueueList', {});
-my $comp = $SplitByLifecycle? '/Elements/QueueSummaryByLifecycle' : '/Elements/QueueSummaryByStatus';
-my $cache_key = SetObjectSessionCache(
-    ObjectType => 'RT::Queue',
-    CheckRight => 'ShowTicket',
-    ShowAll => 0,
-    CacheNeedsUpdate => RT->System->QueueCacheNeedsUpdate,
-    Exclude => $unwanted,
-);
-
-</%INIT>
-<%ARGS>
-$SplitByLifecycle => 1
-</%ARGS>
+<& QueueList, Title => 'Queue list all statuses', Statuses => [qw/initial active inactive/] &>
diff --git a/share/html/Elements/QueueSummaryByLifecycle b/share/html/Elements/QueueSummaryByLifecycle
index d6df74023f..d31309c281 100644
--- a/share/html/Elements/QueueSummaryByLifecycle
+++ b/share/html/Elements/QueueSummaryByLifecycle
@@ -123,7 +123,7 @@ for my $queue (@$queues) {
 
 my @statuses;
 my %seen;
-foreach my $set ( 'initial', 'active' ) {
+foreach my $set ( @Statuses ) {
     foreach my $lifecycle ( map $lifecycle{$_}, sort keys %lifecycle ) {
         push @statuses, grep !$seen{ lc $_ }++, $lifecycle->Valid($set);
     }
@@ -149,4 +149,5 @@ while ( my $entry = $report->Next ) {
 </%INIT>
 <%ARGS>
 $queues => undef  # Arrayref of hashes with cached queue info
+ at Statuses => qw/initial active/
 </%ARGS>

-----------------------------------------------------------------------


More information about the rt-commit mailing list