This commit was generated by cvs2svn to compensate for changes in r2523,
[freeside.git] / rt / lib / RT / Action / Generic.pm
1 # $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Action/Generic.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
2 # (c) 1996-2000 Jesse Vincent <jesse@fsck.com>
3 # This software is redistributable under the terms of the GNU GPL
4
5 =head1 NAME
6
7   RT::Action::Generic - a generic baseclass for RT Actions
8
9 =head1 SYNOPSIS
10
11   use RT::Action::Generic;
12
13 =head1 DESCRIPTION
14
15 =head1 METHODS
16
17 =begin testing
18
19 ok (require RT::TestHarness);
20 ok (require RT::Action::Generic);
21
22 =end testing
23
24 =cut
25
26 package RT::Action::Generic;
27
28 # {{{ sub new 
29 sub new  {
30   my $proto = shift;
31   my $class = ref($proto) || $proto;
32   my $self  = {};
33   bless ($self, $class);
34   $self->_Init(@_);
35   return $self;
36 }
37 # }}}
38
39 # {{{ sub _Init 
40 sub _Init  {
41   my $self = shift;
42   my %args = ( TransactionObj => undef,
43                TicketObj => undef,
44                ScripObj => undef,
45                TemplateObj => undef,
46                Argument => undef,
47                Type => undef,
48                @_ );
49   
50   
51   $self->{'Argument'} = $args{'Argument'};
52   $self->{'ScripObj'} = $args{'ScripObj'};
53   $self->{'TicketObj'} = $args{'TicketObj'};
54   $self->{'TransactionObj'} = $args{'TransactionObj'};
55   $self->{'TemplateObj'} = $args{'TemplateObj'};
56   $self->{'Type'} = $args{'Type'};
57 }
58 # }}}
59
60 # Access Scripwide data
61
62 # {{{ sub Argument 
63 sub Argument  {
64   my $self = shift;
65   return($self->{'Argument'});
66 }
67 # }}}
68
69 # {{{ sub TicketObj
70 sub TicketObj  {
71   my $self = shift;
72   return($self->{'TicketObj'});
73 }
74 # }}}
75
76 # {{{ sub TransactionObj
77 sub TransactionObj  {
78   my $self = shift;
79   return($self->{'TransactionObj'});
80 }
81 # }}}
82
83 # {{{ sub TemplateObj
84 sub TemplateObj  {
85   my $self = shift;
86   return($self->{'TemplateObj'});
87 }
88 # }}}
89
90 # {{{ sub Type
91 sub Type  {
92   my $self = shift;
93   return($self->{'Type'});
94 }
95 # }}}
96
97
98 # Scrip methods
99
100 #Do what we need to do and send it out.
101
102 # {{{ sub Commit 
103 sub Commit  {
104   my $self = shift;
105   return(0,"Commit Stubbed");
106 }
107 # }}}
108
109
110 #What does this type of Action does
111
112 # {{{ sub Describe 
113 sub Describe  {
114   my $self = shift;
115   return ("No description for " . ref $self);
116 }
117 # }}}
118
119
120 #Parse the templates, get things ready to go.
121
122 # {{{ sub Prepare 
123 sub Prepare  {
124   my $self = shift;
125   return (0,"Prepare Stubbed");
126 }
127 # }}}
128
129
130 #If this rule applies to this transaction, return true.
131
132 # {{{ sub IsApplicable 
133 sub IsApplicable  {
134   my $self = shift;
135   return(undef);
136 }
137 # }}}
138
139 # {{{ sub DESTROY
140 sub DESTROY {
141     my $self = shift;
142
143     # We need to clean up all the references that might maybe get
144     # oddly circular
145     $self->{'TemplateObj'} =undef
146     $self->{'TicketObj'} = undef;
147     $self->{'TransactionObj'} = undef;
148     $self->{'ScripObj'} = undef;
149
150
151      
152 }
153
154 # }}}
155 1;