import rt 3.2.2
[freeside.git] / rt / lib / RT / CustomField.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::CustomField
58
59
60 =head1 SYNOPSIS
61
62 =head1 DESCRIPTION
63
64 =head1 METHODS
65
66 =cut
67
68 package RT::CustomField;
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('CustomFields');
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   varchar(200) 'Name'.
92   varchar(200) 'Type'.
93   int(11) 'Queue'.
94   varchar(255) 'Description'.
95   int(11) 'SortOrder'.
96   smallint(6) 'Disabled'.
97
98 =cut
99
100
101
102
103 sub Create {
104     my $self = shift;
105     my %args = ( 
106                 Name => '',
107                 Type => '',
108                 Queue => '0',
109                 Description => '',
110                 SortOrder => '0',
111                 Disabled => '0',
112
113                   @_);
114     $self->SUPER::Create(
115                          Name => $args{'Name'},
116                          Type => $args{'Type'},
117                          Queue => $args{'Queue'},
118                          Description => $args{'Description'},
119                          SortOrder => $args{'SortOrder'},
120                          Disabled => $args{'Disabled'},
121 );
122
123 }
124
125
126
127 =head2 id
128
129 Returns the current value of id. 
130 (In the database, id is stored as int(11).)
131
132
133 =cut
134
135
136 =head2 Name
137
138 Returns the current value of Name. 
139 (In the database, Name is stored as varchar(200).)
140
141
142
143 =head2 SetName VALUE
144
145
146 Set Name to VALUE. 
147 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
148 (In the database, Name will be stored as a varchar(200).)
149
150
151 =cut
152
153
154 =head2 Type
155
156 Returns the current value of Type. 
157 (In the database, Type is stored as varchar(200).)
158
159
160
161 =head2 SetType VALUE
162
163
164 Set Type to VALUE. 
165 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
166 (In the database, Type will be stored as a varchar(200).)
167
168
169 =cut
170
171
172 =head2 Queue
173
174 Returns the current value of Queue. 
175 (In the database, Queue is stored as int(11).)
176
177
178
179 =head2 SetQueue VALUE
180
181
182 Set Queue to VALUE. 
183 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
184 (In the database, Queue will be stored as a int(11).)
185
186
187 =cut
188
189
190 =head2 QueueObj
191
192 Returns the Queue Object which has the id returned by Queue
193
194
195 =cut
196
197 sub QueueObj {
198         my $self = shift;
199         my $Queue =  RT::Queue->new($self->CurrentUser);
200         $Queue->Load($self->__Value('Queue'));
201         return($Queue);
202 }
203
204 =head2 Description
205
206 Returns the current value of Description. 
207 (In the database, Description is stored as varchar(255).)
208
209
210
211 =head2 SetDescription VALUE
212
213
214 Set Description to VALUE. 
215 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
216 (In the database, Description will be stored as a varchar(255).)
217
218
219 =cut
220
221
222 =head2 SortOrder
223
224 Returns the current value of SortOrder. 
225 (In the database, SortOrder is stored as int(11).)
226
227
228
229 =head2 SetSortOrder VALUE
230
231
232 Set SortOrder to VALUE. 
233 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
234 (In the database, SortOrder will be stored as a int(11).)
235
236
237 =cut
238
239
240 =head2 Creator
241
242 Returns the current value of Creator. 
243 (In the database, Creator is stored as int(11).)
244
245
246 =cut
247
248
249 =head2 Created
250
251 Returns the current value of Created. 
252 (In the database, Created is stored as datetime.)
253
254
255 =cut
256
257
258 =head2 LastUpdatedBy
259
260 Returns the current value of LastUpdatedBy. 
261 (In the database, LastUpdatedBy is stored as int(11).)
262
263
264 =cut
265
266
267 =head2 LastUpdated
268
269 Returns the current value of LastUpdated. 
270 (In the database, LastUpdated is stored as datetime.)
271
272
273 =cut
274
275
276 =head2 Disabled
277
278 Returns the current value of Disabled. 
279 (In the database, Disabled is stored as smallint(6).)
280
281
282
283 =head2 SetDisabled VALUE
284
285
286 Set Disabled to VALUE. 
287 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
288 (In the database, Disabled will be stored as a smallint(6).)
289
290
291 =cut
292
293
294
295 sub _CoreAccessible {
296     {
297      
298         id =>
299                 {read => 1, type => 'int(11)', default => ''},
300         Name => 
301                 {read => 1, write => 1, type => 'varchar(200)', default => ''},
302         Type => 
303                 {read => 1, write => 1, type => 'varchar(200)', default => ''},
304         Queue => 
305                 {read => 1, write => 1, type => 'int(11)', default => '0'},
306         Description => 
307                 {read => 1, write => 1, type => 'varchar(255)', default => ''},
308         SortOrder => 
309                 {read => 1, write => 1, type => 'int(11)', default => '0'},
310         Creator => 
311                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
312         Created => 
313                 {read => 1, auto => 1, type => 'datetime', default => ''},
314         LastUpdatedBy => 
315                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
316         LastUpdated => 
317                 {read => 1, auto => 1, type => 'datetime', default => ''},
318         Disabled => 
319                 {read => 1, write => 1, type => 'smallint(6)', default => '0'},
320
321  }
322 };
323
324
325         eval "require RT::CustomField_Overlay";
326         if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Overlay.pm}) {
327             die $@;
328         };
329
330         eval "require RT::CustomField_Vendor";
331         if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Vendor.pm}) {
332             die $@;
333         };
334
335         eval "require RT::CustomField_Local";
336         if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Local.pm}) {
337             die $@;
338         };
339
340
341
342
343 =head1 SEE ALSO
344
345 This class allows "overlay" methods to be placed
346 into the following files _Overlay is for a System overlay by the original author,
347 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
348
349 These overlay files can contain new subs or subs to replace existing subs in this module.
350
351 If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line 
352
353    no warnings qw(redefine);
354
355 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
356
357 RT::CustomField_Overlay, RT::CustomField_Vendor, RT::CustomField_Local
358
359 =cut
360
361
362 1;