diff options
Diffstat (limited to 'rt/html/REST/1.0/search/ticket')
-rw-r--r-- | rt/html/REST/1.0/search/ticket | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/rt/html/REST/1.0/search/ticket b/rt/html/REST/1.0/search/ticket index 8f4604d56..0990fd69b 100644 --- a/rt/html/REST/1.0/search/ticket +++ b/rt/html/REST/1.0/search/ticket @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# You should have received a copy of the GNU General Public License %# along with this program; if not, write to the Free Software -%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -62,7 +60,7 @@ my $tickets = new RT::Tickets $session{CurrentUser}; my $field = '[a-zA-Z][a-zA-Z0-9_-]*'; my (%fields, @fields); if ($fields) { - $format ||= "l"; + $format = "l"; unless ($fields =~ /^(?:$field,)*$field$/) { $status = "400 Bad Request"; $output = "Invalid field specification: $fields"; @@ -117,28 +115,14 @@ my @output; while (my $ticket = $tickets->Next) { $n++; - my $id = $ticket->Id; if ($format eq "i") { - $output .= "ticket/" . $id . "\n"; + $output .= "ticket/" . $ticket->Id . "\n"; } elsif ($format eq "s") { - if ($fields) { - my $result = $m->comp("/REST/1.0/Forms/ticket/default", id => $id, format => $format, fields => \%fields); - my ($notes, $order, $key_values, $errors) = @$result; - # If it's the first time through, add our header - if ($n == 1) { - $output .= join("\t",@$order)."\n"; - } - # Cut off the annoying ticket/ before the id; - $key_values->{'id'} = $id; - $output .= join("\t", map {$key_values->{$_}} @$order)."\n"; - - - } else { - $output .= $ticket->Id . ": ". $ticket->Subject . "\n"; - } + $output .= $ticket->Id . ": ". $ticket->Subject . "\n"; } else { + my $id = $ticket->Id; my $d = $m->comp("/REST/1.0/Forms/ticket/default", id => $id, format => $format, fields => \%fields); my ($c, $o, $k, $e) = @$d; push @output, [ $c, $o, $k ]; @@ -154,5 +138,4 @@ OUTPUT: $m->out("RT/". $RT::VERSION . " " . $status ."\n\n"); $m->out($output ); -return(); </%INIT> |