diff options
author | Mark Wells <mark@freeside.biz> | 2016-06-11 23:19:11 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2016-06-11 23:19:11 -0700 |
commit | 3930c1746e7743bf4e9e9ae2f103b6275b0fb728 (patch) | |
tree | c691aee45351a19befc8c354cea9fdc97fd8c32e /rt | |
parent | c3217834a42fa68de630a2d6d518742f94714aed (diff) |
show unreplied ticket marker in queue summary, #41670
Diffstat (limited to 'rt')
-rw-r--r-- | rt/lib/RT/Search/UnrepliedTickets.pm | 12 | ||||
-rw-r--r-- | rt/share/html/Elements/QueueSummaryByLifecycle | 24 | ||||
-rw-r--r-- | rt/share/static/css/freeside4/ticket-lists.css | 3 |
3 files changed, 32 insertions, 7 deletions
diff --git a/rt/lib/RT/Search/UnrepliedTickets.pm b/rt/lib/RT/Search/UnrepliedTickets.pm index 4bb59d9e3..12d847a0a 100644 --- a/rt/lib/RT/Search/UnrepliedTickets.pm +++ b/rt/lib/RT/Search/UnrepliedTickets.pm @@ -30,10 +30,14 @@ sub Prepare { my $self = shift; my $TicketsObj = $self->TicketsObj; - $TicketsObj->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->Limit( + FIELD => 'Owner', + VALUE => $TicketsObj->CurrentUser->id + ); + } $TicketsObj->Limit( FIELD => 'Status', OPERATOR => '!=', diff --git a/rt/share/html/Elements/QueueSummaryByLifecycle b/rt/share/html/Elements/QueueSummaryByLifecycle index f21cb20c3..d6ed1e678 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> @@ -134,6 +138,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/static/css/freeside4/ticket-lists.css b/rt/share/static/css/freeside4/ticket-lists.css index 42b343b7c..3d4706fd2 100644 --- a/rt/share/static/css/freeside4/ticket-lists.css +++ b/rt/share/static/css/freeside4/ticket-lists.css @@ -90,8 +90,7 @@ tr.unreplied-ticket > :first-child::before { width: 1ex; float: left; content: ''; - margin-top: 0 auto; - margin-bottom: 0 auto; + margin-right: 1ex; background-color: green; } |