import of rt 3.0.9
[freeside.git] / rt / lib / RT / CustomField.pm
1 # BEGIN LICENSE BLOCK
2
3 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4
5 # (Except where explictly superceded by other copyright notices)
6
7 # This work is made available to you under the terms of Version 2 of
8 # the GNU General Public License. A copy of that license should have
9 # been provided with this software, but in any event can be snarfed
10 # from www.gnu.org.
11
12 # This work is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # General Public License for more details.
16
17 # Unless otherwise specified, all modifications, corrections or
18 # extensions to this work which alter its source code become the
19 # property of Best Practical Solutions, LLC when submitted for
20 # inclusion in the work.
21
22
23 # END LICENSE BLOCK
24 # Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
25 # WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.  
26
27 # !! DO NOT EDIT THIS FILE !!
28 #
29
30 use strict;
31
32
33 =head1 NAME
34
35 RT::CustomField
36
37
38 =head1 SYNOPSIS
39
40 =head1 DESCRIPTION
41
42 =head1 METHODS
43
44 =cut
45
46 package RT::CustomField;
47 use RT::Record; 
48 use RT::Queue;
49
50
51 use vars qw( @ISA );
52 @ISA= qw( RT::Record );
53
54 sub _Init {
55   my $self = shift; 
56
57   $self->Table('CustomFields');
58   $self->SUPER::_Init(@_);
59 }
60
61
62
63
64
65 =item Create PARAMHASH
66
67 Create takes a hash of values and creates a row in the database:
68
69   varchar(200) 'Name'.
70   varchar(200) 'Type'.
71   int(11) 'Queue'.
72   varchar(255) 'Description'.
73   int(11) 'SortOrder'.
74   smallint(6) 'Disabled'.
75
76 =cut
77
78
79
80
81 sub Create {
82     my $self = shift;
83     my %args = ( 
84                 Name => '',
85                 Type => '',
86                 Queue => '0',
87                 Description => '',
88                 SortOrder => '0',
89                 Disabled => '0',
90
91                   @_);
92     $self->SUPER::Create(
93                          Name => $args{'Name'},
94                          Type => $args{'Type'},
95                          Queue => $args{'Queue'},
96                          Description => $args{'Description'},
97                          SortOrder => $args{'SortOrder'},
98                          Disabled => $args{'Disabled'},
99 );
100
101 }
102
103
104
105 =item id
106
107 Returns the current value of id. 
108 (In the database, id is stored as int(11).)
109
110
111 =cut
112
113
114 =item Name
115
116 Returns the current value of Name. 
117 (In the database, Name is stored as varchar(200).)
118
119
120
121 =item SetName VALUE
122
123
124 Set Name to VALUE. 
125 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
126 (In the database, Name will be stored as a varchar(200).)
127
128
129 =cut
130
131
132 =item Type
133
134 Returns the current value of Type. 
135 (In the database, Type is stored as varchar(200).)
136
137
138
139 =item SetType VALUE
140
141
142 Set Type to VALUE. 
143 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
144 (In the database, Type will be stored as a varchar(200).)
145
146
147 =cut
148
149
150 =item Queue
151
152 Returns the current value of Queue. 
153 (In the database, Queue is stored as int(11).)
154
155
156
157 =item SetQueue VALUE
158
159
160 Set Queue to VALUE. 
161 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
162 (In the database, Queue will be stored as a int(11).)
163
164
165 =cut
166
167
168 =item QueueObj
169
170 Returns the Queue Object which has the id returned by Queue
171
172
173 =cut
174
175 sub QueueObj {
176         my $self = shift;
177         my $Queue =  RT::Queue->new($self->CurrentUser);
178         $Queue->Load($self->__Value('Queue'));
179         return($Queue);
180 }
181
182 =item Description
183
184 Returns the current value of Description. 
185 (In the database, Description is stored as varchar(255).)
186
187
188
189 =item SetDescription VALUE
190
191
192 Set Description to VALUE. 
193 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
194 (In the database, Description will be stored as a varchar(255).)
195
196
197 =cut
198
199
200 =item SortOrder
201
202 Returns the current value of SortOrder. 
203 (In the database, SortOrder is stored as int(11).)
204
205
206
207 =item SetSortOrder VALUE
208
209
210 Set SortOrder to VALUE. 
211 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
212 (In the database, SortOrder will be stored as a int(11).)
213
214
215 =cut
216
217
218 =item Creator
219
220 Returns the current value of Creator. 
221 (In the database, Creator is stored as int(11).)
222
223
224 =cut
225
226
227 =item Created
228
229 Returns the current value of Created. 
230 (In the database, Created is stored as datetime.)
231
232
233 =cut
234
235
236 =item LastUpdatedBy
237
238 Returns the current value of LastUpdatedBy. 
239 (In the database, LastUpdatedBy is stored as int(11).)
240
241
242 =cut
243
244
245 =item LastUpdated
246
247 Returns the current value of LastUpdated. 
248 (In the database, LastUpdated is stored as datetime.)
249
250
251 =cut
252
253
254 =item Disabled
255
256 Returns the current value of Disabled. 
257 (In the database, Disabled is stored as smallint(6).)
258
259
260
261 =item SetDisabled VALUE
262
263
264 Set Disabled to VALUE. 
265 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
266 (In the database, Disabled will be stored as a smallint(6).)
267
268
269 =cut
270
271
272
273 sub _ClassAccessible {
274     {
275      
276         id =>
277                 {read => 1, type => 'int(11)', default => ''},
278         Name => 
279                 {read => 1, write => 1, type => 'varchar(200)', default => ''},
280         Type => 
281                 {read => 1, write => 1, type => 'varchar(200)', default => ''},
282         Queue => 
283                 {read => 1, write => 1, type => 'int(11)', default => '0'},
284         Description => 
285                 {read => 1, write => 1, type => 'varchar(255)', default => ''},
286         SortOrder => 
287                 {read => 1, write => 1, type => 'int(11)', default => '0'},
288         Creator => 
289                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
290         Created => 
291                 {read => 1, auto => 1, type => 'datetime', default => ''},
292         LastUpdatedBy => 
293                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
294         LastUpdated => 
295                 {read => 1, auto => 1, type => 'datetime', default => ''},
296         Disabled => 
297                 {read => 1, write => 1, type => 'smallint(6)', default => '0'},
298
299  }
300 };
301
302
303         eval "require RT::CustomField_Overlay";
304         if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Overlay.pm}) {
305             die $@;
306         };
307
308         eval "require RT::CustomField_Vendor";
309         if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Vendor.pm}) {
310             die $@;
311         };
312
313         eval "require RT::CustomField_Local";
314         if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Local.pm}) {
315             die $@;
316         };
317
318
319
320
321 =head1 SEE ALSO
322
323 This class allows "overlay" methods to be placed
324 into the following files _Overlay is for a System overlay by the original author,
325 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
326
327 These overlay files can contain new subs or subs to replace existing subs in this module.
328
329 If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line 
330
331    no warnings qw(redefine);
332
333 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
334
335 RT::CustomField_Overlay, RT::CustomField_Vendor, RT::CustomField_Local
336
337 =cut
338
339
340 1;