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