rt 4.2.16
[freeside.git] / rt / share / html / REST / 1.0 / Forms / ticket / history
index debfcc8..536d8b0 100755 (executable)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
@@ -101,61 +101,61 @@ if ($type) {
 if ($tid) {
     my @data;
     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.
     my $Transactions = $ticket->Transactions;
     my $tok=0;
     while (my $T = $Transactions->Next()) {
-       $tok=1 if ($T->Id == $tid)
+        $tok=1 if ($T->Id == $tid)
     }
     if ($tok) {
-       $t->Load($tid);
+        $t->Load($tid);
     } else {
-       return [ "# Transaction $tid is not related to Ticket $id", [], {}, 1 ];
+        return [ "# Transaction $tid is not related to Ticket $id", [], {}, 1 ];
     }
 
     push @data, [ id    => $t->Id   ];
     push @data, [ Ticket    => $t->Ticket   ]
-       if (!%$fields || exists $fields->{lc 'Ticket'});
+        if (!%$fields || exists $fields->{lc 'Ticket'});
     push @data, [ TimeTaken    => $t->TimeTaken   ]
-       if (!%$fields || exists $fields->{lc 'TimeTaken'});
+        if (!%$fields || exists $fields->{lc 'TimeTaken'});
     push @data, [ Type    => $t->Type   ]
-       if (!%$fields || exists $fields->{lc 'Type'});
+        if (!%$fields || exists $fields->{lc 'Type'});
     push @data, [ Field    => $t->Field   ]
-       if (!%$fields || exists $fields->{lc 'Field'});
+        if (!%$fields || exists $fields->{lc 'Field'});
     push @data, [ OldValue    => $t->OldValue   ]
-       if (!%$fields || exists $fields->{lc 'OldValue'});
+        if (!%$fields || exists $fields->{lc 'OldValue'});
     push @data, [ NewValue    => $t->NewValue   ]
-       if (!%$fields || exists $fields->{lc 'NewValue'});
+        if (!%$fields || exists $fields->{lc 'NewValue'});
     push @data, [ Data    => $t->Data   ]
-       if (!%$fields || exists $fields->{lc 'Data'});
+        if (!%$fields || exists $fields->{lc 'Data'});
     push @data, [ Description    => $t->Description   ]
-       if (!%$fields || exists $fields->{lc 'Description'});
+        if (!%$fields || exists $fields->{lc 'Description'});
     push @data, [ Content    => $t->Content   ]
-       if (!%$fields || exists $fields->{lc 'Content'});
+        if (!%$fields || exists $fields->{lc 'Content'});
 
 
-    if (!%$fields || exists $fields->{lc 'Content'}) {    
-       my $creator = RT::User->new($session{CurrentUser});
-       $creator->Load($t->Creator);
-       push @data, [ Creator    => $creator->Name   ];
+    if (!%$fields || exists $fields->{lc 'Content'}) {
+        my $creator = RT::User->new($session{CurrentUser});
+        $creator->Load($t->Creator);
+        push @data, [ Creator    => $creator->Name   ];
     }
     push @data, [ Created    => $t->Created   ]
-       if (!%$fields || exists $fields->{lc 'Created'});
+        if (!%$fields || exists $fields->{lc 'Created'});
 
     if (!%$fields || exists $fields->{lc 'Attachments'}) {
-       my $attachlist;
-       my $attachments = $t->Attachments;
-       while (my $a = $attachments->Next) {
-           my $size = length($a->Content||'');
-           if ($size > 1024) { $size  = int($size/102.4)/10 . "k" }
-           else              { $size .= "b" }
+        my $attachlist;
+        my $attachments = $t->Attachments;
+        while (my $a = $attachments->Next) {
+            my $size = length($a->Content||'');
+            if ($size > 1024) { $size  = int($size/102.4)/10 . "k" }
+            else              { $size .= "b" }
             my $name = (defined $a->Filename and length $a->Filename) ? $a->Filename : "untitled";
             $attachlist .= "\n" . $a->Id.": $name ($size)";
-       }
-       
-       push @data, [Attachments => $attachlist];
+        }
+        
+        push @data, [Attachments => $attachlist];
     }
 
     my %k = map {@$_} @data;
@@ -168,31 +168,31 @@ if ($tid) {
     $format = "l" if (%$fields);
 
     while (my $t = $trans->Next) {
-       my $tid = $t->Id;
-
-       if ($format eq "l") {
-           $tids .= "," if $tids;
-           $tids .= $tid;
-       } else {
-           push @$o, $tid;
-           $k->{$tid} = $t->Description;
-       }
+        my $tid = $t->Id;
+
+        if ($format eq "l") {
+            $tids .= "," if $tids;
+            $tids .= $tid;
+        } else {
+            push @$o, $tid;
+            $k->{$tid} = $t->Description;
+        }
     }
 
     if ($format eq "l") {
-       my @tid;
-       push @tid, "ticket/$id/history/id/$tids";
-       my $fieldstring;
-       foreach my $key (keys %$fields) {
-           $fieldstring .= "," if $fieldstring;
-           $fieldstring .= $key;
-       }
-       my ($content, $forms);
-       $m->subexec("/REST/1.0/show", 
-                   id => \@tid, 
-                   format => $format,
+        my @tid;
+        push @tid, "ticket/$id/history/id/$tids";
+        my $fieldstring;
+        foreach my $key (keys %$fields) {
+            $fieldstring .= "," if $fieldstring;
+            $fieldstring .= $key;
+        }
+        my ($content, $forms);
+        $m->subexec("/REST/1.0/show",
+                    id => \@tid,
+                    format => $format,
                     fields => $fieldstring);
-       return [ $c, $o, $k, $e ];
+        return [ $c, $o, $k, $e ];
     }
 }