X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=rt%2Fshare%2Fhtml%2FREST%2F1.0%2FForms%2Fticket%2Fhistory;h=0f6d0627aad48177a742c3c32d46cc11ba8b662f;hb=de9d037528895f7151a9aead6724ce2df95f9586;hp=8bbb5b733b2d71b8824d654e7064f49751adc36e;hpb=919e930aa9279b3c5cd12b593889cd6de79d67bf;p=freeside.git diff --git a/rt/share/html/REST/1.0/Forms/ticket/history b/rt/share/html/REST/1.0/Forms/ticket/history index 8bbb5b733..0f6d0627a 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-2015 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC %# %# %# (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 ]; } }