show unreplied marker in RT searches, #41670
authorMark Wells <mark@freeside.biz>
Sat, 11 Jun 2016 19:24:29 +0000 (12:24 -0700)
committerMark Wells <mark@freeside.biz>
Mon, 13 Jun 2016 20:19:54 +0000 (13:19 -0700)
rt/lib/RT/Ticket_Vendor.pm
rt/share/html/Elements/CollectionAsTable/Row
rt/share/html/NoAuth/css/freeside3/ticket-lists.css

index a55bb7b..4a78838 100644 (file)
@@ -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;
index b83943a..13f43dd 100644 (file)
@@ -57,6 +57,11 @@ $Class     => 'RT__Ticket'
 $Classes => ''
 </%ARGS>
 <%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(  '<tr class="' . $Classes . ' '
         . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >'
         . "\n" );
index 84c9a92..257cf3b 100644 (file)
@@ -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;