reverting to vendor branch rt 3.0.4, hopefully
[freeside.git] / rt / lib / RT / Ticket.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::Ticket
36
37
38 =head1 SYNOPSIS
39
40 =head1 DESCRIPTION
41
42 =head1 METHODS
43
44 =cut
45
46 package RT::Ticket;
47 use RT::Record; 
48 use RT::Queue;
49
50
51 use vars qw( @ISA );
52 @ISA= qw( RT::Record );
53
54 sub _Init {
55   my $self = shift; 
56
57   $self->Table('Tickets');
58   $self->SUPER::_Init(@_);
59 }
60
61
62
63
64
65 =item Create PARAMHASH
66
67 Create takes a hash of values and creates a row in the database:
68
69   int(11) 'EffectiveId'.
70   int(11) 'Queue'.
71   varchar(16) 'Type'.
72   int(11) 'IssueStatement'.
73   int(11) 'Resolution'.
74   int(11) 'Owner'.
75   varchar(200) 'Subject' defaults to '[no subject]'.
76   int(11) 'InitialPriority'.
77   int(11) 'FinalPriority'.
78   int(11) 'Priority'.
79   int(11) 'TimeEstimated'.
80   int(11) 'TimeWorked'.
81   varchar(10) 'Status'.
82   int(11) 'TimeLeft'.
83   datetime 'Told'.
84   datetime 'Starts'.
85   datetime 'Started'.
86   datetime 'Due'.
87   datetime 'Resolved'.
88   smallint(6) 'Disabled'.
89
90 =cut
91
92
93
94
95 sub Create {
96     my $self = shift;
97     my %args = ( 
98                 EffectiveId => '0',
99                 Queue => '0',
100                 Type => '',
101                 IssueStatement => '0',
102                 Resolution => '0',
103                 Owner => '0',
104                 Subject => '[no subject]',
105                 InitialPriority => '0',
106                 FinalPriority => '0',
107                 Priority => '0',
108                 TimeEstimated => '0',
109                 TimeWorked => '0',
110                 Status => '',
111                 TimeLeft => '0',
112                 Told => '',
113                 Starts => '',
114                 Started => '',
115                 Due => '',
116                 Resolved => '',
117                 Disabled => '0',
118
119                   @_);
120     $self->SUPER::Create(
121                          EffectiveId => $args{'EffectiveId'},
122                          Queue => $args{'Queue'},
123                          Type => $args{'Type'},
124                          IssueStatement => $args{'IssueStatement'},
125                          Resolution => $args{'Resolution'},
126                          Owner => $args{'Owner'},
127                          Subject => $args{'Subject'},
128                          InitialPriority => $args{'InitialPriority'},
129                          FinalPriority => $args{'FinalPriority'},
130                          Priority => $args{'Priority'},
131                          TimeEstimated => $args{'TimeEstimated'},
132                          TimeWorked => $args{'TimeWorked'},
133                          Status => $args{'Status'},
134                          TimeLeft => $args{'TimeLeft'},
135                          Told => $args{'Told'},
136                          Starts => $args{'Starts'},
137                          Started => $args{'Started'},
138                          Due => $args{'Due'},
139                          Resolved => $args{'Resolved'},
140                          Disabled => $args{'Disabled'},
141 );
142
143 }
144
145
146
147 =item 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 =item EffectiveId
157
158 Returns the current value of EffectiveId. 
159 (In the database, EffectiveId is stored as int(11).)
160
161
162
163 =item SetEffectiveId VALUE
164
165
166 Set EffectiveId to VALUE. 
167 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
168 (In the database, EffectiveId will be stored as a int(11).)
169
170
171 =cut
172
173
174 =item Queue
175
176 Returns the current value of Queue. 
177 (In the database, Queue is stored as int(11).)
178
179
180
181 =item SetQueue VALUE
182
183
184 Set Queue to VALUE. 
185 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
186 (In the database, Queue will be stored as a int(11).)
187
188
189 =cut
190
191
192 =item QueueObj
193
194 Returns the Queue Object which has the id returned by Queue
195
196
197 =cut
198
199 sub QueueObj {
200         my $self = shift;
201         my $Queue =  RT::Queue->new($self->CurrentUser);
202         $Queue->Load($self->__Value('Queue'));
203         return($Queue);
204 }
205
206 =item Type
207
208 Returns the current value of Type. 
209 (In the database, Type is stored as varchar(16).)
210
211
212
213 =item SetType VALUE
214
215
216 Set Type to VALUE. 
217 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
218 (In the database, Type will be stored as a varchar(16).)
219
220
221 =cut
222
223
224 =item IssueStatement
225
226 Returns the current value of IssueStatement. 
227 (In the database, IssueStatement is stored as int(11).)
228
229
230
231 =item SetIssueStatement VALUE
232
233
234 Set IssueStatement to VALUE. 
235 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
236 (In the database, IssueStatement will be stored as a int(11).)
237
238
239 =cut
240
241
242 =item Resolution
243
244 Returns the current value of Resolution. 
245 (In the database, Resolution is stored as int(11).)
246
247
248
249 =item SetResolution VALUE
250
251
252 Set Resolution to VALUE. 
253 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
254 (In the database, Resolution will be stored as a int(11).)
255
256
257 =cut
258
259
260 =item Owner
261
262 Returns the current value of Owner. 
263 (In the database, Owner is stored as int(11).)
264
265
266
267 =item SetOwner VALUE
268
269
270 Set Owner to VALUE. 
271 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
272 (In the database, Owner will be stored as a int(11).)
273
274
275 =cut
276
277
278 =item Subject
279
280 Returns the current value of Subject. 
281 (In the database, Subject is stored as varchar(200).)
282
283
284
285 =item SetSubject VALUE
286
287
288 Set Subject to VALUE. 
289 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
290 (In the database, Subject will be stored as a varchar(200).)
291
292
293 =cut
294
295
296 =item InitialPriority
297
298 Returns the current value of InitialPriority. 
299 (In the database, InitialPriority is stored as int(11).)
300
301
302
303 =item SetInitialPriority VALUE
304
305
306 Set InitialPriority to VALUE. 
307 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
308 (In the database, InitialPriority will be stored as a int(11).)
309
310
311 =cut
312
313
314 =item FinalPriority
315
316 Returns the current value of FinalPriority. 
317 (In the database, FinalPriority is stored as int(11).)
318
319
320
321 =item SetFinalPriority VALUE
322
323
324 Set FinalPriority to VALUE. 
325 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
326 (In the database, FinalPriority will be stored as a int(11).)
327
328
329 =cut
330
331
332 =item Priority
333
334 Returns the current value of Priority. 
335 (In the database, Priority is stored as int(11).)
336
337
338
339 =item SetPriority VALUE
340
341
342 Set Priority to VALUE. 
343 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
344 (In the database, Priority will be stored as a int(11).)
345
346
347 =cut
348
349
350 =item TimeEstimated
351
352 Returns the current value of TimeEstimated. 
353 (In the database, TimeEstimated is stored as int(11).)
354
355
356
357 =item SetTimeEstimated VALUE
358
359
360 Set TimeEstimated to VALUE. 
361 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
362 (In the database, TimeEstimated will be stored as a int(11).)
363
364
365 =cut
366
367
368 =item TimeWorked
369
370 Returns the current value of TimeWorked. 
371 (In the database, TimeWorked is stored as int(11).)
372
373
374
375 =item SetTimeWorked VALUE
376
377
378 Set TimeWorked to VALUE. 
379 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
380 (In the database, TimeWorked will be stored as a int(11).)
381
382
383 =cut
384
385
386 =item Status
387
388 Returns the current value of Status. 
389 (In the database, Status is stored as varchar(10).)
390
391
392
393 =item SetStatus VALUE
394
395
396 Set Status to VALUE. 
397 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
398 (In the database, Status will be stored as a varchar(10).)
399
400
401 =cut
402
403
404 =item TimeLeft
405
406 Returns the current value of TimeLeft. 
407 (In the database, TimeLeft is stored as int(11).)
408
409
410
411 =item SetTimeLeft VALUE
412
413
414 Set TimeLeft to VALUE. 
415 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
416 (In the database, TimeLeft will be stored as a int(11).)
417
418
419 =cut
420
421
422 =item Told
423
424 Returns the current value of Told. 
425 (In the database, Told is stored as datetime.)
426
427
428
429 =item SetTold VALUE
430
431
432 Set Told to VALUE. 
433 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
434 (In the database, Told will be stored as a datetime.)
435
436
437 =cut
438
439
440 =item Starts
441
442 Returns the current value of Starts. 
443 (In the database, Starts is stored as datetime.)
444
445
446
447 =item SetStarts VALUE
448
449
450 Set Starts to VALUE. 
451 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
452 (In the database, Starts will be stored as a datetime.)
453
454
455 =cut
456
457
458 =item Started
459
460 Returns the current value of Started. 
461 (In the database, Started is stored as datetime.)
462
463
464
465 =item SetStarted VALUE
466
467
468 Set Started to VALUE. 
469 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
470 (In the database, Started will be stored as a datetime.)
471
472
473 =cut
474
475
476 =item Due
477
478 Returns the current value of Due. 
479 (In the database, Due is stored as datetime.)
480
481
482
483 =item SetDue VALUE
484
485
486 Set Due to VALUE. 
487 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
488 (In the database, Due will be stored as a datetime.)
489
490
491 =cut
492
493
494 =item Resolved
495
496 Returns the current value of Resolved. 
497 (In the database, Resolved is stored as datetime.)
498
499
500
501 =item SetResolved VALUE
502
503
504 Set Resolved to VALUE. 
505 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
506 (In the database, Resolved will be stored as a datetime.)
507
508
509 =cut
510
511
512 =item LastUpdatedBy
513
514 Returns the current value of LastUpdatedBy. 
515 (In the database, LastUpdatedBy is stored as int(11).)
516
517
518 =cut
519
520
521 =item LastUpdated
522
523 Returns the current value of LastUpdated. 
524 (In the database, LastUpdated is stored as datetime.)
525
526
527 =cut
528
529
530 =item Creator
531
532 Returns the current value of Creator. 
533 (In the database, Creator is stored as int(11).)
534
535
536 =cut
537
538
539 =item Created
540
541 Returns the current value of Created. 
542 (In the database, Created is stored as datetime.)
543
544
545 =cut
546
547
548 =item Disabled
549
550 Returns the current value of Disabled. 
551 (In the database, Disabled is stored as smallint(6).)
552
553
554
555 =item SetDisabled VALUE
556
557
558 Set Disabled to VALUE. 
559 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
560 (In the database, Disabled will be stored as a smallint(6).)
561
562
563 =cut
564
565
566
567 sub _ClassAccessible {
568     {
569      
570         id =>
571                 {read => 1, type => 'int(11)', default => ''},
572         EffectiveId => 
573                 {read => 1, write => 1, type => 'int(11)', default => '0'},
574         Queue => 
575                 {read => 1, write => 1, type => 'int(11)', default => '0'},
576         Type => 
577                 {read => 1, write => 1, type => 'varchar(16)', default => ''},
578         IssueStatement => 
579                 {read => 1, write => 1, type => 'int(11)', default => '0'},
580         Resolution => 
581                 {read => 1, write => 1, type => 'int(11)', default => '0'},
582         Owner => 
583                 {read => 1, write => 1, type => 'int(11)', default => '0'},
584         Subject => 
585                 {read => 1, write => 1, type => 'varchar(200)', default => '[no subject]'},
586         InitialPriority => 
587                 {read => 1, write => 1, type => 'int(11)', default => '0'},
588         FinalPriority => 
589                 {read => 1, write => 1, type => 'int(11)', default => '0'},
590         Priority => 
591                 {read => 1, write => 1, type => 'int(11)', default => '0'},
592         TimeEstimated => 
593                 {read => 1, write => 1, type => 'int(11)', default => '0'},
594         TimeWorked => 
595                 {read => 1, write => 1, type => 'int(11)', default => '0'},
596         Status => 
597                 {read => 1, write => 1, type => 'varchar(10)', default => ''},
598         TimeLeft => 
599                 {read => 1, write => 1, type => 'int(11)', default => '0'},
600         Told => 
601                 {read => 1, write => 1, type => 'datetime', default => ''},
602         Starts => 
603                 {read => 1, write => 1, type => 'datetime', default => ''},
604         Started => 
605                 {read => 1, write => 1, type => 'datetime', default => ''},
606         Due => 
607                 {read => 1, write => 1, type => 'datetime', default => ''},
608         Resolved => 
609                 {read => 1, write => 1, type => 'datetime', default => ''},
610         LastUpdatedBy => 
611                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
612         LastUpdated => 
613                 {read => 1, auto => 1, type => 'datetime', default => ''},
614         Creator => 
615                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
616         Created => 
617                 {read => 1, auto => 1, type => 'datetime', default => ''},
618         Disabled => 
619                 {read => 1, write => 1, type => 'smallint(6)', default => '0'},
620
621  }
622 };
623
624
625         eval "require RT::Ticket_Overlay";
626         if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Overlay.pm}) {
627             die $@;
628         };
629
630         eval "require RT::Ticket_Vendor";
631         if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Vendor.pm}) {
632             die $@;
633         };
634
635         eval "require RT::Ticket_Local";
636         if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Local.pm}) {
637             die $@;
638         };
639
640
641
642
643 =head1 SEE ALSO
644
645 This class allows "overlay" methods to be placed
646 into the following files _Overlay is for a System overlay by the original author,
647 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
648
649 These overlay files can contain new subs or subs to replace existing subs in this module.
650
651 If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line 
652
653    no warnings qw(redefine);
654
655 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
656
657 RT::Ticket_Overlay, RT::Ticket_Vendor, RT::Ticket_Local
658
659 =cut
660
661
662 1;