summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Action/AutoOpen.pm
diff options
context:
space:
mode:
authorivan <ivan>2009-12-31 13:16:41 +0000
committerivan <ivan>2009-12-31 13:16:41 +0000
commitb4b0c7e72d7eaee2fbfc7022022c9698323203dd (patch)
treeba4cd21399e412c32fe3737eaa8478e3271509f9 /rt/lib/RT/Action/AutoOpen.pm
parent2dfda73eeb3eae2d4f894099754794ef07d060dd (diff)
import rt 3.8.7
Diffstat (limited to 'rt/lib/RT/Action/AutoOpen.pm')
-rw-r--r--rt/lib/RT/Action/AutoOpen.pm52
1 files changed, 24 insertions, 28 deletions
diff --git a/rt/lib/RT/Action/AutoOpen.pm b/rt/lib/RT/Action/AutoOpen.pm
index 004ed13cc..e1cf0ae7c 100644
--- a/rt/lib/RT/Action/AutoOpen.pm
+++ b/rt/lib/RT/Action/AutoOpen.pm
@@ -1,8 +1,8 @@
# BEGIN BPS TAGGED BLOCK {{{
#
# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
+#
+# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
# <jesse@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
@@ -45,28 +45,25 @@
# those contributions and any derivatives thereof.
#
# END BPS TAGGED BLOCK }}}
-# This Action will open the BASE if a dependent is resolved.
+# This Action will open the BASE if a dependent is resolved.
package RT::Action::AutoOpen;
-require RT::Action::Generic;
use strict;
-use vars qw/@ISA/;
-@ISA=qw(RT::Action::Generic);
+use warnings;
-#Do what we need to do and send it out.
+use base qw(RT::Action);
-#What does this type of Action does
+=head1 DESCRIPTION
-# {{{ sub Describe
-sub Describe {
- my $self = shift;
- return (ref $self );
-}
-# }}}
+Opens a ticket unless it's allready open, but only unless transaction
+L<RT::Transaction/IsInbound is inbound>.
+Doesn't open a ticket if message's head has field C<RT-Control> with
+C<no-autoopen> substring.
+
+=cut
-# {{{ sub Prepare
sub Prepare {
my $self = shift;
@@ -83,22 +80,21 @@ sub Prepare {
return 1;
}
-# }}}
sub Commit {
my $self = shift;
- my $oldstatus = $self->TicketObj->Status();
- $self->TicketObj->__Set( Field => 'Status', Value => 'open' );
- $self->TicketObj->_NewTransaction(
- Type => 'Status',
- Field => 'Status',
- OldValue => $oldstatus,
- NewValue => 'open',
- Data => 'Ticket auto-opened on incoming correspondence'
- );
-
-
- return(1);
+
+ my $oldstatus = $self->TicketObj->Status;
+ $self->TicketObj->__Set( Field => 'Status', Value => 'open' );
+ $self->TicketObj->_NewTransaction(
+ Type => 'Status',
+ Field => 'Status',
+ OldValue => $oldstatus,
+ NewValue => 'open',
+ Data => 'Ticket auto-opened on incoming correspondence'
+ );
+
+ return 1;
}
eval "require RT::Action::AutoOpen_Vendor";