[Rt-commit] r18931 - in rt/3.999/branches/lorzy/lib/RT: . Interface Model
clkao at bestpractical.com
clkao at bestpractical.com
Wed Mar 25 12:18:07 EDT 2009
Author: clkao
Date: Wed Mar 25 12:18:07 2009
New Revision: 18931
Modified:
rt/3.999/branches/lorzy/lib/RT/Condition.pm
rt/3.999/branches/lorzy/lib/RT/Interface/Email.pm
rt/3.999/branches/lorzy/lib/RT/Model/ScripAction.pm
rt/3.999/branches/lorzy/lib/RT/Model/ScripCondition.pm
rt/3.999/branches/lorzy/lib/RT/ScripAction.pm
rt/3.999/branches/lorzy/lib/RT/ScripAction/SendEmail.pm
Log:
remove model::{scripaction,scrip} references in scripaction base class.
Modified: rt/3.999/branches/lorzy/lib/RT/Condition.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Condition.pm (original)
+++ rt/3.999/branches/lorzy/lib/RT/Condition.pm Wed Mar 25 12:18:07 2009
@@ -56,7 +56,6 @@
my $foo = RT::Condition->new(
transaction_obj => $tr,
ticket_obj => $ti,
- scrip_obj => $scr,
Argument => $arg,
Type => $type);
@@ -194,7 +193,6 @@
$self->{'template_obj'} = undef;
$self->{'ticket_obj'} = undef;
$self->{'transaction_obj'} = undef;
- $self->{'scrip_obj'} = undef;
}
Modified: rt/3.999/branches/lorzy/lib/RT/Interface/Email.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Interface/Email.pm (original)
+++ rt/3.999/branches/lorzy/lib/RT/Interface/Email.pm Wed Mar 25 12:18:07 2009
@@ -943,8 +943,8 @@
sub gen_message_id {
my %args = (
ticket => undef,
- Scrip => undef,
- scrip_action => undef,
+ scrip => undef,
+ sequence => undef,
@_
);
my $org = RT->config->get('Organization');
@@ -952,8 +952,7 @@
|| 0;
my $scrip_id = ( ref $args{'Scrip'} ? $args{'Scrip'}->id : $args{'Scrip'} )
|| 0;
- my $sent = ( ref $args{'scrip_action'} ? $args{'scrip_action'}->{'_Message_ID'} : 0 )
- || 0;
+ my $sent = $args{sequence} || 0;
return "<rt-" . $RT::VERSION . "-" . $$ . "-" . CORE::time() . "-" . int( rand(2000) ) . '.' . $ticket_id . "-" . $scrip_id . "-" . $sent . "@" . $org . ">";
}
Modified: rt/3.999/branches/lorzy/lib/RT/Model/ScripAction.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Model/ScripAction.pm (original)
+++ rt/3.999/branches/lorzy/lib/RT/Model/ScripAction.pm Wed Mar 25 12:18:07 2009
@@ -156,7 +156,6 @@
$self->{'action'} = $type->new(
argument => $self->argument,
current_user => $self->current_user,
- scrip_action_obj => $self,
scrip_obj => $args{'scrip_obj'},
template_obj => $self->template_obj,
ticket_obj => $args{'ticket_obj'},
@@ -205,7 +204,6 @@
sub prepare {
my $self = shift;
- $self->{_Message_ID} = 0;
return ( $self->action->prepare() );
}
Modified: rt/3.999/branches/lorzy/lib/RT/Model/ScripCondition.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Model/ScripCondition.pm (original)
+++ rt/3.999/branches/lorzy/lib/RT/Model/ScripCondition.pm Wed Mar 25 12:18:07 2009
@@ -144,7 +144,6 @@
$self->{'condition'} = $type->new(
'scrip_scrip_condition' => $self,
'ticket_obj' => $args{'ticket_obj'},
- 'scrip_obj' => $args{'scrip_obj'},
'transaction_obj' => $args{'transaction_obj'},
'argument' => $self->argument,
'applicable_trans_types' => $self->applicable_trans_types,
Modified: rt/3.999/branches/lorzy/lib/RT/ScripAction.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/ScripAction.pm (original)
+++ rt/3.999/branches/lorzy/lib/RT/ScripAction.pm Wed Mar 25 12:18:07 2009
@@ -83,7 +83,6 @@
my %args = (
argument => undef,
current_user => undef,
- scrip_action_obj => undef,
template_obj => undef,
ticket_obj => undef,
transaction_obj => undef,
@@ -94,7 +93,6 @@
$self->{'argument'} = $args{'argument'};
$self->current_user( $args{'current_user'} );
- $self->{'scrip_action_obj'} = $args{'scrip_action_obj'};
$self->{'template_obj'} = $args{'template_obj'};
$self->{'ticket_obj'} = $args{'ticket_obj'};
$self->{'transaction_obj'} = $args{'transaction_obj'};
@@ -134,12 +132,6 @@
}
-sub scrip_action_obj {
- my $self = shift;
- return ( $self->{'scrip_action_obj'} );
-}
-
-
sub type {
my $self = shift;
return ( $self->{'Type'} );
@@ -189,7 +181,6 @@
# We need to clean up all the references that might maybe get
# oddly circular
- $self->{'scrip_action_obj'} = undef;
$self->{'template_obj'} = undef;
$self->{'ticket_obj'} = undef;
$self->{'transaction_obj'} = undef;
Modified: rt/3.999/branches/lorzy/lib/RT/ScripAction/SendEmail.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/ScripAction/SendEmail.pm (original)
+++ rt/3.999/branches/lorzy/lib/RT/ScripAction/SendEmail.pm Wed Mar 25 12:18:07 2009
@@ -302,7 +302,8 @@
my $msgid = $mime_obj->head->get('Message-ID');
chomp $msgid;
- $self->scrip_action_obj->{_Message_ID}++;
+ $self->{_Message_ID} ||= 0;
+ $self->{_Message_ID}++;
Jifty->log->info( $msgid . " #" . $self->ticket_obj->id . "/" .
$self->transaction->id . " - Scrip "
@@ -601,18 +602,19 @@
and $msgid =~ s/<(rt-.*?-\d+-\d+)\.(\d+)-\d+-\d+\@\QRT->config->get('Organization')\E>$/
"<$1." . $self->ticket_obj->id
. "-" . '#rule'
- . "-" . $self->scrip_action_obj->{_Message_ID}
+ . "-" . $self->{_Message_ID}
. "@" . RT->config->get('Organization') . ">"/eg
and $2 == $self->ticket_obj->id
)
{
$self->set_header( "Message-ID" => $msgid );
} else {
+ # XXX: only place calling gen_message_id with scrip and seq
$self->set_header(
'Message-ID' => RT::Interface::Email::gen_message_id(
ticket => $self->ticket_obj,
scrip => '#rule',
- scrip_action => $self->scrip_action_obj
+ sequence => $self->{_Message_ID},
),
);
}
@@ -1019,7 +1021,7 @@
s/<(rt-.*?-\d+-\d+)\.(\d+-0-0)\@\Q$org\E>$/
"<$1." . $self->ticket_obj->id .
"-" . '#rule',
- "-" . $self->scrip_action_obj->{_Message_ID} .
+ "-" . $self->{_Message_ID} .
"@" . $org . ">"/eg
}
More information about the Rt-commit
mailing list