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