summaryrefslogtreecommitdiff
path: root/rt/html/REST/1.0
diff options
context:
space:
mode:
authorivan <ivan>2008-03-02 04:06:06 +0000
committerivan <ivan>2008-03-02 04:06:06 +0000
commit9c68254528b6f2c7d8c1921b452fa56064783782 (patch)
tree09623ba39355e74f1cff2f3c35b7347bd309f306 /rt/html/REST/1.0
parentef20b2b6b1feb47ad02b5ff7525f1a0fd11d0fa4 (diff)
import rt 3.4.6
Diffstat (limited to 'rt/html/REST/1.0')
-rw-r--r--rt/html/REST/1.0/Forms/queue/default6
-rw-r--r--rt/html/REST/1.0/Forms/queue/ns6
-rw-r--r--rt/html/REST/1.0/Forms/ticket/attachments17
-rw-r--r--rt/html/REST/1.0/Forms/ticket/default69
-rw-r--r--rt/html/REST/1.0/Forms/ticket/history27
-rw-r--r--rt/html/REST/1.0/Forms/ticket/links10
-rw-r--r--rt/html/REST/1.0/Forms/user/default6
-rw-r--r--rt/html/REST/1.0/Forms/user/ns6
-rw-r--r--rt/html/REST/1.0/NoAuth/mail-gateway19
-rw-r--r--rt/html/REST/1.0/autohandler6
-rw-r--r--rt/html/REST/1.0/dhandler19
-rw-r--r--rt/html/REST/1.0/logout6
-rw-r--r--rt/html/REST/1.0/search/dhandler6
-rw-r--r--rt/html/REST/1.0/search/ticket29
-rw-r--r--rt/html/REST/1.0/ticket/comment8
-rw-r--r--rt/html/REST/1.0/ticket/link11
-rw-r--r--rt/html/REST/1.0/ticket/merge6
17 files changed, 69 insertions, 188 deletions
diff --git a/rt/html/REST/1.0/Forms/queue/default b/rt/html/REST/1.0/Forms/queue/default
index cfc4b5291..c87c33cce 100644
--- a/rt/html/REST/1.0/Forms/queue/default
+++ b/rt/html/REST/1.0/Forms/queue/default
@@ -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:
diff --git a/rt/html/REST/1.0/Forms/queue/ns b/rt/html/REST/1.0/Forms/queue/ns
index 227318944..b0ba0036a 100644
--- a/rt/html/REST/1.0/Forms/queue/ns
+++ b/rt/html/REST/1.0/Forms/queue/ns
@@ -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:
diff --git a/rt/html/REST/1.0/Forms/ticket/attachments b/rt/html/REST/1.0/Forms/ticket/attachments
index 4ee409bdc..ca75ce0d1 100644
--- a/rt/html/REST/1.0/Forms/ticket/attachments
+++ b/rt/html/REST/1.0/Forms/ticket/attachments
@@ -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:
@@ -51,7 +49,7 @@
$id
$args => undef
</%ARGS>
-<%INIT>
+<%perl>
my @data;
my ($c, $o, $k, $e) = ("", [], {}, "");
my $ticket = new RT::Ticket $session{CurrentUser};
@@ -82,12 +80,7 @@ if ($aid) {
return [ "# Invalid attachment id: $aid", [], {}, 1 ];
}
if ($content) {
- $c = $attachment->OriginalContent;
- # if we're sending a binary attachment (and only the attachment)
- # flag it so bin/rt knows to special case it
- if ($attachment->ContentType !~ /^text\//) {
- $r->content_type($attachment->ContentType);
- }
+ $c = $attachment->OriginalContent;
} else {
my @data;
push @data, [ id => $attachment->Id ];
@@ -132,4 +125,4 @@ else {
}
return [ $c, $o, $k, $e ];
-</%INIT>
+</%perl>
diff --git a/rt/html/REST/1.0/Forms/ticket/default b/rt/html/REST/1.0/Forms/ticket/default
index 69e385f57..7d515e51f 100644
--- a/rt/html/REST/1.0/Forms/ticket/default
+++ b/rt/html/REST/1.0/Forms/ticket/default
@@ -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:
@@ -51,9 +49,8 @@
$id
$changes => {}
$fields => undef
-$args => undef
</%ARGS>
-<%INIT>
+<%perl>
use MIME::Entity;
my @comments;
@@ -86,7 +83,7 @@ if ($id ne 'new') {
}
}
else {
- if (!keys(%data)) {
+ if (%data == 0) {
# GET ticket/new: Return a suitable default form.
# We get defaults from queue/1 (XXX: What if it isn't there?).
my $due = new RT::Date $session{CurrentUser};
@@ -130,26 +127,11 @@ else {
if (exists $create{lc $k}) {
$v{$create{lc $k}} = delete $data{$k};
}
- # Set custom field
- elsif ($k =~ /^CF-/i) {
- my $cf = RT::CustomField->new( $RT::SystemUser );
- my $cfk = $k;
- $cfk =~ s/^CF-//i;
- unless($cf->LoadByName( Name => $cfk )) {
- push @comments, "# Invalid custom field name ($cfk)";
- delete $data{$k};
- next;
- }
- $v{"CustomField-".$cf->Id()} = delete $data{$k};
- }
elsif (lc $k eq 'text') {
$text = delete $data{$k};
}
}
- # people fields allow multiple values
- $v{$_} = vsplit($v{$_}) foreach ( grep $create{lc $_}, @people );
-
if ($text) {
$v{MIMEObj} =
MIME::Entity->build(
@@ -159,23 +141,20 @@ else {
);
}
- my($tid,$trid,$terr) = $ticket->Create(%v);
- unless ($tid) {
- push(@comments, "# Could not create ticket.");
- push(@comments, "# " . $terr);
- goto DONE;
+ $ticket->Create(%v);
+ unless ($ticket->Id) {
+ return [ "# Could not create ticket.", [], {}, 1 ];
}
delete $data{id};
$id = $ticket->Id;
push(@comments, "# Ticket $id created.");
- # see if the hash is empty
- goto DONE if ! keys(%data);
+ goto DONE if %data == 0;
}
}
# Now we know we're dealing with an existing ticket.
-if (!keys(%data)) {
+if (%data == 0) {
my ($time, $key, $val, @data);
push @data, [ id => "ticket/".$ticket->Id ];
@@ -192,7 +171,7 @@ if (!keys(%data)) {
}
foreach $key (@people) {
- next unless (!%$fields || (exists $fields->{lc $key}));
+ next unless (!%$fields || (exists $fields->{lc $key}));
push @data, [ $key => [ $ticket->$key->MemberEmailAddresses ] ];
}
@@ -211,18 +190,6 @@ if (!keys(%data)) {
push @data, [ $key => $val ];
}
- # Display custom fields
- my $CustomFields = $ticket->QueueObj->TicketCustomFields();
- while (my $cf = $CustomFields->Next()) {
- next unless (!%$fields || (exists $fields->{"cf-".lc $cf->Name}));
- my $vals = $ticket->CustomFieldValues($cf->Id());
- my @out = ();
- while (my $v = $vals->Next()) {
- push @out, $v->Content;
- }
- push @data, [ 'CF-' . $cf->Name => join ',', @out ];
- }
-
my %k = map {@$_} @data;
$o = [ map {$_->[0]} @data ];
$k = \%k;
@@ -304,20 +271,6 @@ else {
$s =~ s/^# //;
}
}
- # Set custom field
- elsif ($key =~ /^CF-/i) {
- my $cf = RT::CustomField->new( $RT::SystemUser );
- $key =~ s/^CF-//i;
- if (not $cf->LoadByName( Name => $key )) {
- $n = 0;
- $s = "Unknown custom field.";
- }
- else {
- ($n, $s) = $ticket->AddCustomFieldValue(
- Field => $cf, Value => $val );
- $s =~ s/^# // if defined $s;
- }
- }
elsif ($key ne 'id' && $key ne 'type' && $key ne 'creator') {
$n = 0;
$s = "Unknown field.";
@@ -342,4 +295,4 @@ DONE:
$c ||= join("\n", @comments) if @comments;
return [$c, $o, $k, $e];
-</%INIT>
+</%perl>
diff --git a/rt/html/REST/1.0/Forms/ticket/history b/rt/html/REST/1.0/Forms/ticket/history
index 5dd7417d0..4663e97ee 100644
--- a/rt/html/REST/1.0/Forms/ticket/history
+++ b/rt/html/REST/1.0/Forms/ticket/history
@@ -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:
@@ -53,7 +51,7 @@ $args => undef
$format => undef
$fields => undef
</%ARGS>
-<%INIT>
+<%perl>
my $ticket = new RT::Ticket $session{CurrentUser};
my ($c, $o, $k, $e) = ("", [], {}, "");
@@ -96,19 +94,7 @@ if ($type) {
if ($tid) {
my @data;
my $t = new RT::Transaction $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)
- }
- if ($tok) {
- $t->Load($tid);
- } else {
- return [ "# Transaction $tid is not related to Ticket $id", [], {}, 1 ];
- }
+ $t->Load($tid);
push @data, [ id => $t->Id ];
push @data, [ Ticket => $t->Ticket ]
@@ -182,7 +168,8 @@ if ($tid) {
$fieldstring .= $key;
}
my ($content, $forms);
- $m->subexec("/REST/1.0/show",
+
+ $m->subexec("$RT::WebPath/REST/1.0/show",
id => \@tid,
format => $format,
fields => $fieldstring);
@@ -197,4 +184,4 @@ if (!$c) {
return [ $c, $o, $k, $e ];
-</%INIT>
+</%perl>
diff --git a/rt/html/REST/1.0/Forms/ticket/links b/rt/html/REST/1.0/Forms/ticket/links
index 6b2ed222d..9f14da4e3 100644
--- a/rt/html/REST/1.0/Forms/ticket/links
+++ b/rt/html/REST/1.0/Forms/ticket/links
@@ -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:
@@ -52,7 +50,7 @@ $id
$format => 's'
$changes => undef
</%ARGS>
-<%INIT>
+<%perl>
my @data;
my $ticket = new RT::Ticket $session{CurrentUser};
@@ -169,4 +167,4 @@ else {
}
return [ $c, $o, $k, $e ];
-</%INIT>
+</%perl>
diff --git a/rt/html/REST/1.0/Forms/user/default b/rt/html/REST/1.0/Forms/user/default
index 621e96dfa..ad2ebd57a 100644
--- a/rt/html/REST/1.0/Forms/user/default
+++ b/rt/html/REST/1.0/Forms/user/default
@@ -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:
diff --git a/rt/html/REST/1.0/Forms/user/ns b/rt/html/REST/1.0/Forms/user/ns
index 3503d8ace..406156304 100644
--- a/rt/html/REST/1.0/Forms/user/ns
+++ b/rt/html/REST/1.0/Forms/user/ns
@@ -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:
diff --git a/rt/html/REST/1.0/NoAuth/mail-gateway b/rt/html/REST/1.0/NoAuth/mail-gateway
index 739dace9d..65d55508d 100644
--- a/rt/html/REST/1.0/NoAuth/mail-gateway
+++ b/rt/html/REST/1.0/NoAuth/mail-gateway
@@ -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:
@@ -54,7 +52,6 @@ $action => "correspond"
$ticket => undef
</%ARGS>
<%init>
-$m->comp('/Elements/Callback', _CallbackName => 'Pre', %ARGS);
use RT::Interface::Email (); # It's an exporter, but we don't care
$r->content_type('text/plain; charset=utf-8');
$m->error_format('text');
@@ -62,13 +59,13 @@ my ( $status, $error, $Ticket ) = RT::Interface::Email::Gateway( \%ARGS );
if ( $status == 1 ) {
$m->out('ok');
if ( $Ticket->Id ) {
- $m->out( 'Ticket: ' . ($Ticket->Id || '') );
- $m->out( 'Queue: ' . ($Ticket->QueueObj->Name || '') );
- $m->out( 'Owner: ' . ($Ticket->OwnerObj->Name || '') );
- $m->out( 'Status: ' . ($Ticket->Status || '') );
- $m->out( 'Subject: ' . ($Ticket->Subject || '') );
+ $m->out( 'Ticket: ' . $Ticket->Id );
+ $m->out( 'Queue: ' . $Ticket->QueueObj->Name );
+ $m->out( 'Owner: ' . $Ticket->OwnerObj->Name );
+ $m->out( 'Status: ' . $Ticket->Status );
+ $m->out( 'Subject: ' . $Ticket->Subject );
$m->out(
- 'Requestor: ' . ($Ticket->Requestors->MemberEmailAddressesAsString || '') );
+ 'Requestor: ' . $Ticket->Requestors->MemberEmailAddressesAsString );
}
}
else {
diff --git a/rt/html/REST/1.0/autohandler b/rt/html/REST/1.0/autohandler
index e8247b18e..8e3fb164d 100644
--- a/rt/html/REST/1.0/autohandler
+++ b/rt/html/REST/1.0/autohandler
@@ -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:
diff --git a/rt/html/REST/1.0/dhandler b/rt/html/REST/1.0/dhandler
index 52d6973f1..6cf45b000 100644
--- a/rt/html/REST/1.0/dhandler
+++ b/rt/html/REST/1.0/dhandler
@@ -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:
@@ -74,7 +72,6 @@ my $labels = "(?:$label,)*$label";
# http://.../REST/1.0/ticket/edit
# 4. http://.../REST/1.0/ticket/nn (all possibly with a single form).
# http://.../REST/1.0/ticket/nn/history
-# http://.../REST/1.0/ticket/nn/comment
# http://.../REST/1.0/ticket/nn/attachment/1
#
# Objects are specified by their type, and either a unique numeric ID,
@@ -293,12 +290,7 @@ foreach $object (@objects) {
# We won't pass $e through to compose, trusting instead that the
# handler added suitable comments for the user.
if ($e) {
- if (@$o) {
- $status = "409 Syntax Error";
- }
- else {
- $status = "400 Bad Request";
- }
+ $status = "409 Syntax Error" if @$o;
push @output, [ $c, $o, $k ];
}
else {
@@ -311,6 +303,7 @@ unshift(@output, [ join "\n", @comments ]) if @comments;
$output = form_compose(\@output);
OUTPUT:
-$m->out("RT/".$RT::VERSION ." ".$status ."\n\n$output\n") if ($output || $status != 200);
-return;
</%INIT>
+RT/<% $RT::VERSION %> <% $status %>
+
+<% $output |n %>
diff --git a/rt/html/REST/1.0/logout b/rt/html/REST/1.0/logout
index 4152a7ee0..470cb0915 100644
--- a/rt/html/REST/1.0/logout
+++ b/rt/html/REST/1.0/logout
@@ -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:
diff --git a/rt/html/REST/1.0/search/dhandler b/rt/html/REST/1.0/search/dhandler
index 3e6b314b7..1915a4644 100644
--- a/rt/html/REST/1.0/search/dhandler
+++ b/rt/html/REST/1.0/search/dhandler
@@ -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:
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>
diff --git a/rt/html/REST/1.0/ticket/comment b/rt/html/REST/1.0/ticket/comment
index 240dd90fb..e27bfcc1e 100644
--- a/rt/html/REST/1.0/ticket/comment
+++ b/rt/html/REST/1.0/ticket/comment
@@ -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 $status = "200 Ok";
my $output;
my $action;
-# http://.../REST/1.0/ticket/1/comment
+# http://.../REST/1.0/ticket/comment/1
my ($c, $o, $k, $e) = @{ form_parse($content)->[0] };
if ($e || !$o) {
if (!$o) {
diff --git a/rt/html/REST/1.0/ticket/link b/rt/html/REST/1.0/ticket/link
index 766e12624..6556a5ef7 100644
--- a/rt/html/REST/1.0/ticket/link
+++ b/rt/html/REST/1.0/ticket/link
@@ -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:
@@ -74,7 +72,7 @@ my %lfields = (
# http://.../REST/1.0/ticket/link/1
-$object =~ s#^/REST/1.0/ticket/link##;
+$object =~ s#^/##;
if ($id && $object && $id != $object) {
$output = "Different ids in URL (`$object') and submitted form (`$id').\n";
$status = "400 Bad Request";
@@ -111,9 +109,6 @@ my $op = $del ? "DeleteLink" : "AddLink";
($n, $output) = $ticket->$op(Type => $type, $mode => $to);
if ($n == 0) {
$status = "500 Error";
-} else {
- my $action = $del ? "Deleted" : "Created";
- $output .= " $action link " . $ticket->Id . " $rel $to";
}
OUTPUT:
diff --git a/rt/html/REST/1.0/ticket/merge b/rt/html/REST/1.0/ticket/merge
index d6ae96f83..3db52111b 100644
--- a/rt/html/REST/1.0/ticket/merge
+++ b/rt/html/REST/1.0/ticket/merge
@@ -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: