ClipSubjectInTicketList

From Request Tracker Wiki
Revision as of 16:03, 6 April 2016 by Admin (talk | contribs) (2 revisions imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The purpose of this patch is to take care of really-long-subject-lines-without-a-break that would otherwise cause the browser to display horizontal scrollbars.

--- share/html/Elements/CollectionAsTable/Row   2004-08-31 00:22:49.000000000 -0400
+++ local/html/Elements/CollectionAsTable/Row   2006-06-02 09:25:43.942609152 -0400
@@ -51,6 +51,9 @@
     foreach my $subcol ( @{ $column->{output} } ) {
         if ( $subcol =~ /^__(.*?)__$/o ) {
             my $col = $1;
+            if ($col =~ /Subject/) {
+                $m->out ('<div style="width:100%; overflow: hidden;">');
+            }
             my $value = $m->comp('/Elements/RT__Ticket/ColumnMap', Name => $col, Attr => 'value');

             if ( $value && ref($value)) {
@@ -58,6 +61,9 @@
             } else {
                 $m->out($value );
             }
+            if ($col =~ /Subject/) {
+                $m->out ('</div>');
+            }
         }
         else {
             $m->out( Encode::decode_utf8($subcol) );