X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FREST%2F1.0%2FForms%2Fticket%2Fhistory;h=8bbb5b733b2d71b8824d654e7064f49751adc36e;hp=c2aa35a8ec62b9fb37e53e13d16f5fb2b517e387;hb=919e930aa9279b3c5cd12b593889cd6de79d67bf;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c diff --git a/rt/share/html/REST/1.0/Forms/ticket/history b/rt/share/html/REST/1.0/Forms/ticket/history index c2aa35a8e..8bbb5b733 100755 --- a/rt/share/html/REST/1.0/Forms/ticket/history +++ b/rt/share/html/REST/1.0/Forms/ticket/history @@ -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 %# %# %# (Except where explicitly superseded by other copyright notices) @@ -54,7 +54,7 @@ $format => undef $fields => undef <%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];