import of rt 3.0.9
[freeside.git] / rt / lib / RT / Template.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::Template
36
37
38 =head1 SYNOPSIS
39
40 =head1 DESCRIPTION
41
42 =head1 METHODS
43
44 =cut
45
46 package RT::Template;
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('Templates');
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   int(11) 'Queue'.
70   varchar(200) 'Name'.
71   varchar(255) 'Description'.
72   varchar(16) 'Type'.
73   varchar(16) 'Language'.
74   int(11) 'TranslationOf'.
75   blob 'Content'.
76
77 =cut
78
79
80
81
82 sub Create {
83     my $self = shift;
84     my %args = ( 
85                 Queue => '0',
86                 Name => '',
87                 Description => '',
88                 Type => '',
89                 Language => '',
90                 TranslationOf => '0',
91                 Content => '',
92
93                   @_);
94     $self->SUPER::Create(
95                          Queue => $args{'Queue'},
96                          Name => $args{'Name'},
97                          Description => $args{'Description'},
98                          Type => $args{'Type'},
99                          Language => $args{'Language'},
100                          TranslationOf => $args{'TranslationOf'},
101                          Content => $args{'Content'},
102 );
103
104 }
105
106
107
108 =item id
109
110 Returns the current value of id. 
111 (In the database, id is stored as int(11).)
112
113
114 =cut
115
116
117 =item Queue
118
119 Returns the current value of Queue. 
120 (In the database, Queue is stored as int(11).)
121
122
123
124 =item SetQueue VALUE
125
126
127 Set Queue to VALUE. 
128 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
129 (In the database, Queue will be stored as a int(11).)
130
131
132 =cut
133
134
135 =item QueueObj
136
137 Returns the Queue Object which has the id returned by Queue
138
139
140 =cut
141
142 sub QueueObj {
143         my $self = shift;
144         my $Queue =  RT::Queue->new($self->CurrentUser);
145         $Queue->Load($self->__Value('Queue'));
146         return($Queue);
147 }
148
149 =item Name
150
151 Returns the current value of Name. 
152 (In the database, Name is stored as varchar(200).)
153
154
155
156 =item SetName VALUE
157
158
159 Set Name to VALUE. 
160 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
161 (In the database, Name will be stored as a varchar(200).)
162
163
164 =cut
165
166
167 =item Description
168
169 Returns the current value of Description. 
170 (In the database, Description is stored as varchar(255).)
171
172
173
174 =item SetDescription VALUE
175
176
177 Set Description to VALUE. 
178 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
179 (In the database, Description will be stored as a varchar(255).)
180
181
182 =cut
183
184
185 =item Type
186
187 Returns the current value of Type. 
188 (In the database, Type is stored as varchar(16).)
189
190
191
192 =item SetType VALUE
193
194
195 Set Type to VALUE. 
196 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
197 (In the database, Type will be stored as a varchar(16).)
198
199
200 =cut
201
202
203 =item Language
204
205 Returns the current value of Language. 
206 (In the database, Language is stored as varchar(16).)
207
208
209
210 =item SetLanguage VALUE
211
212
213 Set Language to VALUE. 
214 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
215 (In the database, Language will be stored as a varchar(16).)
216
217
218 =cut
219
220
221 =item TranslationOf
222
223 Returns the current value of TranslationOf. 
224 (In the database, TranslationOf is stored as int(11).)
225
226
227
228 =item SetTranslationOf VALUE
229
230
231 Set TranslationOf to VALUE. 
232 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
233 (In the database, TranslationOf will be stored as a int(11).)
234
235
236 =cut
237
238
239 =item Content
240
241 Returns the current value of Content. 
242 (In the database, Content is stored as blob.)
243
244
245
246 =item SetContent VALUE
247
248
249 Set Content to VALUE. 
250 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
251 (In the database, Content will be stored as a blob.)
252
253
254 =cut
255
256
257 =item LastUpdated
258
259 Returns the current value of LastUpdated. 
260 (In the database, LastUpdated is stored as datetime.)
261
262
263 =cut
264
265
266 =item LastUpdatedBy
267
268 Returns the current value of LastUpdatedBy. 
269 (In the database, LastUpdatedBy is stored as int(11).)
270
271
272 =cut
273
274
275 =item Creator
276
277 Returns the current value of Creator. 
278 (In the database, Creator is stored as int(11).)
279
280
281 =cut
282
283
284 =item Created
285
286 Returns the current value of Created. 
287 (In the database, Created is stored as datetime.)
288
289
290 =cut
291
292
293
294 sub _ClassAccessible {
295     {
296      
297         id =>
298                 {read => 1, type => 'int(11)', default => ''},
299         Queue => 
300                 {read => 1, write => 1, type => 'int(11)', default => '0'},
301         Name => 
302                 {read => 1, write => 1, type => 'varchar(200)', default => ''},
303         Description => 
304                 {read => 1, write => 1, type => 'varchar(255)', default => ''},
305         Type => 
306                 {read => 1, write => 1, type => 'varchar(16)', default => ''},
307         Language => 
308                 {read => 1, write => 1, type => 'varchar(16)', default => ''},
309         TranslationOf => 
310                 {read => 1, write => 1, type => 'int(11)', default => '0'},
311         Content => 
312                 {read => 1, write => 1, type => 'blob', default => ''},
313         LastUpdated => 
314                 {read => 1, auto => 1, type => 'datetime', default => ''},
315         LastUpdatedBy => 
316                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
317         Creator => 
318                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
319         Created => 
320                 {read => 1, auto => 1, type => 'datetime', default => ''},
321
322  }
323 };
324
325
326         eval "require RT::Template_Overlay";
327         if ($@ && $@ !~ qr{^Can't locate RT/Template_Overlay.pm}) {
328             die $@;
329         };
330
331         eval "require RT::Template_Vendor";
332         if ($@ && $@ !~ qr{^Can't locate RT/Template_Vendor.pm}) {
333             die $@;
334         };
335
336         eval "require RT::Template_Local";
337         if ($@ && $@ !~ qr{^Can't locate RT/Template_Local.pm}) {
338             die $@;
339         };
340
341
342
343
344 =head1 SEE ALSO
345
346 This class allows "overlay" methods to be placed
347 into the following files _Overlay is for a System overlay by the original author,
348 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
349
350 These overlay files can contain new subs or subs to replace existing subs in this module.
351
352 If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line 
353
354    no warnings qw(redefine);
355
356 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
357
358 RT::Template_Overlay, RT::Template_Vendor, RT::Template_Local
359
360 =cut
361
362
363 1;