3 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
5 # (Except where explictly superceded by other copyright notices)
7 # This work is made available to you under the terms of Version 2 of
8 # the GNU General Public License. A copy of that license should have
9 # been provided with this software, but in any event can be snarfed
12 # This work is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # Unless otherwise specified, all modifications, corrections or
18 # extensions to this work which alter its source code become the
19 # property of Best Practical Solutions, LLC when submitted for
20 # inclusion in the work.
26 RT::Action::Generic - a generic baseclass for RT Actions
30 use RT::Action::Generic;
38 ok (require RT::Action::Generic);
44 package RT::Action::Generic;
51 my $class = ref($proto) || $proto;
53 bless ($self, $class);
62 return $self->{'ScripObj'}->loc(@_);
69 my %args = ( TransactionObj => undef,
78 $self->{'Argument'} = $args{'Argument'};
79 $self->{'ScripObj'} = $args{'ScripObj'};
80 $self->{'TicketObj'} = $args{'TicketObj'};
81 $self->{'TransactionObj'} = $args{'TransactionObj'};
82 $self->{'TemplateObj'} = $args{'TemplateObj'};
83 $self->{'Type'} = $args{'Type'};
87 # Access Scripwide data
92 return($self->{'Argument'});
99 return($self->{'TicketObj'});
103 # {{{ sub TransactionObj
106 return($self->{'TransactionObj'});
110 # {{{ sub TemplateObj
113 return($self->{'TemplateObj'});
120 return($self->{'ScripObj'});
127 return($self->{'Type'});
134 #Do what we need to do and send it out.
139 return(0, $self->loc("Commit Stubbed"));
144 #What does this type of Action does
149 return $self->loc("No description for [_1]", ref $self);
154 #Parse the templates, get things ready to go.
159 return (0, $self->loc("Prepare Stubbed"));
164 #If this rule applies to this transaction, return true.
166 # {{{ sub IsApplicable
177 # We need to clean up all the references that might maybe get
179 $self->{'TemplateObj'} =undef
180 $self->{'TicketObj'} = undef;
181 $self->{'TransactionObj'} = undef;
182 $self->{'ScripObj'} = undef;
190 eval "require RT::Action::Generic_Vendor";
191 die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Generic_Vendor.pm});
192 eval "require RT::Action::Generic_Local";
193 die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Generic_Local.pm});