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