rt 4.0.23
[freeside.git] / rt / share / html / REST / 1.0 / Forms / transaction / default
index 46488d2..27dcb38 100644 (file)
@@ -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)
 %#
 <%ARGS>
 $id
-$args => undef
 $format => undef
 $fields => undef
 </%ARGS>
 <%INIT>
-my $trans = new RT::Transactions $session{CurrentUser};
+my $trans = RT::Transactions->new($session{CurrentUser});
 my ($c, $o, $k, $e) = ("", [], {} , "");
 
-chomp $args;
-my @arglist = split('/', $args);
 my $tid = $id;
 
 $trans->Limit(FIELD => 'Id', OPERATOR => '=', VALUE => $tid);
 
 if ($tid) {
     my @data;
-    my $t = new RT::Transaction $session{CurrentUser};
+    my $t = RT::Transaction->new($session{CurrentUser});
     $t->Load($tid);
     if ($format eq "l") {
       push @data, [ id    => $t->Id   ];
@@ -89,7 +86,7 @@ if ($tid) {
                if (!%$fields || exists $fields->{lc 'Content'});
       
       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   ];
       }
@@ -107,7 +104,8 @@ if ($tid) {
              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];
       }