Skip to content

Commit

Permalink
Merge branch '5.0/queue-list-limit-status-by-argument' into 5.0-trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrandtbuffalo committed Nov 21, 2023
2 parents 65747b9 + ddcd842 commit 6aa4d26
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions share/html/Elements/QueueSummaryByLifecycle
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,25 @@ my $build_search_link = sub {

return RT->Config->Get('WebPath')
. "/Search/Results.html?Query="
. $m->interp->apply_escapes("Queue = '$queue_name' AND $extra_query", 'u');
. $m->interp->apply_escapes("Queue = '$queue_name' " . ( $extra_query ? "AND $extra_query" : '' ), 'u');
};

my $has_active = grep { $_ eq 'active' } @Statuses;
my $has_inactive = grep { $_ eq 'inactive' } @Statuses;
my $all_query;
if ( $has_active && $has_inactive ) {
$all_query = '';
}
elsif ($has_active) {
$all_query = "Status = '__Active__'";
}
elsif ($has_inactive) {
$all_query = "Status = '__Inactive__'";
}

my $link_all = sub {
my ($queue) = @_;
return $build_search_link->($queue->{Name}, "Status = '__Active__'");
return $build_search_link->($queue->{Name}, $all_query);
};

my $link_status = sub {
Expand Down Expand Up @@ -135,7 +148,7 @@ my $statuses = {};
use RT::Report::Tickets;
my $report = RT::Report::Tickets->new( RT->SystemUser );
my $query =
"(Status = '__Active__') AND (".
( $all_query ? "( $all_query ) AND " : '' ) . "(".
join(' OR ', map "Queue = ".$_->{Id}, @$queues)
.")";
$query = 'id < 0' unless @$queues;
Expand Down

0 comments on commit 6aa4d26

Please sign in to comment.