From 3ef62a0570055da710328937e7f65dbb2c027c62 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 12 Aug 2002 06:17:09 +0000 Subject: import rt 2.0.14 --- rt/lib/RT/Template.pm | 395 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 395 insertions(+) create mode 100755 rt/lib/RT/Template.pm (limited to 'rt/lib/RT/Template.pm') diff --git a/rt/lib/RT/Template.pm b/rt/lib/RT/Template.pm new file mode 100755 index 000000000..3ef96c7df --- /dev/null +++ b/rt/lib/RT/Template.pm @@ -0,0 +1,395 @@ +# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Template.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $ +# Copyright 1996-2002 Jesse Vincent +# Portions Copyright 2000 Tobias Brox +# Released under the terms of the GNU General Public License + +=head1 NAME + + RT::Template - RT's template object + +=head1 SYNOPSIS + + use RT::Template; + + +=head1 DESCRIPTION + + +=head1 METHODS + +=begin testing + +ok(require RT::TestHarness); +ok(require RT::Template); + +=end testing + +=cut + +package RT::Template; +use RT::Record; +use MIME::Entity; +use MIME::Parser; + +@ISA = qw(RT::Record); + +# {{{ sub _Init + +sub _Init { + my $self = shift; + $self->{'table'} = "Templates"; + return ( $self->SUPER::_Init(@_) ); +} + +# }}} + +# {{{ sub _Accessible + +sub _Accessible { + my $self = shift; + my %Cols = ( + id => 'read', + Name => 'read/write', + Description => 'read/write', + Type => 'read/write', #Type is one of Action or Message + Content => 'read/write', + Queue => 'read/write', + Creator => 'read/auto', + Created => 'read/auto', + LastUpdatedBy => 'read/auto', + LastUpdated => 'read/auto' + ); + return $self->SUPER::_Accessible( @_, %Cols ); +} + +# }}} + +# {{{ sub _Set + +sub _Set { + my $self = shift; + + # use super::value or we get acl blocked + if ( ( defined $self->SUPER::_Value('Queue') ) + && ( $self->SUPER::_Value('Queue') == 0 ) ) + { + unless ( $self->CurrentUser->HasSystemRight('ModifyTemplate') ) { + return ( 0, 'Permission Denied' ); + } + } + else { + + unless ( $self->CurrentUserHasQueueRight('ModifyTemplate') ) { + return ( 0, 'Permission Denied' ); + } + } + return ( $self->SUPER::_Set(@_) ); + +} + +# }}} + +# {{{ sub _Value + +=head2 _Value + +Takes the name of a table column. +Returns its value as a string, if the user passes an ACL check + +=cut + +sub _Value { + + my $self = shift; + my $field = shift; + + #If the current user doesn't have ACLs, don't let em at it. + #use super::value or we get acl blocked + if ( ( !defined $self->__Value('Queue') ) + || ( $self->__Value('Queue') == 0 ) ) + { + unless ( $self->CurrentUser->HasSystemRight('ShowTemplate') ) { + return (undef); + } + } + else { + unless ( $self->CurrentUserHasQueueRight('ShowTemplate') ) { + return (undef); + } + } + return ( $self->__Value($field) ); + +} + +# }}} + +# {{{ sub Load + +=head2 Load + +Load a template, either by number or by name + +=cut + +sub Load { + my $self = shift; + my $identifier = shift; + + if ( !$identifier ) { + return (undef); + } + + if ( $identifier !~ /\D/ ) { + $self->SUPER::LoadById($identifier); + } + else { + $self->LoadByCol( 'Name', $identifier ); + + } +} + +# }}} + +# {{{ sub LoadGlobalTemplate + +=head2 LoadGlobalTemplate NAME + +Load the global tempalte with the name NAME + +=cut + +sub LoadGlobalTemplate { + my $self = shift; + my $id = shift; + + return ( $self->LoadQueueTemplate( Queue => 0, Name => $id ) ); +} + +# }}} + +# {{{ sub LoadQueueTemplate + +=head2 LoadQueueTemplate (Queue => QUEUEID, Name => NAME) + +Loads the Queue template named NAME for Queue QUEUE. + +=cut + +sub LoadQueueTemplate { + my $self = shift; + my %args = ( + Queue => undef, + Name => undef + ); + + return ( $self->LoadByCols( Name => $args{'Name'}, Queue => {'Queue'} ) ); + +} + +# }}} + +# {{{ sub Create + +=head2 Create + +Takes a paramhash of Content, Queue, Name and Description. +Name should be a unique string identifying this Template. +Description and Content should be the template's title and content. +Queue should be 0 for a global template and the queue # for a queue-specific +template. + +Returns the Template's id # if the create was successful. Returns undef for +unknown database failure. + + +=cut + +sub Create { + my $self = shift; + my %args = ( + Content => undef, + Queue => 0, + Description => '[no description]', + Type => 'Action', #By default, template are 'Action' templates + Name => undef, + @_ + ); + + if ( $args{'Queue'} == 0 ) { + unless ( $self->CurrentUser->HasSystemRight('ModifyTemplate') ) { + return (undef); + } + } + else { + my $QueueObj = new RT::Queue( $self->CurrentUser ); + $QueueObj->Load( $args{'Queue'} ) || return ( 0, 'Invalid queue' ); + + unless ( $QueueObj->CurrentUserHasRight('ModifyTemplate') ) { + return (undef); + } + } + + my $result = $self->SUPER::Create( + Content => $args{'Content'}, + Queue => $args{'Queue'}, + , + Description => $args{'Description'}, + Name => $args{'Name'} + ); + + return ($result); + +} + +# }}} + +# {{{ sub Delete + +=head2 Delete + +Delete this template. + +=cut + +sub Delete { + my $self = shift; + + unless ( $self->CurrentUserHasRight('ModifyTemplate') ) { + return ( 0, 'Permission Denied' ); + } + + return ( $self->SUPER::Delete(@_) ); +} + +# }}} + +# {{{ sub MIMEObj +sub MIMEObj { + my $self = shift; + return ( $self->{'MIMEObj'} ); +} + +# }}} + +# {{{ sub Parse + +=item Parse + + This routine performs Text::Template parsing on thte template and then imports the + results into a MIME::Entity so we can really use it + It returns a tuple of (val, message) + If val is 0, the message contains an error message + +=cut + +sub Parse { + my $self = shift; + + #We're passing in whatever we were passed. it's destined for _ParseContent + my $content = $self->_ParseContent(@_); + + #Lets build our mime Entity + + my $parser = MIME::Parser->new(); + + # Do work on the parsed template in memory, rather than on disk + $parser->output_to_core(1); + + ### Should we forgive normally-fatal errors? + $parser->ignore_errors(1); + $self->{'MIMEObj'} = eval { $parser->parse_data($content) }; + $error = ( $@ || $parser->last_error ); + + if ($error) { + $RT::Logger->error("$error"); + return ( 0, $error ); + } + + # Unfold all headers + $self->{'MIMEObj'}->head->unfold(); + + return ( 1, "Template parsed" ); + + +} + +# }}} + +# {{{ sub _ParseContent + +# Perform Template substitutions on the template + +sub _ParseContent { + my $self = shift; + my %args = ( + Argument => undef, + TicketObj => undef, + TransactionObj => undef, + @_ + ); + + # Might be subject to change + use Text::Template; + + $T::Ticket = $args{'TicketObj'}; + $T::Transaction = $args{'TransactionObj'}; + $T::Argument = $args{'Argument'}; + $T::rtname = $RT::rtname; + + # We need to untaint the content of the template, since we'll be working + # with it + my $content = $self->Content(); + $content =~ s/^(.*)$/$1/; + $template = Text::Template->new( + TYPE => STRING, + SOURCE => $content + ); + + my $retval = $template->fill_in( PACKAGE => T ); + return ($retval); +} + +# }}} + +# {{{ sub QueueObj + +=head2 QueueObj + +Takes nothing. returns this ticket's queue object + +=cut + +sub QueueObj { + my $self = shift; + if ( !defined $self->{'queue'} ) { + require RT::Queue; + $self->{'queue'} = RT::Queue->new( $self->CurrentUser ); + + unless ( $self->{'queue'} ) { + $RT::Logger->crit( + "RT::Queue->new(" . $self->CurrentUser . ") returned false" ); + return (undef); + } + my ($result) = $self->{'queue'}->Load( $self->__Value('Queue') ); + + } + return ( $self->{'queue'} ); +} + +# }}} + +# {{{ sub CurrentUserHasQueueRight + +=head2 CurrentUserHasQueueRight + +Helper function to call the template's queue's CurrentUserHasQueueRight with the passed in args. + +=cut + +sub CurrentUserHasQueueRight { + my $self = shift; + return ( $self->QueueObj->CurrentUserHasRight(@_) ); +} + +# }}} +1; -- cgit v1.2.1 From 945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 15 Jul 2003 13:16:32 +0000 Subject: import of rt 3.0.4 --- rt/lib/RT/Template.pm | 512 +++++++++++++++++++++++--------------------------- 1 file changed, 240 insertions(+), 272 deletions(-) (limited to 'rt/lib/RT/Template.pm') diff --git a/rt/lib/RT/Template.pm b/rt/lib/RT/Template.pm index 3ef96c7df..f73ea3ed6 100755 --- a/rt/lib/RT/Template.pm +++ b/rt/lib/RT/Template.pm @@ -1,395 +1,363 @@ -# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Template.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $ -# Copyright 1996-2002 Jesse Vincent -# Portions Copyright 2000 Tobias Brox -# Released under the terms of the GNU General Public License +# BEGIN LICENSE BLOCK +# +# Copyright (c) 1996-2003 Jesse Vincent +# +# (Except where explictly superceded by other copyright notices) +# +# This work is made available to you under the terms of Version 2 of +# the GNU General Public License. A copy of that license should have +# been provided with this software, but in any event can be snarfed +# from www.gnu.org. +# +# This work is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# Unless otherwise specified, all modifications, corrections or +# extensions to this work which alter its source code become the +# property of Best Practical Solutions, LLC when submitted for +# inclusion in the work. +# +# +# END LICENSE BLOCK +# Autogenerated by DBIx::SearchBuilder factory (by ) +# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST. +# +# !! DO NOT EDIT THIS FILE !! +# + +use strict; + =head1 NAME - RT::Template - RT's template object +RT::Template + =head1 SYNOPSIS - use RT::Template; +=head1 DESCRIPTION +=head1 METHODS -=head1 DESCRIPTION +=cut +package RT::Template; +use RT::Record; +use RT::Queue; -=head1 METHODS -=begin testing +use vars qw( @ISA ); +@ISA= qw( RT::Record ); + +sub _Init { + my $self = shift; + + $self->Table('Templates'); + $self->SUPER::_Init(@_); +} + + + + + +=item Create PARAMHASH -ok(require RT::TestHarness); -ok(require RT::Template); +Create takes a hash of values and creates a row in the database: -=end testing + int(11) 'Queue'. + varchar(200) 'Name'. + varchar(255) 'Description'. + varchar(16) 'Type'. + varchar(16) 'Language'. + int(11) 'TranslationOf'. + blob 'Content'. =cut -package RT::Template; -use RT::Record; -use MIME::Entity; -use MIME::Parser; -@ISA = qw(RT::Record); -# {{{ sub _Init -sub _Init { +sub Create { my $self = shift; - $self->{'table'} = "Templates"; - return ( $self->SUPER::_Init(@_) ); + my %args = ( + Queue => '0', + Name => '', + Description => '', + Type => '', + Language => '', + TranslationOf => '0', + Content => '', + + @_); + $self->SUPER::Create( + Queue => $args{'Queue'}, + Name => $args{'Name'}, + Description => $args{'Description'}, + Type => $args{'Type'}, + Language => $args{'Language'}, + TranslationOf => $args{'TranslationOf'}, + Content => $args{'Content'}, +); + } -# }}} -# {{{ sub _Accessible -sub _Accessible { - my $self = shift; - my %Cols = ( - id => 'read', - Name => 'read/write', - Description => 'read/write', - Type => 'read/write', #Type is one of Action or Message - Content => 'read/write', - Queue => 'read/write', - Creator => 'read/auto', - Created => 'read/auto', - LastUpdatedBy => 'read/auto', - LastUpdated => 'read/auto' - ); - return $self->SUPER::_Accessible( @_, %Cols ); -} +=item id -# }}} +Returns the current value of id. +(In the database, id is stored as int(11).) -# {{{ sub _Set -sub _Set { - my $self = shift; +=cut - # use super::value or we get acl blocked - if ( ( defined $self->SUPER::_Value('Queue') ) - && ( $self->SUPER::_Value('Queue') == 0 ) ) - { - unless ( $self->CurrentUser->HasSystemRight('ModifyTemplate') ) { - return ( 0, 'Permission Denied' ); - } - } - else { - - unless ( $self->CurrentUserHasQueueRight('ModifyTemplate') ) { - return ( 0, 'Permission Denied' ); - } - } - return ( $self->SUPER::_Set(@_) ); -} +=item Queue + +Returns the current value of Queue. +(In the database, Queue is stored as int(11).) -# }}} -# {{{ sub _Value -=head2 _Value +=item SetQueue VALUE + + +Set Queue to VALUE. +Returns (1, 'Status message') on success and (0, 'Error Message') on failure. +(In the database, Queue will be stored as a int(11).) -Takes the name of a table column. -Returns its value as a string, if the user passes an ACL check =cut -sub _Value { - my $self = shift; - my $field = shift; +=item QueueObj - #If the current user doesn't have ACLs, don't let em at it. - #use super::value or we get acl blocked - if ( ( !defined $self->__Value('Queue') ) - || ( $self->__Value('Queue') == 0 ) ) - { - unless ( $self->CurrentUser->HasSystemRight('ShowTemplate') ) { - return (undef); - } - } - else { - unless ( $self->CurrentUserHasQueueRight('ShowTemplate') ) { - return (undef); - } - } - return ( $self->__Value($field) ); +Returns the Queue Object which has the id returned by Queue + +=cut + +sub QueueObj { + my $self = shift; + my $Queue = RT::Queue->new($self->CurrentUser); + $Queue->Load($self->__Value('Queue')); + return($Queue); } -# }}} +=item Name + +Returns the current value of Name. +(In the database, Name is stored as varchar(200).) + + -# {{{ sub Load +=item SetName VALUE -=head2 Load -Load a template, either by number or by name +Set Name to VALUE. +Returns (1, 'Status message') on success and (0, 'Error Message') on failure. +(In the database, Name will be stored as a varchar(200).) + =cut -sub Load { - my $self = shift; - my $identifier = shift; - if ( !$identifier ) { - return (undef); - } +=item Description + +Returns the current value of Description. +(In the database, Description is stored as varchar(255).) - if ( $identifier !~ /\D/ ) { - $self->SUPER::LoadById($identifier); - } - else { - $self->LoadByCol( 'Name', $identifier ); - } -} -# }}} +=item SetDescription VALUE -# {{{ sub LoadGlobalTemplate -=head2 LoadGlobalTemplate NAME +Set Description to VALUE. +Returns (1, 'Status message') on success and (0, 'Error Message') on failure. +(In the database, Description will be stored as a varchar(255).) -Load the global tempalte with the name NAME =cut -sub LoadGlobalTemplate { - my $self = shift; - my $id = shift; - return ( $self->LoadQueueTemplate( Queue => 0, Name => $id ) ); -} +=item Type -# }}} +Returns the current value of Type. +(In the database, Type is stored as varchar(16).) -# {{{ sub LoadQueueTemplate -=head2 LoadQueueTemplate (Queue => QUEUEID, Name => NAME) -Loads the Queue template named NAME for Queue QUEUE. +=item SetType VALUE + + +Set Type to VALUE. +Returns (1, 'Status message') on success and (0, 'Error Message') on failure. +(In the database, Type will be stored as a varchar(16).) + =cut -sub LoadQueueTemplate { - my $self = shift; - my %args = ( - Queue => undef, - Name => undef - ); - return ( $self->LoadByCols( Name => $args{'Name'}, Queue => {'Queue'} ) ); +=item Language -} +Returns the current value of Language. +(In the database, Language is stored as varchar(16).) -# }}} -# {{{ sub Create -=head2 Create +=item SetLanguage VALUE -Takes a paramhash of Content, Queue, Name and Description. -Name should be a unique string identifying this Template. -Description and Content should be the template's title and content. -Queue should be 0 for a global template and the queue # for a queue-specific -template. -Returns the Template's id # if the create was successful. Returns undef for -unknown database failure. +Set Language to VALUE. +Returns (1, 'Status message') on success and (0, 'Error Message') on failure. +(In the database, Language will be stored as a varchar(16).) =cut -sub Create { - my $self = shift; - my %args = ( - Content => undef, - Queue => 0, - Description => '[no description]', - Type => 'Action', #By default, template are 'Action' templates - Name => undef, - @_ - ); - - if ( $args{'Queue'} == 0 ) { - unless ( $self->CurrentUser->HasSystemRight('ModifyTemplate') ) { - return (undef); - } - } - else { - my $QueueObj = new RT::Queue( $self->CurrentUser ); - $QueueObj->Load( $args{'Queue'} ) || return ( 0, 'Invalid queue' ); - - unless ( $QueueObj->CurrentUserHasRight('ModifyTemplate') ) { - return (undef); - } - } - - my $result = $self->SUPER::Create( - Content => $args{'Content'}, - Queue => $args{'Queue'}, - , - Description => $args{'Description'}, - Name => $args{'Name'} - ); - - return ($result); -} +=item TranslationOf + +Returns the current value of TranslationOf. +(In the database, TranslationOf is stored as int(11).) + + -# }}} +=item SetTranslationOf VALUE -# {{{ sub Delete -=head2 Delete +Set TranslationOf to VALUE. +Returns (1, 'Status message') on success and (0, 'Error Message') on failure. +(In the database, TranslationOf will be stored as a int(11).) -Delete this template. =cut -sub Delete { - my $self = shift; - unless ( $self->CurrentUserHasRight('ModifyTemplate') ) { - return ( 0, 'Permission Denied' ); - } +=item Content - return ( $self->SUPER::Delete(@_) ); -} +Returns the current value of Content. +(In the database, Content is stored as blob.) -# }}} -# {{{ sub MIMEObj -sub MIMEObj { - my $self = shift; - return ( $self->{'MIMEObj'} ); -} -# }}} +=item SetContent VALUE -# {{{ sub Parse -=item Parse +Set Content to VALUE. +Returns (1, 'Status message') on success and (0, 'Error Message') on failure. +(In the database, Content will be stored as a blob.) - This routine performs Text::Template parsing on thte template and then imports the - results into a MIME::Entity so we can really use it - It returns a tuple of (val, message) - If val is 0, the message contains an error message =cut -sub Parse { - my $self = shift; - #We're passing in whatever we were passed. it's destined for _ParseContent - my $content = $self->_ParseContent(@_); +=item LastUpdated - #Lets build our mime Entity +Returns the current value of LastUpdated. +(In the database, LastUpdated is stored as datetime.) - my $parser = MIME::Parser->new(); - - # Do work on the parsed template in memory, rather than on disk - $parser->output_to_core(1); - ### Should we forgive normally-fatal errors? - $parser->ignore_errors(1); - $self->{'MIMEObj'} = eval { $parser->parse_data($content) }; - $error = ( $@ || $parser->last_error ); +=cut - if ($error) { - $RT::Logger->error("$error"); - return ( 0, $error ); - } - # Unfold all headers - $self->{'MIMEObj'}->head->unfold(); +=item LastUpdatedBy - return ( 1, "Template parsed" ); - +Returns the current value of LastUpdatedBy. +(In the database, LastUpdatedBy is stored as int(11).) -} -# }}} +=cut -# {{{ sub _ParseContent -# Perform Template substitutions on the template +=item Creator -sub _ParseContent { - my $self = shift; - my %args = ( - Argument => undef, - TicketObj => undef, - TransactionObj => undef, - @_ - ); - - # Might be subject to change - use Text::Template; - - $T::Ticket = $args{'TicketObj'}; - $T::Transaction = $args{'TransactionObj'}; - $T::Argument = $args{'Argument'}; - $T::rtname = $RT::rtname; - - # We need to untaint the content of the template, since we'll be working - # with it - my $content = $self->Content(); - $content =~ s/^(.*)$/$1/; - $template = Text::Template->new( - TYPE => STRING, - SOURCE => $content - ); - - my $retval = $template->fill_in( PACKAGE => T ); - return ($retval); -} +Returns the current value of Creator. +(In the database, Creator is stored as int(11).) -# }}} -# {{{ sub QueueObj +=cut -=head2 QueueObj -Takes nothing. returns this ticket's queue object +=item Created + +Returns the current value of Created. +(In the database, Created is stored as datetime.) + =cut -sub QueueObj { - my $self = shift; - if ( !defined $self->{'queue'} ) { - require RT::Queue; - $self->{'queue'} = RT::Queue->new( $self->CurrentUser ); - - unless ( $self->{'queue'} ) { - $RT::Logger->crit( - "RT::Queue->new(" . $self->CurrentUser . ") returned false" ); - return (undef); - } - my ($result) = $self->{'queue'}->Load( $self->__Value('Queue') ); - - } - return ( $self->{'queue'} ); -} -# }}} -# {{{ sub CurrentUserHasQueueRight +sub _ClassAccessible { + { + + id => + {read => 1, type => 'int(11)', default => ''}, + Queue => + {read => 1, write => 1, type => 'int(11)', default => '0'}, + Name => + {read => 1, write => 1, type => 'varchar(200)', default => ''}, + Description => + {read => 1, write => 1, type => 'varchar(255)', default => ''}, + Type => + {read => 1, write => 1, type => 'varchar(16)', default => ''}, + Language => + {read => 1, write => 1, type => 'varchar(16)', default => ''}, + TranslationOf => + {read => 1, write => 1, type => 'int(11)', default => '0'}, + Content => + {read => 1, write => 1, type => 'blob', default => ''}, + LastUpdated => + {read => 1, auto => 1, type => 'datetime', default => ''}, + LastUpdatedBy => + {read => 1, auto => 1, type => 'int(11)', default => '0'}, + Creator => + {read => 1, auto => 1, type => 'int(11)', default => '0'}, + Created => + {read => 1, auto => 1, type => 'datetime', default => ''}, + + } +}; + + + eval "require RT::Template_Overlay"; + if ($@ && $@ !~ qr{^Can't locate RT/Template_Overlay.pm}) { + die $@; + }; + + eval "require RT::Template_Vendor"; + if ($@ && $@ !~ qr{^Can't locate RT/Template_Vendor.pm}) { + die $@; + }; + + eval "require RT::Template_Local"; + if ($@ && $@ !~ qr{^Can't locate RT/Template_Local.pm}) { + die $@; + }; -=head2 CurrentUserHasQueueRight -Helper function to call the template's queue's CurrentUserHasQueueRight with the passed in args. + + +=head1 SEE ALSO + +This class allows "overlay" methods to be placed +into the following files _Overlay is for a System overlay by the original author, +_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations. + +These overlay files can contain new subs or subs to replace existing subs in this module. + +If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line + + no warnings qw(redefine); + +so that perl does not kick and scream when you redefine a subroutine or variable in your overlay. + +RT::Template_Overlay, RT::Template_Vendor, RT::Template_Local =cut -sub CurrentUserHasQueueRight { - my $self = shift; - return ( $self->QueueObj->CurrentUserHasRight(@_) ); -} -# }}} 1; -- cgit v1.2.1 From d39d52aac8f38ea9115628039f0df5aa3ac826de Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 3 Dec 2004 20:40:48 +0000 Subject: import rt 3.2.2 --- rt/lib/RT/Template.pm | 82 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 30 deletions(-) (limited to 'rt/lib/RT/Template.pm') diff --git a/rt/lib/RT/Template.pm b/rt/lib/RT/Template.pm index f73ea3ed6..c18a7505f 100755 --- a/rt/lib/RT/Template.pm +++ b/rt/lib/RT/Template.pm @@ -1,8 +1,14 @@ -# BEGIN LICENSE BLOCK +# {{{ BEGIN BPS TAGGED BLOCK # -# Copyright (c) 1996-2003 Jesse Vincent +# COPYRIGHT: +# +# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +# # -# (Except where explictly superceded by other copyright notices) +# (Except where explicitly superseded by other copyright notices) +# +# +# LICENSE: # # This work is made available to you under the terms of Version 2 of # the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # -# Unless otherwise specified, all modifications, corrections or -# extensions to this work which alter its source code become the -# property of Best Practical Solutions, LLC when submitted for -# inclusion in the work. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# +# CONTRIBUTION SUBMISSION POLICY: +# +# (The following paragraph is not intended to limit the rights granted +# to you to modify and distribute this software under the terms of +# the GNU General Public License and is only of importance to you if +# you choose to contribute your changes and enhancements to the +# community by submitting them to Best Practical Solutions, LLC.) # +# By intentionally submitting any modifications, corrections or +# derivatives to this work, or any other work intended for use with +# Request Tracker, to Best Practical Solutions, LLC, you confirm that +# you are the copyright holder for those contributions and you grant +# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +# royalty-free, perpetual, license to use, copy, create derivative +# works based on those contributions, and sublicense and distribute +# those contributions and any derivatives thereof. # -# END LICENSE BLOCK +# }}} END BPS TAGGED BLOCK # Autogenerated by DBIx::SearchBuilder factory (by ) # WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST. # @@ -62,7 +84,7 @@ sub _Init { -=item Create PARAMHASH +=head2 Create PARAMHASH Create takes a hash of values and creates a row in the database: @@ -105,7 +127,7 @@ sub Create { -=item id +=head2 id Returns the current value of id. (In the database, id is stored as int(11).) @@ -114,14 +136,14 @@ Returns the current value of id. =cut -=item Queue +=head2 Queue Returns the current value of Queue. (In the database, Queue is stored as int(11).) -=item SetQueue VALUE +=head2 SetQueue VALUE Set Queue to VALUE. @@ -132,7 +154,7 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure. =cut -=item QueueObj +=head2 QueueObj Returns the Queue Object which has the id returned by Queue @@ -146,14 +168,14 @@ sub QueueObj { return($Queue); } -=item Name +=head2 Name Returns the current value of Name. (In the database, Name is stored as varchar(200).) -=item SetName VALUE +=head2 SetName VALUE Set Name to VALUE. @@ -164,14 +186,14 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure. =cut -=item Description +=head2 Description Returns the current value of Description. (In the database, Description is stored as varchar(255).) -=item SetDescription VALUE +=head2 SetDescription VALUE Set Description to VALUE. @@ -182,14 +204,14 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure. =cut -=item Type +=head2 Type Returns the current value of Type. (In the database, Type is stored as varchar(16).) -=item SetType VALUE +=head2 SetType VALUE Set Type to VALUE. @@ -200,14 +222,14 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure. =cut -=item Language +=head2 Language Returns the current value of Language. (In the database, Language is stored as varchar(16).) -=item SetLanguage VALUE +=head2 SetLanguage VALUE Set Language to VALUE. @@ -218,14 +240,14 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure. =cut -=item TranslationOf +=head2 TranslationOf Returns the current value of TranslationOf. (In the database, TranslationOf is stored as int(11).) -=item SetTranslationOf VALUE +=head2 SetTranslationOf VALUE Set TranslationOf to VALUE. @@ -236,14 +258,14 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure. =cut -=item Content +=head2 Content Returns the current value of Content. (In the database, Content is stored as blob.) -=item SetContent VALUE +=head2 SetContent VALUE Set Content to VALUE. @@ -254,7 +276,7 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure. =cut -=item LastUpdated +=head2 LastUpdated Returns the current value of LastUpdated. (In the database, LastUpdated is stored as datetime.) @@ -263,7 +285,7 @@ Returns the current value of LastUpdated. =cut -=item LastUpdatedBy +=head2 LastUpdatedBy Returns the current value of LastUpdatedBy. (In the database, LastUpdatedBy is stored as int(11).) @@ -272,7 +294,7 @@ Returns the current value of LastUpdatedBy. =cut -=item Creator +=head2 Creator Returns the current value of Creator. (In the database, Creator is stored as int(11).) @@ -281,7 +303,7 @@ Returns the current value of Creator. =cut -=item Created +=head2 Created Returns the current value of Created. (In the database, Created is stored as datetime.) @@ -291,7 +313,7 @@ Returns the current value of Created. -sub _ClassAccessible { +sub _CoreAccessible { { id => -- cgit v1.2.1 From d4d0590bef31071e8809ec046717444b95b3f30a Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 15 Oct 2005 09:11:20 +0000 Subject: import rt 3.4.4 --- rt/lib/RT/Template.pm | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'rt/lib/RT/Template.pm') diff --git a/rt/lib/RT/Template.pm b/rt/lib/RT/Template.pm index c18a7505f..4f7aacb2c 100755 --- a/rt/lib/RT/Template.pm +++ b/rt/lib/RT/Template.pm @@ -1,8 +1,8 @@ -# {{{ BEGIN BPS TAGGED BLOCK +# BEGIN BPS TAGGED BLOCK {{{ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ # works based on those contributions, and sublicense and distribute # those contributions and any derivatives thereof. # -# }}} END BPS TAGGED BLOCK +# END BPS TAGGED BLOCK }}} # Autogenerated by DBIx::SearchBuilder factory (by ) # WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST. # @@ -317,29 +317,29 @@ sub _CoreAccessible { { id => - {read => 1, type => 'int(11)', default => ''}, + {read => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => ''}, Queue => - {read => 1, write => 1, type => 'int(11)', default => '0'}, + {read => 1, write => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'}, Name => - {read => 1, write => 1, type => 'varchar(200)', default => ''}, + {read => 1, write => 1, sql_type => 12, length => 200, is_blob => 0, is_numeric => 0, type => 'varchar(200)', default => ''}, Description => - {read => 1, write => 1, type => 'varchar(255)', default => ''}, + {read => 1, write => 1, sql_type => 12, length => 255, is_blob => 0, is_numeric => 0, type => 'varchar(255)', default => ''}, Type => - {read => 1, write => 1, type => 'varchar(16)', default => ''}, + {read => 1, write => 1, sql_type => 12, length => 16, is_blob => 0, is_numeric => 0, type => 'varchar(16)', default => ''}, Language => - {read => 1, write => 1, type => 'varchar(16)', default => ''}, + {read => 1, write => 1, sql_type => 12, length => 16, is_blob => 0, is_numeric => 0, type => 'varchar(16)', default => ''}, TranslationOf => - {read => 1, write => 1, type => 'int(11)', default => '0'}, + {read => 1, write => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'}, Content => - {read => 1, write => 1, type => 'blob', default => ''}, + {read => 1, write => 1, sql_type => -4, length => 0, is_blob => 1, is_numeric => 0, type => 'blob', default => ''}, LastUpdated => - {read => 1, auto => 1, type => 'datetime', default => ''}, + {read => 1, auto => 1, sql_type => 11, length => 0, is_blob => 0, is_numeric => 0, type => 'datetime', default => ''}, LastUpdatedBy => - {read => 1, auto => 1, type => 'int(11)', default => '0'}, + {read => 1, auto => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'}, Creator => - {read => 1, auto => 1, type => 'int(11)', default => '0'}, + {read => 1, auto => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'}, Created => - {read => 1, auto => 1, type => 'datetime', default => ''}, + {read => 1, auto => 1, sql_type => 11, length => 0, is_blob => 0, is_numeric => 0, type => 'datetime', default => ''}, } }; @@ -371,7 +371,7 @@ _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customiz These overlay files can contain new subs or subs to replace existing subs in this module. -If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line +Each of these files should begin with the line no warnings qw(redefine); -- cgit v1.2.1