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::Condition::Generic - ;
30 use RT::Condition::Generic;
31 my $foo = new RT::Condition::IsApplicable(
32 TransactionObj => $tr,
38 if ($foo->IsApplicable) {
51 ok (require RT::Condition::Generic);
58 package RT::Condition::Generic;
68 my $class = ref($proto) || $proto;
70 bless ($self, $class);
79 my %args = ( TransactionObj => undef,
84 ApplicableTransTypes => undef,
87 $self->{'Argument'} = $args{'Argument'};
88 $self->{'ScripObj'} = $args{'ScripObj'};
89 $self->{'TicketObj'} = $args{'TicketObj'};
90 $self->{'TransactionObj'} = $args{'TransactionObj'};
91 $self->{'ApplicableTransTypes'} = $args{'ApplicableTransTypes'};
95 # Access Scripwide data
101 Return the optional argument associated with this ScripCondition
107 return($self->{'Argument'});
115 Return the ticket object we're talking about
121 return($self->{'TicketObj'});
129 Return the Scrip object we're talking about
135 return($self->{'ScripObj'});
138 # {{{ sub TransactionObj
140 =head2 TransactionObj
142 Return the transaction object we're talking about
148 return($self->{'TransactionObj'});
160 sub ApplicableTransTypes {
162 return($self->{'ApplicableTransTypes'});
170 #What does this type of Action does
175 return ($self->loc("No description for [_1]", ref $self));
180 #Parse the templates, get things ready to go.
182 #If this rule applies to this transaction, return true.
184 # {{{ sub IsApplicable
195 # We need to clean up all the references that might maybe get
197 $self->{'TemplateObj'} =undef
198 $self->{'TicketObj'} = undef;
199 $self->{'TransactionObj'} = undef;
200 $self->{'ScripObj'} = undef;
206 eval "require RT::Condition::Generic_Vendor";
207 die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/Generic_Vendor.pm});
208 eval "require RT::Condition::Generic_Local";
209 die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/Generic_Local.pm});