This commit was generated by cvs2svn to compensate for changes in r4407,
[freeside.git] / rt / lib / RT / Scrip.pm
1 # BEGIN LICENSE BLOCK
2
3 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4
5 # (Except where explictly superceded by other copyright notices)
6
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
10 # from www.gnu.org.
11
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.
16
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.
21
22
23 # END LICENSE BLOCK
24 # Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
25 # WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.  
26
27 # !! DO NOT EDIT THIS FILE !!
28 #
29
30 use strict;
31
32
33 =head1 NAME
34
35 RT::Scrip
36
37
38 =head1 SYNOPSIS
39
40 =head1 DESCRIPTION
41
42 =head1 METHODS
43
44 =cut
45
46 package RT::Scrip;
47 use RT::Record; 
48 use RT::Queue;
49 use RT::Template;
50 use RT::ScripCondition;
51 use RT::ScripAction;
52
53
54 use vars qw( @ISA );
55 @ISA= qw( RT::Record );
56
57 sub _Init {
58   my $self = shift; 
59
60   $self->Table('Scrips');
61   $self->SUPER::_Init(@_);
62 }
63
64
65
66
67
68 =item Create PARAMHASH
69
70 Create takes a hash of values and creates a row in the database:
71
72   varchar(255) 'Description'.
73   int(11) 'ScripCondition'.
74   int(11) 'ScripAction'.
75   text 'ConditionRules'.
76   text 'ActionRules'.
77   text 'CustomIsApplicableCode'.
78   text 'CustomPrepareCode'.
79   text 'CustomCommitCode'.
80   varchar(32) 'Stage'.
81   int(11) 'Queue'.
82   int(11) 'Template'.
83
84 =cut
85
86
87
88
89 sub Create {
90     my $self = shift;
91     my %args = ( 
92                 Description => '',
93                 ScripCondition => '0',
94                 ScripAction => '0',
95                 ConditionRules => '',
96                 ActionRules => '',
97                 CustomIsApplicableCode => '',
98                 CustomPrepareCode => '',
99                 CustomCommitCode => '',
100                 Stage => '',
101                 Queue => '0',
102                 Template => '0',
103
104                   @_);
105     $self->SUPER::Create(
106                          Description => $args{'Description'},
107                          ScripCondition => $args{'ScripCondition'},
108                          ScripAction => $args{'ScripAction'},
109                          ConditionRules => $args{'ConditionRules'},
110                          ActionRules => $args{'ActionRules'},
111                          CustomIsApplicableCode => $args{'CustomIsApplicableCode'},
112                          CustomPrepareCode => $args{'CustomPrepareCode'},
113                          CustomCommitCode => $args{'CustomCommitCode'},
114                          Stage => $args{'Stage'},
115                          Queue => $args{'Queue'},
116                          Template => $args{'Template'},
117 );
118
119 }
120
121
122
123 =item id
124
125 Returns the current value of id. 
126 (In the database, id is stored as int(11).)
127
128
129 =cut
130
131
132 =item Description
133
134 Returns the current value of Description. 
135 (In the database, Description is stored as varchar(255).)
136
137
138
139 =item SetDescription VALUE
140
141
142 Set Description to VALUE. 
143 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
144 (In the database, Description will be stored as a varchar(255).)
145
146
147 =cut
148
149
150 =item ScripCondition
151
152 Returns the current value of ScripCondition. 
153 (In the database, ScripCondition is stored as int(11).)
154
155
156
157 =item SetScripCondition VALUE
158
159
160 Set ScripCondition to VALUE. 
161 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
162 (In the database, ScripCondition will be stored as a int(11).)
163
164
165 =cut
166
167
168 =item ScripConditionObj
169
170 Returns the ScripCondition Object which has the id returned by ScripCondition
171
172
173 =cut
174
175 sub ScripConditionObj {
176         my $self = shift;
177         my $ScripCondition =  RT::ScripCondition->new($self->CurrentUser);
178         $ScripCondition->Load($self->__Value('ScripCondition'));
179         return($ScripCondition);
180 }
181
182 =item ScripAction
183
184 Returns the current value of ScripAction. 
185 (In the database, ScripAction is stored as int(11).)
186
187
188
189 =item SetScripAction VALUE
190
191
192 Set ScripAction to VALUE. 
193 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
194 (In the database, ScripAction will be stored as a int(11).)
195
196
197 =cut
198
199
200 =item ScripActionObj
201
202 Returns the ScripAction Object which has the id returned by ScripAction
203
204
205 =cut
206
207 sub ScripActionObj {
208         my $self = shift;
209         my $ScripAction =  RT::ScripAction->new($self->CurrentUser);
210         $ScripAction->Load($self->__Value('ScripAction'));
211         return($ScripAction);
212 }
213
214 =item ConditionRules
215
216 Returns the current value of ConditionRules. 
217 (In the database, ConditionRules is stored as text.)
218
219
220
221 =item SetConditionRules VALUE
222
223
224 Set ConditionRules to VALUE. 
225 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
226 (In the database, ConditionRules will be stored as a text.)
227
228
229 =cut
230
231
232 =item ActionRules
233
234 Returns the current value of ActionRules. 
235 (In the database, ActionRules is stored as text.)
236
237
238
239 =item SetActionRules VALUE
240
241
242 Set ActionRules to VALUE. 
243 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
244 (In the database, ActionRules will be stored as a text.)
245
246
247 =cut
248
249
250 =item CustomIsApplicableCode
251
252 Returns the current value of CustomIsApplicableCode. 
253 (In the database, CustomIsApplicableCode is stored as text.)
254
255
256
257 =item SetCustomIsApplicableCode VALUE
258
259
260 Set CustomIsApplicableCode to VALUE. 
261 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
262 (In the database, CustomIsApplicableCode will be stored as a text.)
263
264
265 =cut
266
267
268 =item CustomPrepareCode
269
270 Returns the current value of CustomPrepareCode. 
271 (In the database, CustomPrepareCode is stored as text.)
272
273
274
275 =item SetCustomPrepareCode VALUE
276
277
278 Set CustomPrepareCode to VALUE. 
279 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
280 (In the database, CustomPrepareCode will be stored as a text.)
281
282
283 =cut
284
285
286 =item CustomCommitCode
287
288 Returns the current value of CustomCommitCode. 
289 (In the database, CustomCommitCode is stored as text.)
290
291
292
293 =item SetCustomCommitCode VALUE
294
295
296 Set CustomCommitCode to VALUE. 
297 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
298 (In the database, CustomCommitCode will be stored as a text.)
299
300
301 =cut
302
303
304 =item Stage
305
306 Returns the current value of Stage. 
307 (In the database, Stage is stored as varchar(32).)
308
309
310
311 =item SetStage VALUE
312
313
314 Set Stage to VALUE. 
315 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
316 (In the database, Stage will be stored as a varchar(32).)
317
318
319 =cut
320
321
322 =item Queue
323
324 Returns the current value of Queue. 
325 (In the database, Queue is stored as int(11).)
326
327
328
329 =item SetQueue VALUE
330
331
332 Set Queue to VALUE. 
333 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
334 (In the database, Queue will be stored as a int(11).)
335
336
337 =cut
338
339
340 =item QueueObj
341
342 Returns the Queue Object which has the id returned by Queue
343
344
345 =cut
346
347 sub QueueObj {
348         my $self = shift;
349         my $Queue =  RT::Queue->new($self->CurrentUser);
350         $Queue->Load($self->__Value('Queue'));
351         return($Queue);
352 }
353
354 =item Template
355
356 Returns the current value of Template. 
357 (In the database, Template is stored as int(11).)
358
359
360
361 =item SetTemplate VALUE
362
363
364 Set Template to VALUE. 
365 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
366 (In the database, Template will be stored as a int(11).)
367
368
369 =cut
370
371
372 =item TemplateObj
373
374 Returns the Template Object which has the id returned by Template
375
376
377 =cut
378
379 sub TemplateObj {
380         my $self = shift;
381         my $Template =  RT::Template->new($self->CurrentUser);
382         $Template->Load($self->__Value('Template'));
383         return($Template);
384 }
385
386 =item Creator
387
388 Returns the current value of Creator. 
389 (In the database, Creator is stored as int(11).)
390
391
392 =cut
393
394
395 =item Created
396
397 Returns the current value of Created. 
398 (In the database, Created is stored as datetime.)
399
400
401 =cut
402
403
404 =item LastUpdatedBy
405
406 Returns the current value of LastUpdatedBy. 
407 (In the database, LastUpdatedBy is stored as int(11).)
408
409
410 =cut
411
412
413 =item LastUpdated
414
415 Returns the current value of LastUpdated. 
416 (In the database, LastUpdated is stored as datetime.)
417
418
419 =cut
420
421
422
423 sub _ClassAccessible {
424     {
425      
426         id =>
427                 {read => 1, type => 'int(11)', default => ''},
428         Description => 
429                 {read => 1, write => 1, type => 'varchar(255)', default => ''},
430         ScripCondition => 
431                 {read => 1, write => 1, type => 'int(11)', default => '0'},
432         ScripAction => 
433                 {read => 1, write => 1, type => 'int(11)', default => '0'},
434         ConditionRules => 
435                 {read => 1, write => 1, type => 'text', default => ''},
436         ActionRules => 
437                 {read => 1, write => 1, type => 'text', default => ''},
438         CustomIsApplicableCode => 
439                 {read => 1, write => 1, type => 'text', default => ''},
440         CustomPrepareCode => 
441                 {read => 1, write => 1, type => 'text', default => ''},
442         CustomCommitCode => 
443                 {read => 1, write => 1, type => 'text', default => ''},
444         Stage => 
445                 {read => 1, write => 1, type => 'varchar(32)', default => ''},
446         Queue => 
447                 {read => 1, write => 1, type => 'int(11)', default => '0'},
448         Template => 
449                 {read => 1, write => 1, type => 'int(11)', default => '0'},
450         Creator => 
451                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
452         Created => 
453                 {read => 1, auto => 1, type => 'datetime', default => ''},
454         LastUpdatedBy => 
455                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
456         LastUpdated => 
457                 {read => 1, auto => 1, type => 'datetime', default => ''},
458
459  }
460 };
461
462
463         eval "require RT::Scrip_Overlay";
464         if ($@ && $@ !~ qr{^Can't locate RT/Scrip_Overlay.pm}) {
465             die $@;
466         };
467
468         eval "require RT::Scrip_Vendor";
469         if ($@ && $@ !~ qr{^Can't locate RT/Scrip_Vendor.pm}) {
470             die $@;
471         };
472
473         eval "require RT::Scrip_Local";
474         if ($@ && $@ !~ qr{^Can't locate RT/Scrip_Local.pm}) {
475             die $@;
476         };
477
478
479
480
481 =head1 SEE ALSO
482
483 This class allows "overlay" methods to be placed
484 into the following files _Overlay is for a System overlay by the original author,
485 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
486
487 These overlay files can contain new subs or subs to replace existing subs in this module.
488
489 If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line 
490
491    no warnings qw(redefine);
492
493 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
494
495 RT::Scrip_Overlay, RT::Scrip_Vendor, RT::Scrip_Local
496
497 =cut
498
499
500 1;