import rt 3.4.6
[freeside.git] / rt / lib / RT / CustomField.pm
1 # BEGIN BPS TAGGED BLOCK {{{
2
3 # COPYRIGHT:
4 #  
5 # This software is Copyright (c) 1996-2005 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
71
72 use vars qw( @ISA );
73 @ISA= qw( RT::Record );
74
75 sub _Init {
76   my $self = shift; 
77
78   $self->Table('CustomFields');
79   $self->SUPER::_Init(@_);
80 }
81
82
83
84
85
86 =head2 Create PARAMHASH
87
88 Create takes a hash of values and creates a row in the database:
89
90   varchar(200) 'Name'.
91   varchar(200) 'Type'.
92   int(11) 'MaxValues'.
93   varchar(255) 'Pattern'.
94   smallint(6) 'Repeated'.
95   varchar(255) 'Description'.
96   int(11) 'SortOrder'.
97   varchar(255) 'LookupType'.
98   smallint(6) 'Disabled'.
99
100   'LookupType' is generally the result of either 
101   RT::Ticket->CustomFieldLookupType or RT::Transaction->CustomFieldLookupType
102
103 =cut
104
105
106
107
108 sub Create {
109     my $self = shift;
110     my %args = ( 
111                 Name => '',
112                 Type => '',
113                 MaxValues => '',
114                 Pattern => '',
115                 Repeated => '0',
116                 Description => '',
117                 SortOrder => '0',
118                 LookupType => '',
119                 Disabled => '0',
120
121                   @_);
122     $self->SUPER::Create(
123                          Name => $args{'Name'},
124                          Type => $args{'Type'},
125                          MaxValues => $args{'MaxValues'},
126                          Pattern => $args{'Pattern'},
127                          Repeated => $args{'Repeated'},
128                          Description => $args{'Description'},
129                          SortOrder => $args{'SortOrder'},
130                          LookupType => $args{'LookupType'},
131                          Disabled => $args{'Disabled'},
132 );
133
134 }
135
136
137
138 =head2 id
139
140 Returns the current value of id. 
141 (In the database, id is stored as int(11).)
142
143
144 =cut
145
146
147 =head2 Name
148
149 Returns the current value of Name. 
150 (In the database, Name is stored as varchar(200).)
151
152
153
154 =head2 SetName VALUE
155
156
157 Set Name to VALUE. 
158 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
159 (In the database, Name will be stored as a varchar(200).)
160
161
162 =cut
163
164
165 =head2 Type
166
167 Returns the current value of Type. 
168 (In the database, Type is stored as varchar(200).)
169
170
171
172 =head2 SetType VALUE
173
174
175 Set Type to VALUE. 
176 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
177 (In the database, Type will be stored as a varchar(200).)
178
179
180 =cut
181
182
183 =head2 MaxValues
184
185 Returns the current value of MaxValues. 
186 (In the database, MaxValues is stored as int(11).)
187
188
189
190 =head2 SetMaxValues VALUE
191
192
193 Set MaxValues to VALUE. 
194 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
195 (In the database, MaxValues will be stored as a int(11).)
196
197
198 =cut
199
200
201 =head2 Pattern
202
203 Returns the current value of Pattern. 
204 (In the database, Pattern is stored as varchar(255).)
205
206
207
208 =head2 SetPattern VALUE
209
210
211 Set Pattern to VALUE. 
212 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
213 (In the database, Pattern will be stored as a varchar(255).)
214
215
216 =cut
217
218
219 =head2 Repeated
220
221 Returns the current value of Repeated. 
222 (In the database, Repeated is stored as smallint(6).)
223
224
225
226 =head2 SetRepeated VALUE
227
228
229 Set Repeated to VALUE. 
230 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
231 (In the database, Repeated will be stored as a smallint(6).)
232
233
234 =cut
235
236
237 =head2 Description
238
239 Returns the current value of Description. 
240 (In the database, Description is stored as varchar(255).)
241
242
243
244 =head2 SetDescription VALUE
245
246
247 Set Description to VALUE. 
248 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
249 (In the database, Description will be stored as a varchar(255).)
250
251
252 =cut
253
254
255 =head2 SortOrder
256
257 Returns the current value of SortOrder. 
258 (In the database, SortOrder is stored as int(11).)
259
260
261
262 =head2 SetSortOrder VALUE
263
264
265 Set SortOrder to VALUE. 
266 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
267 (In the database, SortOrder will be stored as a int(11).)
268
269
270 =cut
271
272
273 =head2 LookupType
274
275 Returns the current value of LookupType. 
276 (In the database, LookupType is stored as varchar(255).)
277
278
279
280 =head2 SetLookupType VALUE
281
282
283 Set LookupType to VALUE. 
284 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
285 (In the database, LookupType will be stored as a varchar(255).)
286
287
288 =cut
289
290
291 =head2 Creator
292
293 Returns the current value of Creator. 
294 (In the database, Creator is stored as int(11).)
295
296
297 =cut
298
299
300 =head2 Created
301
302 Returns the current value of Created. 
303 (In the database, Created is stored as datetime.)
304
305
306 =cut
307
308
309 =head2 LastUpdatedBy
310
311 Returns the current value of LastUpdatedBy. 
312 (In the database, LastUpdatedBy is stored as int(11).)
313
314
315 =cut
316
317
318 =head2 LastUpdated
319
320 Returns the current value of LastUpdated. 
321 (In the database, LastUpdated is stored as datetime.)
322
323
324 =cut
325
326
327 =head2 Disabled
328
329 Returns the current value of Disabled. 
330 (In the database, Disabled is stored as smallint(6).)
331
332
333
334 =head2 SetDisabled VALUE
335
336
337 Set Disabled to VALUE. 
338 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
339 (In the database, Disabled will be stored as a smallint(6).)
340
341
342 =cut
343
344
345
346 sub _CoreAccessible {
347     {
348      
349         id =>
350                 {read => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
351         Name => 
352                 {read => 1, write => 1, sql_type => 12, length => 200,  is_blob => 0,  is_numeric => 0,  type => 'varchar(200)', default => ''},
353         Type => 
354                 {read => 1, write => 1, sql_type => 12, length => 200,  is_blob => 0,  is_numeric => 0,  type => 'varchar(200)', default => ''},
355         MaxValues => 
356                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
357         Pattern => 
358                 {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
359         Repeated => 
360                 {read => 1, write => 1, sql_type => 5, length => 6,  is_blob => 0,  is_numeric => 1,  type => 'smallint(6)', default => '0'},
361         Description => 
362                 {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
363         SortOrder => 
364                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
365         LookupType => 
366                 {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
367         Creator => 
368                 {read => 1, auto => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
369         Created => 
370                 {read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
371         LastUpdatedBy => 
372                 {read => 1, auto => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
373         LastUpdated => 
374                 {read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
375         Disabled => 
376                 {read => 1, write => 1, sql_type => 5, length => 6,  is_blob => 0,  is_numeric => 1,  type => 'smallint(6)', default => '0'},
377
378  }
379 };
380
381
382         eval "require RT::CustomField_Overlay";
383         if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Overlay.pm}) {
384             die $@;
385         };
386
387         eval "require RT::CustomField_Vendor";
388         if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Vendor.pm}) {
389             die $@;
390         };
391
392         eval "require RT::CustomField_Local";
393         if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Local.pm}) {
394             die $@;
395         };
396
397
398
399
400 =head1 SEE ALSO
401
402 This class allows "overlay" methods to be placed
403 into the following files _Overlay is for a System overlay by the original author,
404 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
405
406 These overlay files can contain new subs or subs to replace existing subs in this module.
407
408 Each of these files should begin with the line 
409
410    no warnings qw(redefine);
411
412 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
413
414 RT::CustomField_Overlay, RT::CustomField_Vendor, RT::CustomField_Local
415
416 =cut
417
418
419 1;