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