summaryrefslogtreecommitdiff
path: root/rt/html/REST
diff options
context:
space:
mode:
authorivan <ivan>2008-03-03 23:07:58 +0000
committerivan <ivan>2008-03-03 23:07:58 +0000
commit479339313bbda612f8fe939217fd067999ef36d4 (patch)
treea47e2fbdc0107910bbbd3b57dc0cbfc357f76aa3 /rt/html/REST
parent642d85fc54b066e6364b66644b95c7b123ba8e24 (diff)
merge in rt 3.4.6. *gulp*!
Diffstat (limited to 'rt/html/REST')
-rw-r--r--rt/html/REST/1.0/Forms/ticket/default4
-rw-r--r--rt/html/REST/1.0/NoAuth/mail-gateway42
-rw-r--r--rt/html/REST/1.0/search/ticket2
3 files changed, 26 insertions, 22 deletions
diff --git a/rt/html/REST/1.0/Forms/ticket/default b/rt/html/REST/1.0/Forms/ticket/default
index 78f6c9562..7d515e51f 100644
--- a/rt/html/REST/1.0/Forms/ticket/default
+++ b/rt/html/REST/1.0/Forms/ticket/default
@@ -57,7 +57,7 @@ my @comments;
my ($c, $o, $k, $e) = ("", [], {}, 0);
my %data = %$changes;
my $ticket = new RT::Ticket $session{CurrentUser};
-my @dates = qw(Created Starts Started Due Resolved Told);
+my @dates = qw(Created Starts Started Due Resolved Told LastUpdated);
my @people = qw(Requestors Cc AdminCc);
my @create = qw(Queue Requestor Subject Cc AdminCc Owner Status Priority
InitialPriority FinalPriority TimeEstimated TimeWorked
@@ -95,7 +95,7 @@ else {
$starts->SetToNow;
return [
- "# Required: Queue, Requestor, Subject",
+ "# Required: id, Queue",
[ qw(id Queue Requestor Subject Cc AdminCc Owner Status Priority
InitialPriority FinalPriority TimeEstimated Starts Due Text) ],
{
diff --git a/rt/html/REST/1.0/NoAuth/mail-gateway b/rt/html/REST/1.0/NoAuth/mail-gateway
index 5252c1968..65d55508d 100644
--- a/rt/html/REST/1.0/NoAuth/mail-gateway
+++ b/rt/html/REST/1.0/NoAuth/mail-gateway
@@ -52,26 +52,30 @@ $action => "correspond"
$ticket => undef
</%ARGS>
<%init>
-use RT::Interface::Email;
+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');
-my ( $status, $error, $Ticket ) = RT::Interface::Email::Gateway(\%ARGS);
- if ($status == -75 ) {
-$m->out("temporary failure - ". $error);
- }
- elsif ($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('Requestor: '. $Ticket->Requestors->MemberEmailAddressesAsString );
- }
- } else {
-$m->out('not ok - '.$error);
- }
-
+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(
+ 'Requestor: ' . $Ticket->Requestors->MemberEmailAddressesAsString );
+ }
+}
+else {
+ $RT::Logger->error( "Could not record email: " . $error );
+ if ( $status == -75 ) {
+ $m->out( "temporary failure - " . $error );
+ }
+ else {
+ $m->out( 'not ok - ' . $error );
+ }
+}
$m->abort();
</%init>
diff --git a/rt/html/REST/1.0/search/ticket b/rt/html/REST/1.0/search/ticket
index d0ab59e98..0990fd69b 100644
--- a/rt/html/REST/1.0/search/ticket
+++ b/rt/html/REST/1.0/search/ticket
@@ -123,7 +123,7 @@ while (my $ticket = $tickets->Next) {
}
else {
my $id = $ticket->Id;
- my $d = $m->comp("$RT::WebPath/REST/1.0/Forms/ticket/default", id => $id, format => $format, fields => \%fields);
+ 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 ];
}