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