From: Mark Wells Date: Sat, 11 Jun 2016 19:24:29 +0000 (-0700) Subject: show unreplied marker in RT searches, #41670 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=89507319807e2f988bffa25981d4df927000f9eb show unreplied marker in RT searches, #41670 --- diff --git a/rt/lib/RT/Ticket_Vendor.pm b/rt/lib/RT/Ticket_Vendor.pm index a55bb7b0d..4a7883888 100644 --- a/rt/lib/RT/Ticket_Vendor.pm +++ b/rt/lib/RT/Ticket_Vendor.pm @@ -92,5 +92,28 @@ sub WillResolveAsString { return $self->WillResolveObj->AsString(); } +=head2 IsUnreplied + +Returns true if there's a Correspond or Create transaction more recent than +the Told date of this ticket (or the ticket has no Told date) and the ticket +is not rejected or resolved. + +=cut + +sub IsUnreplied { + my $self = shift; + return 0 if $self->Status eq 'resolved' + or $self->Status eq 'rejected'; + + my $Told = $self->Told || '1970-01-01'; + my $Txns = $self->Transactions; + $Txns->Limit(FIELD => 'Type', + OPERATOR => 'IN', + VALUE => [ 'Correspond', 'Create' ]); + $Txns->Limit(FIELD => 'Created', + OPERATOR => '>', + VALUE => $Told); + $Txns->Count ? 1 : 0; +} 1; diff --git a/rt/share/html/Elements/CollectionAsTable/Row b/rt/share/html/Elements/CollectionAsTable/Row index deaa312ba..4b2cfae43 100644 --- a/rt/share/html/Elements/CollectionAsTable/Row +++ b/rt/share/html/Elements/CollectionAsTable/Row @@ -57,6 +57,11 @@ $Class => 'RT__Ticket' $Classes => '' <%init> +# it's a hack, but it has to be applied in every ticket search regardless +# of format, so... +if ( $record and $record->isa('RT::Ticket') and $record->IsUnreplied ) { + $Classes .= ' unreplied-ticket'; +} $m->out( '' . "\n" ); diff --git a/rt/share/static/css/freeside3/ticket-lists.css b/rt/share/static/css/freeside3/ticket-lists.css index 84c9a92de..257cf3b07 100644 --- a/rt/share/static/css/freeside3/ticket-lists.css +++ b/rt/share/static/css/freeside3/ticket-lists.css @@ -99,8 +99,18 @@ tr.collection-as-table+tr.collection-as-table th { } - - +tr.unreplied-ticket > :first-child::before { + /* green dot */ + border: 1px solid black; + border-radius: 50%; + display: inline-block; + height: 1ex; + width: 1ex; + float: left; + content: ''; + margin-top: 1ex; + background-color: green; +} table.queue-summary td { background: #efefef; diff --git a/rt/share/static/css/freeside4/ticket-lists.css b/rt/share/static/css/freeside4/ticket-lists.css index cdf10193a..42b343b7c 100644 --- a/rt/share/static/css/freeside4/ticket-lists.css +++ b/rt/share/static/css/freeside4/ticket-lists.css @@ -81,6 +81,20 @@ table.collection-as-table.chart th { border-bottom: 2px solid #ccc } +tr.unreplied-ticket > :first-child::before { + /* green dot */ + border: 1px solid black; + border-radius: 50%; + display: inline-block; + height: 1ex; + width: 1ex; + float: left; + content: ''; + margin-top: 0 auto; + margin-bottom: 0 auto; + background-color: green; +} + table.queue-summary td { background: #efefef; border-bottom: 1px solid #ccc;