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