import rt 3.4.6
[freeside.git] / rt / lib / RT / Template.pm
1 # BEGIN BPS TAGGED BLOCK {{{
2
3 # COPYRIGHT:
4 #  
5 # This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC 
6 #                                          <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA.
26
27
28 # CONTRIBUTION SUBMISSION POLICY:
29
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.)
35
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.
44
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.  
48
49 # !! DO NOT EDIT THIS FILE !!
50 #
51
52 use strict;
53
54
55 =head1 NAME
56
57 RT::Template
58
59
60 =head1 SYNOPSIS
61
62 =head1 DESCRIPTION
63
64 =head1 METHODS
65
66 =cut
67
68 package RT::Template;
69 use RT::Record; 
70 use RT::Queue;
71
72
73 use vars qw( @ISA );
74 @ISA= qw( RT::Record );
75
76 sub _Init {
77   my $self = shift; 
78
79   $self->Table('Templates');
80   $self->SUPER::_Init(@_);
81 }
82
83
84
85
86
87 =head2 Create PARAMHASH
88
89 Create takes a hash of values and creates a row in the database:
90
91   int(11) 'Queue'.
92   varchar(200) 'Name'.
93   varchar(255) 'Description'.
94   varchar(16) 'Type'.
95   varchar(16) 'Language'.
96   int(11) 'TranslationOf'.
97   blob 'Content'.
98
99 =cut
100
101
102
103
104 sub Create {
105     my $self = shift;
106     my %args = ( 
107                 Queue => '0',
108                 Name => '',
109                 Description => '',
110                 Type => '',
111                 Language => '',
112                 TranslationOf => '0',
113                 Content => '',
114
115                   @_);
116     $self->SUPER::Create(
117                          Queue => $args{'Queue'},
118                          Name => $args{'Name'},
119                          Description => $args{'Description'},
120                          Type => $args{'Type'},
121                          Language => $args{'Language'},
122                          TranslationOf => $args{'TranslationOf'},
123                          Content => $args{'Content'},
124 );
125
126 }
127
128
129
130 =head2 id
131
132 Returns the current value of id. 
133 (In the database, id is stored as int(11).)
134
135
136 =cut
137
138
139 =head2 Queue
140
141 Returns the current value of Queue. 
142 (In the database, Queue is stored as int(11).)
143
144
145
146 =head2 SetQueue VALUE
147
148
149 Set Queue to VALUE. 
150 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
151 (In the database, Queue will be stored as a int(11).)
152
153
154 =cut
155
156
157 =head2 QueueObj
158
159 Returns the Queue Object which has the id returned by Queue
160
161
162 =cut
163
164 sub QueueObj {
165         my $self = shift;
166         my $Queue =  RT::Queue->new($self->CurrentUser);
167         $Queue->Load($self->__Value('Queue'));
168         return($Queue);
169 }
170
171 =head2 Name
172
173 Returns the current value of Name. 
174 (In the database, Name is stored as varchar(200).)
175
176
177
178 =head2 SetName VALUE
179
180
181 Set Name to VALUE. 
182 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
183 (In the database, Name will be stored as a varchar(200).)
184
185
186 =cut
187
188
189 =head2 Description
190
191 Returns the current value of Description. 
192 (In the database, Description is stored as varchar(255).)
193
194
195
196 =head2 SetDescription VALUE
197
198
199 Set Description to VALUE. 
200 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
201 (In the database, Description will be stored as a varchar(255).)
202
203
204 =cut
205
206
207 =head2 Type
208
209 Returns the current value of Type. 
210 (In the database, Type is stored as varchar(16).)
211
212
213
214 =head2 SetType VALUE
215
216
217 Set Type to VALUE. 
218 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
219 (In the database, Type will be stored as a varchar(16).)
220
221
222 =cut
223
224
225 =head2 Language
226
227 Returns the current value of Language. 
228 (In the database, Language is stored as varchar(16).)
229
230
231
232 =head2 SetLanguage VALUE
233
234
235 Set Language to VALUE. 
236 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
237 (In the database, Language will be stored as a varchar(16).)
238
239
240 =cut
241
242
243 =head2 TranslationOf
244
245 Returns the current value of TranslationOf. 
246 (In the database, TranslationOf is stored as int(11).)
247
248
249
250 =head2 SetTranslationOf VALUE
251
252
253 Set TranslationOf to VALUE. 
254 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
255 (In the database, TranslationOf will be stored as a int(11).)
256
257
258 =cut
259
260
261 =head2 Content
262
263 Returns the current value of Content. 
264 (In the database, Content is stored as blob.)
265
266
267
268 =head2 SetContent VALUE
269
270
271 Set Content to VALUE. 
272 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
273 (In the database, Content will be stored as a blob.)
274
275
276 =cut
277
278
279 =head2 LastUpdated
280
281 Returns the current value of LastUpdated. 
282 (In the database, LastUpdated is stored as datetime.)
283
284
285 =cut
286
287
288 =head2 LastUpdatedBy
289
290 Returns the current value of LastUpdatedBy. 
291 (In the database, LastUpdatedBy is stored as int(11).)
292
293
294 =cut
295
296
297 =head2 Creator
298
299 Returns the current value of Creator. 
300 (In the database, Creator is stored as int(11).)
301
302
303 =cut
304
305
306 =head2 Created
307
308 Returns the current value of Created. 
309 (In the database, Created is stored as datetime.)
310
311
312 =cut
313
314
315
316 sub _CoreAccessible {
317     {
318      
319         id =>
320                 {read => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
321         Queue => 
322                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
323         Name => 
324                 {read => 1, write => 1, sql_type => 12, length => 200,  is_blob => 0,  is_numeric => 0,  type => 'varchar(200)', default => ''},
325         Description => 
326                 {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
327         Type => 
328                 {read => 1, write => 1, sql_type => 12, length => 16,  is_blob => 0,  is_numeric => 0,  type => 'varchar(16)', default => ''},
329         Language => 
330                 {read => 1, write => 1, sql_type => 12, length => 16,  is_blob => 0,  is_numeric => 0,  type => 'varchar(16)', default => ''},
331         TranslationOf => 
332                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
333         Content => 
334                 {read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'blob', default => ''},
335         LastUpdated => 
336                 {read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
337         LastUpdatedBy => 
338                 {read => 1, auto => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
339         Creator => 
340                 {read => 1, auto => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
341         Created => 
342                 {read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
343
344  }
345 };
346
347
348         eval "require RT::Template_Overlay";
349         if ($@ && $@ !~ qr{^Can't locate RT/Template_Overlay.pm}) {
350             die $@;
351         };
352
353         eval "require RT::Template_Vendor";
354         if ($@ && $@ !~ qr{^Can't locate RT/Template_Vendor.pm}) {
355             die $@;
356         };
357
358         eval "require RT::Template_Local";
359         if ($@ && $@ !~ qr{^Can't locate RT/Template_Local.pm}) {
360             die $@;
361         };
362
363
364
365
366 =head1 SEE ALSO
367
368 This class allows "overlay" methods to be placed
369 into the following files _Overlay is for a System overlay by the original author,
370 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
371
372 These overlay files can contain new subs or subs to replace existing subs in this module.
373
374 Each of these files should begin with the line 
375
376    no warnings qw(redefine);
377
378 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
379
380 RT::Template_Overlay, RT::Template_Vendor, RT::Template_Local
381
382 =cut
383
384
385 1;