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