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