[Rt-commit] r9218 - in rt/branches/3.999-DANGEROUS:
html/REST/1.0/Forms/queue html/REST/1.0/Forms/ticket
html/REST/1.0/Forms/transaction html/REST/1.0/search
html/REST/1.0/ticket
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Thu Oct 4 01:24:16 EDT 2007
Author: sunnavy
Date: Thu Oct 4 01:24:14 2007
New Revision: 9218
Modified:
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/queue/ns
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/attachments
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/comment
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/history
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/links
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/merge
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/take
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/transaction/default
rt/branches/3.999-DANGEROUS/html/REST/1.0/search/ticket
rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/comment
rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/link
rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/merge
rt/branches/3.999-DANGEROUS/t/web/command_line.t
Log:
all the new methods in html/REST need an argument as $session{CurrentUser}, use $RT::Test::server_url instead of getting it from RT::Config
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/queue/ns
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/queue/ns (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/queue/ns Thu Oct 4 01:24:14 2007
@@ -53,7 +53,7 @@
<%perl>
use RT::Model::QueueCollection;
-my $queues = new RT::Model::QueueCollection ;
+my $queues = new RT::Model::QueueCollection($session{CurrentUser});
$queues->limit(column => 'Name', operator => '=', value => $id);
if ($queues->count == 0) {
return (0, "No queue named $id exists.");
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/attachments
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/attachments (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/attachments Thu Oct 4 01:24:14 2007
@@ -54,7 +54,7 @@
<%INIT>
my @data;
my ($c, $o, $k, $e) = ("", [], {}, "");
-my $ticket = new RT::Model::Ticket ;
+my $ticket = new RT::Model::Ticket($session{CurrentUser});
$ticket->load($id);
unless ($ticket->id) {
@@ -76,7 +76,7 @@
unless ($aid =~ /^\d+$/) {
return [ "# Invalid attachment id: $aid", [], {}, 1 ];
}
- my $attachment = new RT::Model::Attachment ;
+ my $attachment = new RT::Model::Attachment($session{CurrentUser});
$attachment->load($aid);
unless ($attachment->id eq $aid) {
return [ "# Invalid attachment id: $aid", [], {}, 1 ];
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/comment
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/comment (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/comment Thu Oct 4 01:24:14 2007
@@ -60,7 +60,7 @@
$RT::Logger->debug("Got ticket id=$id for comment");
$RT::Logger->debug("Got args @{[keys(%changes)]}.");
-my $ticket = new RT::Model::Ticket ;
+my $ticket = new RT::Model::Ticket( $session{CurrentUser} );
my ($c, $o, $k, $e) = ("", [], {}, 0);
# http://.../REST/1.0/ticket/1/comment
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/history
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/history (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/history Thu Oct 4 01:24:14 2007
@@ -54,7 +54,7 @@
$fields => undef
</%ARGS>
<%INIT>
-my $ticket = new RT::Model::Ticket ;
+my $ticket = new RT::Model::Ticket($session{CurrentUser});
my ($c, $o, $k, $e) = ("", [], {}, "");
$ticket->load($id);
@@ -95,7 +95,7 @@
if ($tid) {
my @data;
- my $t = new RT::Model::Transaction ;
+ my $t = new RT::Model::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.
@@ -132,7 +132,7 @@
if (!%$fields || exists $fields->{lc 'Content'}) {
- my $creator = new RT::Model::User ;
+ my $creator = new RT::Model::User($session{CurrentUser});
$creator->load($t->Creator);
push @data, [ Creator => $creator->Name ];
}
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/links
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/links (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/links Thu Oct 4 01:24:14 2007
@@ -55,7 +55,7 @@
<%INIT>
my @data;
$format ||= 's';
-my $ticket = new RT::Model::Ticket ;
+my $ticket = new RT::Model::Ticket($session{CurrentUser});
$ticket->load($id);
if (!$ticket->id) {
@@ -97,8 +97,8 @@
my %new;
foreach my $nkey (@{vsplit($val)}) {
if ($nkey =~ /^\d+$/) {
- my $uri = new RT::URI ;
- my $tick = new RT::Model::Ticket ;
+ my $uri = new RT::URI($session{CurrentUser});
+ my $tick = new RT::Model::Ticket($session{CurrentUser});
$tick->load($nkey);
if ($tick->id) {
$nkey = $uri->FromObject($tick);
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/merge
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/merge (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/merge Thu Oct 4 01:24:14 2007
@@ -56,8 +56,8 @@
my $into = $args;
-my $ticket = new RT::Model::Ticket ;
-my $ticket_into = new RT::Model::Ticket ;
+my $ticket = new RT::Model::Ticket($session{CurrentUser});
+my $ticket_into = new RT::Model::Ticket($session{CurrentUser});
my ($c, $o, $k, $e) = ("", [], {}, 0);
# http://.../REST/1.0/ticket/1/merge/6 (merges ticket 1 into ticket 6)
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/take
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/take (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/take Thu Oct 4 01:24:14 2007
@@ -54,7 +54,7 @@
<%INIT>
use RT::Interface::REST;
-my $ticket = new RT::Model::Ticket ;
+my $ticket = new RT::Model::Ticket($session{CurrentUser});
my ($c, $o, $k, $e) = ("", [], {}, 0);
# http://.../REST/1.0/ticket/1/take
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/transaction/default
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/transaction/default (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/transaction/default Thu Oct 4 01:24:14 2007
@@ -54,7 +54,7 @@
$fields => undef
</%ARGS>
<%INIT>
-my $trans = new RT::Model::TransactionCollection ;
+my $trans = new RT::Model::TransactionCollection($session{CurrentUser});
my ($c, $o, $k, $e) = ("", [], {} , "");
chomp $args;
@@ -65,7 +65,7 @@
if ($tid) {
my @data;
- my $t = new RT::Model::Transaction ;
+ my $t = new RT::Model::Transaction($session{CurrentUser});
$t->load($tid);
if ($format eq "l") {
push @data, [ id => $t->id ];
@@ -89,7 +89,7 @@
if (!%$fields || exists $fields->{lc 'Content'});
if (!%$fields || exists $fields->{lc 'Content'}) {
- my $creator = new RT::Model::User ;
+ my $creator = new RT::Model::User($session{CurrentUser});
$creator->load($t->Creator);
push @data, [ Creator => $creator->Name ];
}
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/search/ticket
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/search/ticket (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/search/ticket Thu Oct 4 01:24:14 2007
@@ -56,7 +56,7 @@
<%INIT>
my $output = "";
my $status = "200 Ok";
-my $tickets = new RT::Model::TicketCollection ;
+my $tickets = new RT::Model::TicketCollection($session{CurrentUser});
# Parse and validate any field specifications.
my $field = '[a-zA-Z][a-zA-Z0-9_-]*';
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/comment
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/comment (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/comment Thu Oct 4 01:24:14 2007
@@ -56,7 +56,7 @@
use RT::Interface::REST;
use File::Temp qw(tempfile);
-my $ticket = new RT::Model::Ticket ;
+my $ticket = new RT::Model::Ticket($session{CurrentUser});
my $object = $r->path_info;
my $status = "200 Ok";
my $output;
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/link
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/link (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/link Thu Oct 4 01:24:14 2007
@@ -58,7 +58,7 @@
my $output;
my $status = "200 Ok";
-my $ticket = new RT::Model::Ticket ;
+my $ticket = new RT::Model::Ticket($session{CurrentUser});
my $object = $r->path_info;
my @fields = qw(DependsOn DependedOnBy RefersTo ReferredToBy has_member MemberOf);
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/merge
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/merge (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/merge Thu Oct 4 01:24:14 2007
@@ -56,7 +56,7 @@
my $output;
my $status = "200 Ok";
-my $ticket = new RT::Model::Ticket ;
+my $ticket = new RT::Model::Ticket($session{CurrentUser});
my $object = $r->path_info;
# http://.../REST/1.0/ticket/merge/1
Modified: rt/branches/3.999-DANGEROUS/t/web/command_line.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/command_line.t (original)
+++ rt/branches/3.999-DANGEROUS/t/web/command_line.t Thu Oct 4 01:24:14 2007
@@ -30,8 +30,10 @@
# - RTPASSWD
$ENV{'RTPASSWD'} = 'password';
# - RTSERVER
-$RT::Logger->debug("Connecting to server at ".RT->Config->Get('WebBaseURL'));
-$ENV{'RTSERVER'} =RT->Config->Get('WebBaseURL') ;
+$RT::Logger->debug("Connecting to server at ". $RT::Test::server_url);
+$ENV{'RTSERVER'} = $RT::Test::server_url;
+$ENV{'RTSERVER'} =~ s/\/$//;
+
# - RTDEBUG Numeric debug level. (Set to 3 for full logs.)
$ENV{'RTDEBUG'} = '1';
# - RTCONFIG Specifies a name other than ".rtrc" for the
More information about the Rt-commit
mailing list