[Rt-devel] PATCH: silence warnings Ticket/Elements/ShowTransactionAttachments

Jim Meyer purp at acm.org
Wed Nov 16 16:02:27 EST 2005


Attached. Problem was a premature stringification and localization for
display so I separated the display item from the number for later
comparison.

--j
-- 
Jim Meyer, Geek at Large                  jmeyer at dreamworksanimation.com
-------------- next part --------------
--- share/html/Ticket/Elements/ShowTransactionAttachments	2005-07-09 11:52:35.000000000 -0700
+++ local/html/Ticket/Elements/ShowTransactionAttachments	2005-11-16 12:57:44.000000000 -0800
@@ -63,26 +63,27 @@
 
     # }}}
     # {{{ if there's any size at all, show the download link
     my $size = $message->ContentLength;
+    my $size_name = '';
     if ($size) {
         
 </%perl> 
 <div class="downloadattachment">
 <%perl>
 
      #     show a download link
      if ( $size > 1024 ) {
-         $size = loc( "[_1]k", int( $size / 102.4 ) / 10 );
+         $size_name = loc( "[_1]k", int( $size / 102.4 ) / 10 );
      }
      else {
-        $size = loc( "[_1]b", $size );
+        $size_name = loc( "[_1]b", $size );
      }
         
 </%PERL> 
 <a href="<%$AttachPath%>/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename | u%>"><&|/l&>Download</&> <%$message->Filename || loc('(untitled)') %></a>
 <span class="downloadcontenttype">
-[<%$message->ContentType%> <% $size %>]
+[<%$message->ContentType%> <% $size_name %>]
 </span> 
 </div>
 % }
 % # }}}


More information about the Rt-devel mailing list