rt 4.2.15
[freeside.git] / rt / share / html / Elements / CollectionAsTable / Row
index b83943a..3b04072 100644 (file)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2018 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
@@ -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" );
@@ -77,7 +82,6 @@ foreach my $column (@Format) {
     }
 
     my $class = $column->{class} ? $m->interp->apply_escapes($column->{class}, 'h') : 'collection-as-table';
-    $m->out(qq{<td class="$class" });
 
     my %attrs;
     foreach my $attr (qw(style align)) {
@@ -130,7 +134,20 @@ foreach my $column (@Format) {
             Arguments => [$record, $i],
         );
     }
-    s/\n/<br \/>/gs for grep defined $_, @out;
+
+    $m->callback(
+        CallbackName => 'EachField',
+        Record       => $record,
+        Format       => \@Format,
+        Column       => $column,
+        Classes      => \$class,
+        Align        => \$attrs{align},
+        Style        => \$attrs{style},
+        Colspan      => \$attrs{colspan},
+        Out          => \@out,
+    );
+
+    $m->out(qq{<td class="$class" });
 
     $m->out( $_ .'="'. $m->interp->apply_escapes( $attrs{$_} => 'h' ) .'"' )
         foreach grep $attrs{$_}, qw(align style colspan);