diff options
author | Mark Wells <mark@freeside.biz> | 2016-06-11 23:19:11 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2016-06-13 13:31:13 -0700 |
commit | 93e64d8dec78c90f4a65249f5294c736b6129a9c (patch) | |
tree | 937da7866957cf13d512af94cfb99099befbc0bd /rt | |
parent | 9ff504a21d361a27997e94e74908ab663a57f207 (diff) |
show unreplied ticket marker in queue summary, #41670
Diffstat (limited to 'rt')
-rw-r--r-- | rt/lib/RT/Search/UnrepliedTickets.pm | 15 | ||||
-rw-r--r-- | rt/share/html/Elements/QueueSummaryByLifecycle | 24 | ||||
-rw-r--r-- | rt/share/html/NoAuth/css/freeside3/ticket-lists.css | 2 |
3 files changed, 34 insertions, 7 deletions
diff --git a/rt/lib/RT/Search/UnrepliedTickets.pm b/rt/lib/RT/Search/UnrepliedTickets.pm index a4fdacd22..1be66869e 100644 --- a/rt/lib/RT/Search/UnrepliedTickets.pm +++ b/rt/lib/RT/Search/UnrepliedTickets.pm @@ -31,16 +31,21 @@ sub Prepare { my $TicketsObj = $self->TicketsObj; # bypass the pre-RT-4.2 TicketRestrictions stuff and just use SearchBuilder - $TicketsObj->RT::SearchBuilder::Limit( - FIELD => 'Owner', - VALUE => $TicketsObj->CurrentUser->id - ); + + # if SystemUser does this search (as in QueueSummaryByLifecycle), they + # should get all tickets regardless of ownership + if ($TicketsObj->CurrentUser->id != RT->SystemUser->id) { + $TicketsObj->RT::SearchBuilder::Limit( + FIELD => 'Owner', + VALUE => $TicketsObj->CurrentUser->id + ); + } $TicketsObj->RT::SearchBuilder::Limit( FIELD => 'Status', OPERATOR => '!=', VALUE => 'resolved' ); - $TicketsObj->Limit( + $TicketsObj->RT::SearchBuilder::Limit( FIELD => 'Status', OPERATOR => '!=', VALUE => 'rejected', diff --git a/rt/share/html/Elements/QueueSummaryByLifecycle b/rt/share/html/Elements/QueueSummaryByLifecycle index da31ebb59..6c45cfdea 100644 --- a/rt/share/html/Elements/QueueSummaryByLifecycle +++ b/rt/share/html/Elements/QueueSummaryByLifecycle @@ -66,9 +66,13 @@ for my $queue (@queues) { next if lc($queue->{Lifecycle} || '') ne lc $lifecycle->Name; $i++; + + my $classes = $i%2 ? 'oddline' : 'evenline'; + $classes .= ' unreplied-ticket' if $queue->{Unreplied} > 0; </%PERL> -<tr class="<% $i%2 ? 'oddline' : 'evenline'%>" > +<tr class="<% $classes %>"> +<td></td> <td> <a href="<% $link_all->($queue, \@cur_statuses) %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a> </td> @@ -131,6 +135,24 @@ for my $queue (@queues) { $lifecycle{ lc $cycle->Name } = $cycle; } +use RT::Search::UnrepliedTickets; +my $Tickets = RT::Tickets->new( RT->SystemUser ); +my $Search = RT::Search::UnrepliedTickets->new( TicketsObj => $Tickets ); +$Search->Prepare; + +for my $queue (@queues) { + my $cycle = RT::Lifecycle->Load( Name => $queue->{'Lifecycle'} ); + $lifecycle{ lc $cycle->Name } = $cycle; + + # show whether there are unreplied tickets + # somewhat inefficient but we only use the count query + my $tix = $Tickets->Clone; + $tix->Limit(FIELD => 'Queue', + OPERATOR => '=', + VALUE => $queue->{id}); + $queue->{Unreplied} = $tix->Count; +} + unless (@statuses) { my %seen; foreach my $set ( 'initial', 'active' ) { diff --git a/rt/share/html/NoAuth/css/freeside3/ticket-lists.css b/rt/share/html/NoAuth/css/freeside3/ticket-lists.css index 257cf3b07..efcc2c889 100644 --- a/rt/share/html/NoAuth/css/freeside3/ticket-lists.css +++ b/rt/share/html/NoAuth/css/freeside3/ticket-lists.css @@ -108,7 +108,7 @@ tr.unreplied-ticket > :first-child::before { width: 1ex; float: left; content: ''; - margin-top: 1ex; + margin-right: 1ex; background-color: green; } |