rt 4.0.23
[freeside.git] / rt / share / html / REST / 1.0 / Forms / ticket / history
index c2aa35a..8bbb5b7 100755 (executable)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
@@ -54,7 +54,7 @@ $format => undef
 $fields => undef
 </%ARGS>
 <%INIT>
-my $ticket = new RT::Ticket $session{CurrentUser};
+my $ticket = RT::Ticket->new($session{CurrentUser});
 my ($c, $o, $k, $e) = ("", [], {}, "");
 
 $ticket->Load($id);
@@ -100,7 +100,7 @@ if ($type) {
 
 if ($tid) {
     my @data;
-    my $t = new RT::Transaction $session{CurrentUser};
+    my $t = RT::Transaction->new($session{CurrentUser});
     
     # this paragraph limits the transaction ID query to transactions on this ticket. 
     # Otherwise you can query any transaction from any ticket, which makes no sense.
@@ -137,7 +137,7 @@ if ($tid) {
 
 
     if (!%$fields || exists $fields->{lc 'Content'}) {    
-       my $creator = new RT::User $session{CurrentUser};
+       my $creator = RT::User->new($session{CurrentUser});
        $creator->Load($t->Creator);
        push @data, [ Creator    => $creator->Name   ];
     }
@@ -151,7 +151,8 @@ if ($tid) {
            my $size = length($a->Content||'');
            if ($size > 1024) { $size  = int($size/102.4)/10 . "k" }
            else              { $size .= "b" }
-           $attachlist .= "\n" . $a->Id.": ".($a->Filename || "untitled")." (".$size.")";
+            my $name = (defined $a->Filename and length $a->Filename) ? $a->Filename : "untitled";
+            $attachlist .= "\n" . $a->Id.": $name ($size)";
        }
        
        push @data, [Attachments => $attachlist];