[Rt-commit] r18764 - in rt/3.999/trunk: lib/RT lib/RT/Approval/Rule lib/RT/Condition lib/RT/ScripAction lib/RT/Shredder share/html/Ticket/Elements t/ticket
ruz at bestpractical.com
ruz at bestpractical.com
Tue Mar 10 19:47:10 EDT 2009
Author: ruz
Date: Tue Mar 10 19:47:09 2009
New Revision: 18764
Modified:
rt/3.999/trunk/lib/RT/Approval/Rule/Created.pm
rt/3.999/trunk/lib/RT/Condition.pm
rt/3.999/trunk/lib/RT/Condition/CloseTicket.pm
rt/3.999/trunk/lib/RT/Condition/OwnerChange.pm
rt/3.999/trunk/lib/RT/Condition/PriorityChange.pm
rt/3.999/trunk/lib/RT/Condition/QueueChange.pm
rt/3.999/trunk/lib/RT/Condition/ReopenTicket.pm
rt/3.999/trunk/lib/RT/Condition/StatusChange.pm
rt/3.999/trunk/lib/RT/Model/Attachment.pm
rt/3.999/trunk/lib/RT/Model/AttachmentCollection.pm
rt/3.999/trunk/lib/RT/Rule.pm
rt/3.999/trunk/lib/RT/ScripAction.pm
rt/3.999/trunk/lib/RT/ScripAction/AutoOpen.pm
rt/3.999/trunk/lib/RT/ScripAction/CreateTickets.pm
rt/3.999/trunk/lib/RT/ScripAction/ExtractSubjectTag.pm
rt/3.999/trunk/lib/RT/ScripAction/Notify.pm
rt/3.999/trunk/lib/RT/ScripAction/NotifyGroup.pm
rt/3.999/trunk/lib/RT/ScripAction/SendEmail.pm
rt/3.999/trunk/lib/RT/Shredder/Attachment.pm
rt/3.999/trunk/share/html/Ticket/Elements/ShowGnuPGStatus
rt/3.999/trunk/share/html/Ticket/Elements/ShowMessageHeaders
rt/3.999/trunk/t/ticket/linking.t
Log:
* s/transaction_obj/transaction/
Modified: rt/3.999/trunk/lib/RT/Approval/Rule/Created.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Approval/Rule/Created.pm (original)
+++ rt/3.999/trunk/lib/RT/Approval/Rule/Created.pm Tue Mar 10 19:47:09 2009
@@ -59,7 +59,7 @@
my $self = shift;
return unless $self->SUPER::prepare();
- $self->transaction_obj->type eq 'create' &&
+ $self->transaction->type eq 'create' &&
!$self->ticket_obj->has_unresolved_dependencies( type => 'approval' );
}
Modified: rt/3.999/trunk/lib/RT/Condition.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Condition.pm (original)
+++ rt/3.999/trunk/lib/RT/Condition.pm Tue Mar 10 19:47:09 2009
@@ -161,7 +161,7 @@
=cut
-sub transaction_obj {
+sub transaction {
my $self = shift;
return ( $self->{'transaction_obj'} );
}
Modified: rt/3.999/trunk/lib/RT/Condition/CloseTicket.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Condition/CloseTicket.pm (original)
+++ rt/3.999/trunk/lib/RT/Condition/CloseTicket.pm Tue Mar 10 19:47:09 2009
@@ -63,7 +63,7 @@
sub is_applicable {
my $self = shift;
- my $txn = $self->transaction_obj;
+ my $txn = $self->transaction;
return 0
unless $txn->type eq "status"
|| ( $txn->type eq "set" && $txn->field eq "status" );
Modified: rt/3.999/trunk/lib/RT/Condition/OwnerChange.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Condition/OwnerChange.pm (original)
+++ rt/3.999/trunk/lib/RT/Condition/OwnerChange.pm Tue Mar 10 19:47:09 2009
@@ -59,7 +59,7 @@
sub is_applicable {
my $self = shift;
- if ( ( $self->transaction_obj->field || '' ) eq 'owner' ) {
+ if ( ( $self->transaction->field || '' ) eq 'owner' ) {
return (1);
} else {
return (undef);
Modified: rt/3.999/trunk/lib/RT/Condition/PriorityChange.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Condition/PriorityChange.pm (original)
+++ rt/3.999/trunk/lib/RT/Condition/PriorityChange.pm Tue Mar 10 19:47:09 2009
@@ -58,7 +58,7 @@
sub is_applicable {
my $self = shift;
- if ( $self->transaction_obj->field eq 'priority' ) {
+ if ( $self->transaction->field eq 'priority' ) {
return (1);
} else {
return (undef);
Modified: rt/3.999/trunk/lib/RT/Condition/QueueChange.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Condition/QueueChange.pm (original)
+++ rt/3.999/trunk/lib/RT/Condition/QueueChange.pm Tue Mar 10 19:47:09 2009
@@ -57,7 +57,7 @@
sub is_applicable {
my $self = shift;
- if ( $self->transaction_obj->field eq 'queue' ) {
+ if ( $self->transaction->field eq 'queue' ) {
return (1);
} else {
return (undef);
Modified: rt/3.999/trunk/lib/RT/Condition/ReopenTicket.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Condition/ReopenTicket.pm (original)
+++ rt/3.999/trunk/lib/RT/Condition/ReopenTicket.pm Tue Mar 10 19:47:09 2009
@@ -63,7 +63,7 @@
sub is_applicable {
my $self = shift;
- my $txn = $self->transaction_obj;
+ my $txn = $self->transaction;
return 0
unless $txn->type eq "status"
|| ( $txn->type eq "set" && $txn->field eq "status" );
Modified: rt/3.999/trunk/lib/RT/Condition/StatusChange.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Condition/StatusChange.pm (original)
+++ rt/3.999/trunk/lib/RT/Condition/StatusChange.pm Tue Mar 10 19:47:09 2009
@@ -58,8 +58,8 @@
sub is_applicable {
my $self = shift;
- if ( ( $self->transaction_obj->field eq 'status' )
- and ( $self->argument eq $self->transaction_obj->new_value() ) )
+ if ( ( $self->transaction->field eq 'status' )
+ and ( $self->argument eq $self->transaction->new_value() ) )
{
return (1);
} else {
Modified: rt/3.999/trunk/lib/RT/Model/Attachment.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Attachment.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/Attachment.pm Tue Mar 10 19:47:09 2009
@@ -235,7 +235,7 @@
=cut
-sub transaction_obj {
+sub transaction {
my $self = shift;
unless ( $self->{_transaction_obj} ) {
@@ -357,7 +357,7 @@
sub content_length {
my $self = shift;
- return undef unless $self->transaction_obj->current_user_can_see;
+ return undef unless $self->transaction->current_user_can_see;
my $len = $self->get_header('Content-Length');
unless ( defined $len ) {
@@ -410,7 +410,7 @@
$body =~ s/^/> /gm;
- $body = '[' . $self->transaction_obj->creator_obj->name() . ' - ' . $self->transaction_obj->created . "]:\n\n" . $body . "\n\n";
+ $body = '[' . $self->transaction->creator_obj->name() . ' - ' . $self->transaction->created . "]:\n\n" . $body . "\n\n";
} else {
$body = "[Non-text message not quoted]\n\n";
@@ -631,7 +631,7 @@
sub encrypt {
my $self = shift;
- my $txn = $self->transaction_obj;
+ my $txn = $self->transaction;
return ( 0, _('Permission Denied') ) unless $txn->current_user_can_see;
return ( 0, _('Permission Denied') )
unless $txn->ticket_obj->current_user_has_right('ModifyTicket');
@@ -688,7 +688,7 @@
sub decrypt {
my $self = shift;
- my $txn = $self->transaction_obj;
+ my $txn = $self->transaction;
return ( 0, _('Permission Denied') ) unless $txn->current_user_can_see;
return ( 0, _('Permission Denied') )
unless $txn->ticket_obj->current_user_has_right('ModifyTicket');
@@ -736,7 +736,7 @@
return ( $self->__value( $field, @_ ) );
}
- return undef unless $self->transaction_obj->current_user_can_see;
+ return undef unless $self->transaction->current_user_can_see;
return $self->__value( $field, @_ );
}
Modified: rt/3.999/trunk/lib/RT/Model/AttachmentCollection.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/AttachmentCollection.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/AttachmentCollection.pm Tue Mar 10 19:47:09 2009
@@ -222,7 +222,7 @@
my $Attachment = $self->SUPER::next;
return $Attachment unless $Attachment;
- my $txn = $Attachment->transaction_obj;
+ my $txn = $Attachment->transaction;
if ( $txn->__value('type') eq 'comment' ) {
return $Attachment
if $txn->current_user_has_right('ShowTicketcomments');
Modified: rt/3.999/trunk/lib/RT/Rule.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Rule.pm (original)
+++ rt/3.999/trunk/lib/RT/Rule.pm Tue Mar 10 19:47:09 2009
@@ -73,9 +73,9 @@
sub on_status_change {
my ($self, $value) = @_;
- $self->transaction_obj->type eq 'status' and
- $self->transaction_obj->field eq 'status' and
- $self->transaction_obj->new_value eq $value
+ $self->transaction->type eq 'status' and
+ $self->transaction->field eq 'status' and
+ $self->transaction->new_value eq $value
}
sub run_scrip_action {
@@ -91,7 +91,7 @@
$template = $t;
}
- my $action = $ScripAction->load_action( transaction_obj => $self->transaction_obj,
+ my $action = $ScripAction->load_action( transaction_obj => $self->transaction,
ticket_obj => $self->ticket_obj,
%args,
);
Modified: rt/3.999/trunk/lib/RT/ScripAction.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/ScripAction.pm (original)
+++ rt/3.999/trunk/lib/RT/ScripAction.pm Tue Mar 10 19:47:09 2009
@@ -125,7 +125,7 @@
}
-sub transaction_obj {
+sub transaction {
my $self = shift;
return ( $self->{'transaction_obj'} );
}
Modified: rt/3.999/trunk/lib/RT/ScripAction/AutoOpen.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/ScripAction/AutoOpen.pm (original)
+++ rt/3.999/trunk/lib/RT/ScripAction/AutoOpen.pm Tue Mar 10 19:47:09 2009
@@ -71,9 +71,9 @@
my $status = $self->ticket_obj->status;
return undef if $status eq 'open';
- return undef if $status eq 'new' && $self->transaction_obj->is_inbound;
+ return undef if $status eq 'new' && $self->transaction->is_inbound;
- if ( my $msg = $self->transaction_obj->message->first ) {
+ if ( my $msg = $self->transaction->message->first ) {
return undef
if ( $msg->get_header('RT-Control') || '' ) =~ /\bno-autoopen\b/i;
}
Modified: rt/3.999/trunk/lib/RT/ScripAction/CreateTickets.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/ScripAction/CreateTickets.pm (original)
+++ rt/3.999/trunk/lib/RT/ScripAction/CreateTickets.pm Tue Mar 10 19:47:09 2009
@@ -309,7 +309,7 @@
Jifty->log->warn("No template object handed to $self");
}
- unless ( $self->transaction_obj ) {
+ unless ( $self->transaction ) {
Jifty->log->warn("No transaction object handed to $self");
}
Modified: rt/3.999/trunk/lib/RT/ScripAction/ExtractSubjectTag.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/ScripAction/ExtractSubjectTag.pm (original)
+++ rt/3.999/trunk/lib/RT/ScripAction/ExtractSubjectTag.pm Tue Mar 10 19:47:09 2009
@@ -61,7 +61,7 @@
sub Commit {
my $self = shift;
- my $Transaction = $self->transaction_obj;
+ my $Transaction = $self->transaction;
my $FirstAttachment = $Transaction->attachments->first;
return 1 unless ($FirstAttachment);
Modified: rt/3.999/trunk/lib/RT/ScripAction/Notify.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/ScripAction/Notify.pm (original)
+++ rt/3.999/trunk/lib/RT/ScripAction/Notify.pm Tue Mar 10 19:47:09 2009
@@ -85,7 +85,7 @@
my ( @To, @PseudoTo, @Cc, @Bcc );
if ( $arg =~ /\bOther_?Recipients\b/i ) {
- if ( my $attachment = $self->transaction_obj->attachments->first ) {
+ if ( my $attachment = $self->transaction->attachments->first ) {
push @Cc, map { $_->address } Email::Address->parse( $attachment->get_header('RT-Send-Cc') );
push @Bcc, map { $_->address } Email::Address->parse( $attachment->get_header('RT-Send-Bcc') );
}
@@ -129,7 +129,7 @@
}
}
- my $creator = $self->transaction_obj->creator_obj->email() || '';
+ my $creator = $self->transaction->creator_obj->email() || '';
#Strip the sender out of the To, Cc and AdminCc and set the
# recipients fields used to build the message by the superclass.
Modified: rt/3.999/trunk/lib/RT/ScripAction/NotifyGroup.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/ScripAction/NotifyGroup.pm (original)
+++ rt/3.999/trunk/lib/RT/ScripAction/NotifyGroup.pm Tue Mar 10 19:47:09 2009
@@ -90,7 +90,7 @@
$self->_handle_argument($_);
}
- my $creator = $self->transaction_obj->creator_obj->email();
+ my $creator = $self->transaction->creator_obj->email();
unless ($RT::NotifyActor) {
@{ $self->{'To'} } = grep ( !/^\Q$creator\E$/, @{ $self->{'To'} } );
}
Modified: rt/3.999/trunk/lib/RT/ScripAction/SendEmail.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/ScripAction/SendEmail.pm (original)
+++ rt/3.999/trunk/lib/RT/ScripAction/SendEmail.pm Tue Mar 10 19:47:09 2009
@@ -109,7 +109,7 @@
{
# it's hacky, but we should know if we're going to crypt things
- my $attachment = $self->transaction_obj->attachments->first;
+ my $attachment = $self->transaction->attachments->first;
my %crypt;
foreach my $argument (qw(sign encrypt)) {
@@ -154,7 +154,7 @@
my ( $result, $message ) = $self->template_obj->parse(
argument => $self->argument,
ticket_obj => $self->ticket_obj,
- transaction_obj => $self->transaction_obj
+ transaction_obj => $self->transaction
);
if ( !$result ) {
return (undef);
@@ -216,7 +216,7 @@
$self->add_tickets;
- my $attachment = $self->transaction_obj->attachments->first;
+ my $attachment = $self->transaction->attachments->first;
if ( $attachment
&& !( $attachment->get_header('X-RT-Encrypt') || $self->ticket_obj->queue->encrypt ) )
{
@@ -290,14 +290,14 @@
$self->scrip_action_obj->{_Message_ID}++;
Jifty->log->info( $msgid . " #" . $self->ticket_obj->id . "/" .
- $self->transaction_obj->id . " - Scrip "
+ $self->transaction->id . " - Scrip "
. ( $self->scrip_obj->id || '#rule' ) . " "
. ( $self->scrip_obj->description || '' ) );
my $status = RT::Interface::Email::send_email(
entity => $mime_obj,
ticket => $self->ticket_obj,
- transaction => $self->transaction_obj,
+ transaction => $self->transaction,
);
return $status unless ( $status > 0 || exists $self->{'Deferred'} );
@@ -342,7 +342,7 @@
my $attachments = RT::Model::AttachmentCollection->new( current_user => RT->system_user );
$attachments->limit(
column => 'transaction_id',
- value => $self->transaction_obj->id
+ value => $self->transaction->id
);
# Don't attach anything blank
@@ -352,7 +352,7 @@
# We want to make sure that we don't include the attachment that's
# being used as the "Content" of this message" unless that attachment's
# content type is not like text/...
- my $transaction_content_obj = $self->transaction_obj->content_obj;
+ my $transaction_content_obj = $self->transaction->content_obj;
if ( $transaction_content_obj
&& $transaction_content_obj->content_type =~ m{text/}i )
@@ -411,7 +411,7 @@
Filename => defined( $attach->filename )
? $self->mime_encode_string( $attach->filename, RT->config->get('EmailOutputEncoding') )
: undef,
- 'RT-Attachment:' => $self->ticket_obj->id . "/" . $self->transaction_obj->id . "/" . $attach->id,
+ 'RT-Attachment:' => $self->ticket_obj->id . "/" . $self->transaction->id . "/" . $attach->id,
Encoding => '-SUGGEST',
);
}
@@ -525,12 +525,12 @@
RT::I18N::set_mime_entity_to_encoding( $mime_obj, 'utf-8', 'mime_words_ok' );
- my $transaction = RT::Model::Transaction->new( current_user => $self->transaction_obj->current_user );
+ my $transaction = RT::Model::Transaction->new( current_user => $self->transaction->current_user );
# XXX: TODO -> Record attachments as references to things in the attachments table, maybe.
my $type;
- if ( $self->transaction_obj->type eq 'comment' ) {
+ if ( $self->transaction->type eq 'comment' ) {
$type = 'comment_email_record';
} else {
$type = 'email_record';
@@ -576,7 +576,7 @@
# Get Message-ID for this txn
my $msgid = "";
- if ( my $msg = $self->transaction_obj->message->first ) {
+ if ( my $msg = $self->transaction->message->first ) {
$msgid = $msg->get_header("RT-Message-ID")
|| $msg->get_header("Message-ID");
}
@@ -612,7 +612,7 @@
# XXX, TODO: use /ShowUser/ShowUserEntry(or something like that) when it would be
# refactored into user's method.
- if ( my $email = $self->transaction_obj->creator_obj->email ) {
+ if ( my $email = $self->transaction->creator_obj->email ) {
$self->set_header( 'RT-Originator', $email );
}
@@ -621,8 +621,8 @@
sub defer_digest_recipients {
my $self = shift;
Jifty->log->debug( "Calling SetRecipientDigests for transaction "
- . $self->transaction_obj . ", id "
- . $self->transaction_obj->id );
+ . $self->transaction . ", id "
+ . $self->transaction->id );
# The digest attribute will be an array of notifications that need to
# be sent for this transaction. The array will have the following
@@ -708,7 +708,7 @@
else {
Jifty->log->debug( "No recipients found for deferred delivery on "
. "transaction #"
- . $self->transaction_obj->id );
+ . $self->transaction->id );
}
}
@@ -770,7 +770,7 @@
my $msgid = $self->template_obj->mime_obj->head->get('Message-ID');
- if ( my $attachment = $self->transaction_obj->attachments->first ) {
+ if ( my $attachment = $self->transaction->attachments->first ) {
if ( $attachment->get_header('RT-DetectedAutoGenerated') ) {
# What do we want to do with this? It's probably (?) a bounce
@@ -882,7 +882,7 @@
unless ($friendly_name) {
$friendly_name =
- $self->transaction_obj->creator_obj->friendly_name;
+ $self->transaction->creator_obj->friendly_name;
if ( $friendly_name =~ /^"(.*)"$/ ) { # a quoted string
$friendly_name = $1;
}
@@ -936,7 +936,7 @@
return ();
}
- my $message = $self->transaction_obj->attachments;
+ my $message = $self->transaction->attachments;
$message->rows_per_page(1);
if ( $self->{'subject'} ) {
$subject = $self->{'subject'};
@@ -982,7 +982,7 @@
my $self = shift;
my ( @in_reply_to, @references, @msgid );
- if ( my $top = $self->transaction_obj->message->first ) {
+ if ( my $top = $self->transaction->message->first ) {
@in_reply_to = split( /\s+/m, $top->get_header('In-Reply-To') || '' );
@references = split( /\s+/m, $top->get_header('References') || '' );
@msgid = split( /\s+/m, $top->get_header('Message-ID') || '' );
Modified: rt/3.999/trunk/lib/RT/Shredder/Attachment.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Shredder/Attachment.pm (original)
+++ rt/3.999/trunk/lib/RT/Shredder/Attachment.pm Tue Mar 10 19:47:09 2009
@@ -113,7 +113,7 @@
}
# Transaction
- my $obj = $self->transaction_obj;
+ my $obj = $self->transaction;
if ( defined $obj->id ) {
push( @$list, $obj );
} else {
Modified: rt/3.999/trunk/share/html/Ticket/Elements/ShowGnuPGStatus
==============================================================================
--- rt/3.999/trunk/share/html/Ticket/Elements/ShowGnuPGStatus (original)
+++ rt/3.999/trunk/share/html/Ticket/Elements/ShowGnuPGStatus Tue Mar 10 19:47:09 2009
@@ -80,7 +80,7 @@
my $reverify_cb = sub {
my $top = shift;
- my $txn = $top->transaction_obj;
+ my $txn = $top->transaction;
unless ( $txn && $txn->id ) {
return (0, "Couldn't get transaction of attachment #". $top->id);
}
Modified: rt/3.999/trunk/share/html/Ticket/Elements/ShowMessageHeaders
==============================================================================
--- rt/3.999/trunk/share/html/Ticket/Elements/ShowMessageHeaders (original)
+++ rt/3.999/trunk/share/html/Ticket/Elements/ShowMessageHeaders Tue Mar 10 19:47:09 2009
@@ -75,7 +75,7 @@
@headers = grep $display_headers{ lc $_->{'tag'} }, @headers;
}
-my $ticket = $message->transaction_obj->ticket_obj;
+my $ticket = $message->transaction->ticket_obj;
foreach my $f (@headers) {
$m->comp('/Elements/MakeClicky', content => \$f->{'value'}, ticket => $ticket, %ARGS);
}
Modified: rt/3.999/trunk/t/ticket/linking.t
==============================================================================
--- rt/3.999/trunk/t/ticket/linking.t (original)
+++ rt/3.999/trunk/t/ticket/linking.t Tue Mar 10 19:47:09 2009
@@ -48,11 +48,11 @@
Jifty->log->debug("Data is \$data");
open \$file, ">$filename" or die "couldn't open $filename";
- if (\$self->transaction_obj->type eq 'add_link') {
+ if (\$self->transaction->type eq 'add_link') {
Jifty->log->debug("add_link");
print \$file \$data+1, "\n";
}
- elsif (\$self->transaction_obj->type eq 'delete_link') {
+ elsif (\$self->transaction->type eq 'delete_link') {
Jifty->log->debug("delete_link");
print \$file \$data-1, "\n";
}
@@ -78,7 +78,7 @@
template => $template->id,
stage => 'transaction_create',
queue => 0,
- custom_is_applicable_code => '$self->transaction_obj->type =~ /(add|delete)_link/;',
+ custom_is_applicable_code => '$self->transaction->type =~ /(add|delete)_link/;',
custom_prepare_code => '1;',
custom_commit_code => $commit_code,
);
More information about the Rt-commit
mailing list