[Rt-commit] r9188 -
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Mon Oct 1 15:49:47 EDT 2007
Author: sunnavy
Date: Mon Oct 1 15:49:43 2007
New Revision: 9188
Modified:
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/default
Log:
many objects' new method should have a RT::CurrentUser object as argument
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/default
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/default (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/default Mon Oct 1 15:49:43 2007
@@ -59,7 +59,7 @@
my @comments;
my ($c, $o, $k, $e) = ("", [], {}, 0);
my %data = %$changes;
-my $ticket = new RT::Model::Ticket ;
+my $ticket = new RT::Model::Ticket( $session{CurrentUser} ) ;
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
@@ -89,9 +89,9 @@
if (!keys(%data)) {
# 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 ;
- my $queue = new RT::Model::Queue ;
- my $starts = new RT::Date ;
+ my $due = new RT::Date( $session{CurrentUser} ) ;
+ my $queue = new RT::Model::Queue( $session{CurrentUser} ) ;
+ my $starts = new RT::Date( $session{CurrentUser} ) ;
$queue->load(1);
$due->set_to_now;
$due->AddDays($queue->DefaultDueIn) if $queue->DefaultDueIn;
@@ -104,7 +104,7 @@
{
id => "ticket/new",
Queue => $queue->Name,
- Requestor => ->Name,
+ Requestor => $session{CurrentUser}->Name,
Subject => "",
Cc => [],
AdminCc => [],
@@ -153,7 +153,7 @@
if ($text) {
$v{MIMEObj} =
MIME::Entity->build(
- From => ->EmailAddress,
+ From => $session{CurrentUser}->EmailAddress,
Subject => $v{Subject},
Data => $text
);
@@ -196,14 +196,14 @@
push @data, [ $key => [ $ticket->$key->MemberEmailAddresses ] ];
}
- $time = new RT::Date ();
+ $time = new RT::Date ( $session{CurrentUser} );
foreach $key (@dates) {
next unless (!%$fields || (exists $fields->{lc $key}));
$time->set(Format => 'sql', value => $ticket->$key);
push @data, [ $key => $time->AsString ];
}
- $time = new RT::Date ();
+ $time = new RT::Date ( $session{CurrentUser} );
foreach $key (qw(TimeEstimated TimeWorked TimeLeft)) {
next unless (!%$fields || (exists $fields->{lc $key}));
$val = $ticket->$key || 0;
@@ -263,7 +263,7 @@
$key = $dates{$key};
$set = "set_$key";
- my $time = new RT::Date ;
+ my $time = new RT::Date( $session{CurrentUser} ) ;
$time->set(Format => 'sql', value => $ticket->$key);
next if ($val =~ /^not set$/i || $val eq $time->AsString);
($n, $s) = $ticket->$set($val);
More information about the Rt-commit
mailing list