1 # BEGIN BPS TAGGED BLOCK {{{
5 # This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
6 # <jesse@bestpractical.com>
8 # (Except where explicitly superseded by other copyright notices)
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
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.
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.
28 # CONTRIBUTION SUBMISSION POLICY:
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.)
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.
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.
49 # !! DO NOT EDIT THIS FILE !!
68 package RT::CustomField;
73 @ISA= qw( RT::Record );
78 $self->Table('CustomFields');
79 $self->SUPER::_Init(@_);
86 =head2 Create PARAMHASH
88 Create takes a hash of values and creates a row in the database:
93 varchar(255) 'Pattern'.
94 smallint(6) 'Repeated'.
95 varchar(255) 'Description'.
97 varchar(255) 'LookupType'.
98 smallint(6) 'Disabled'.
100 'LookupType' is generally the result of either
101 RT::Ticket->CustomFieldLookupType or RT::Transaction->CustomFieldLookupType
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'},
140 Returns the current value of id.
141 (In the database, id is stored as int(11).)
149 Returns the current value of Name.
150 (In the database, Name is stored as varchar(200).)
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).)
167 Returns the current value of Type.
168 (In the database, Type is stored as varchar(200).)
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).)
185 Returns the current value of MaxValues.
186 (In the database, MaxValues is stored as int(11).)
190 =head2 SetMaxValues VALUE
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).)
203 Returns the current value of Pattern.
204 (In the database, Pattern is stored as varchar(255).)
208 =head2 SetPattern VALUE
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).)
221 Returns the current value of Repeated.
222 (In the database, Repeated is stored as smallint(6).)
226 =head2 SetRepeated VALUE
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).)
239 Returns the current value of Description.
240 (In the database, Description is stored as varchar(255).)
244 =head2 SetDescription VALUE
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).)
257 Returns the current value of SortOrder.
258 (In the database, SortOrder is stored as int(11).)
262 =head2 SetSortOrder VALUE
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).)
275 Returns the current value of LookupType.
276 (In the database, LookupType is stored as varchar(255).)
280 =head2 SetLookupType VALUE
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).)
293 Returns the current value of Creator.
294 (In the database, Creator is stored as int(11).)
302 Returns the current value of Created.
303 (In the database, Created is stored as datetime.)
311 Returns the current value of LastUpdatedBy.
312 (In the database, LastUpdatedBy is stored as int(11).)
320 Returns the current value of LastUpdated.
321 (In the database, LastUpdated is stored as datetime.)
329 Returns the current value of Disabled.
330 (In the database, Disabled is stored as smallint(6).)
334 =head2 SetDisabled VALUE
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).)
346 sub _CoreAccessible {
350 {read => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => ''},
352 {read => 1, write => 1, sql_type => 12, length => 200, is_blob => 0, is_numeric => 0, type => 'varchar(200)', default => ''},
354 {read => 1, write => 1, sql_type => 12, length => 200, is_blob => 0, is_numeric => 0, type => 'varchar(200)', default => ''},
356 {read => 1, write => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => ''},
358 {read => 1, write => 1, sql_type => 12, length => 255, is_blob => 0, is_numeric => 0, type => 'varchar(255)', default => ''},
360 {read => 1, write => 1, sql_type => 5, length => 6, is_blob => 0, is_numeric => 1, type => 'smallint(6)', default => '0'},
362 {read => 1, write => 1, sql_type => 12, length => 255, is_blob => 0, is_numeric => 0, type => 'varchar(255)', default => ''},
364 {read => 1, write => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
366 {read => 1, write => 1, sql_type => 12, length => 255, is_blob => 0, is_numeric => 0, type => 'varchar(255)', default => ''},
368 {read => 1, auto => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
370 {read => 1, auto => 1, sql_type => 11, length => 0, is_blob => 0, is_numeric => 0, type => 'datetime', default => ''},
372 {read => 1, auto => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
374 {read => 1, auto => 1, sql_type => 11, length => 0, is_blob => 0, is_numeric => 0, type => 'datetime', default => ''},
376 {read => 1, write => 1, sql_type => 5, length => 6, is_blob => 0, is_numeric => 1, type => 'smallint(6)', default => '0'},
382 eval "require RT::CustomField_Overlay";
383 if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Overlay.pm}) {
387 eval "require RT::CustomField_Vendor";
388 if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Vendor.pm}) {
392 eval "require RT::CustomField_Local";
393 if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Local.pm}) {
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.
406 These overlay files can contain new subs or subs to replace existing subs in this module.
408 Each of these files should begin with the line
410 no warnings qw(redefine);
412 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
414 RT::CustomField_Overlay, RT::CustomField_Vendor, RT::CustomField_Local