[Rt-commit] rt branch, overlay_cleanup, updated. rt-3.8.8-449-g87c3806

Jesse Vincent jesse at bestpractical.com
Wed Aug 18 12:24:31 EDT 2010


The branch, overlay_cleanup has been updated
       via  87c380652a5056efb4146fc29d78d8567a9bb195 (commit)
       via  42f173ab8affa637264d6967b39f72d68b1f71e8 (commit)
      from  a548539d14044dab397480c745e5ad249c6ae0c4 (commit)

Summary of changes:
 etc/schema.mysql-4.1              |    2 +-
 lib/RT/ACE.pm                     |   16 +-------
 lib/RT/ACL.pm                     |   19 +-------
 lib/RT/Attachment.pm              |   34 ++++-----------
 lib/RT/Attachments.pm             |   20 +--------
 lib/RT/Attribute.pm               |   30 +++----------
 lib/RT/Attributes.pm              |   20 +--------
 lib/RT/CachedGroupMember.pm       |   22 +---------
 lib/RT/CachedGroupMembers.pm      |   20 +--------
 lib/RT/CustomField.pm             |   39 +++--------------
 lib/RT/CustomFieldValue.pm        |   26 ++----------
 lib/RT/CustomFieldValues.pm       |   46 +++++++-------------
 lib/RT/CustomFields.pm            |   23 ++--------
 lib/RT/Graph/Tickets.pm           |   10 +----
 lib/RT/Group.pm                   |   22 +---------
 lib/RT/GroupMember.pm             |   22 +---------
 lib/RT/GroupMembers.pm            |   20 +--------
 lib/RT/Groups.pm                  |   18 +-------
 lib/RT/Link.pm                    |   22 +---------
 lib/RT/Links.pm                   |   20 +--------
 lib/RT/ObjectCustomField.pm       |   30 +++----------
 lib/RT/ObjectCustomFieldValue.pm  |   52 ++++++++++------------
 lib/RT/ObjectCustomFieldValues.pm |   20 +--------
 lib/RT/ObjectCustomFields.pm      |   20 +--------
 lib/RT/Principal.pm               |   22 +---------
 lib/RT/Principals.pm              |   20 +--------
 lib/RT/Queue.pm                   |   22 +---------
 lib/RT/Queues.pm                  |   20 +--------
 lib/RT/Scrip.pm                   |   22 +---------
 lib/RT/ScripAction.pm             |   30 +++----------
 lib/RT/ScripActions.pm            |   20 +--------
 lib/RT/ScripCondition.pm          |   30 +++----------
 lib/RT/ScripConditions.pm         |   20 +--------
 lib/RT/Scrips.pm                  |   20 +--------
 lib/RT/Template.pm                |   30 +++----------
 lib/RT/Templates.pm               |   20 +--------
 lib/RT/Ticket.pm                  |   84 ++++++++++++++-----------------------
 lib/RT/Tickets.pm                 |   20 +--------
 lib/RT/Transaction.pm             |   22 +---------
 lib/RT/Transactions.pm            |   20 +--------
 lib/RT/User.pm                    |   54 ++++++++----------------
 lib/RT/Users.pm                   |   20 +--------
 sbin/factory                      |   51 ++++++++++-------------
 43 files changed, 222 insertions(+), 898 deletions(-)

- Log -----------------------------------------------------------------
commit 42f173ab8affa637264d6967b39f72d68b1f71e8
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Aug 18 12:16:23 2010 -0400

    update searchbuilder factory to:
    
        * use base
        * use RT::Base->_ImportOverlays();
        * contain the current logic for building SortOrder as we have it in
          the hand-edited "DO NOT EDIT classes

diff --git a/sbin/factory b/sbin/factory
index a42a13f..4d19757 100755
--- a/sbin/factory
+++ b/sbin/factory
@@ -68,7 +68,7 @@ my $LicenseBlock = << '.';
 # 
 # COPYRIGHT:
 # 
-# This software is Copyright (c) 1996-2008 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
 #                                          <jesse at bestpractical.com>
 # 
 # (Except where explicitly superseded by other copyright notices)
@@ -344,11 +344,9 @@ $CreateOutParams);
 
 package $CollectionClassName;
 
-use $CollectionBaseclass;
 use $RecordClassName;
 
-use vars qw( \@ISA );
-\@ISA= qw($CollectionBaseclass);
+use base '$CollectionBaseclass';
 
 
 sub _Init {
@@ -358,7 +356,24 @@ sub _Init {
 
 ";
 
-    if ( $fields{'SortOrder'} ) {
+    if ( $fields{'SortOrder'} && $fields{'Name'} ) {
+        $CollectionClass .= "
+
+  # By default, order by SortOrder
+  \$self->OrderByCols(
+	 { ALIAS => 'main',
+	   FIELD => 'SortOrder',
+	   ORDER => 'ASC' },
+	 { ALIAS => 'main',
+	   FIELD => 'Name',
+	   ORDER => 'ASC' },
+	 { ALIAS => 'main',
+	   FIELD => 'id',
+	   ORDER => 'ASC' },
+     );
+";
+    }
+    elsif ( $fields{'SortOrder'} ) {
 
         $CollectionClass .= "
 
@@ -406,16 +421,12 @@ $RecordClassName
 =cut
 
 package $RecordClassName;
-use $RecordBaseclass; 
 ";
 
     foreach my $key ( keys %requirements ) {
         $RecordClassHeader .= $requirements{$key} . "\n";
     }
-    $RecordClassHeader .= "
-
-use vars qw( \@ISA );
-\@ISA= qw( $RecordBaseclass );
+    $RecordClassHeader .= "use base '$RecordBaseclass';
 
 sub _Init {
   my \$self = shift; 
@@ -468,27 +479,9 @@ sub MagicImport {
     #if (exists \$warnings::{unimport})  {
     #        no warnings qw(redefine);
 
-    my $path = $class;
-    $path =~ s#::#/#gi;
-
-
     my $content = "
-        eval \"require @{[$class]}_Overlay\";
-        if (\$@ && \$@ !~ qr{^Can't locate ".$path."_Overlay.pm}) {
-            die \$@;
-        };
-
-        eval \"require @{[$class]}_Vendor\";
-        if (\$@ && \$@ !~ qr{^Can't locate ".$path."_Vendor.pm}) {
-            die \$@;
-        };
-
-        eval \"require @{[$class]}_Local\";
-        if (\$@ && \$@ !~ qr{^Can't locate ".$path."_Local.pm}) {
-            die \$@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO

commit 87c380652a5056efb4146fc29d78d8567a9bb195
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Aug 18 12:26:23 2010 -0400

    Regenerate core generated files, removing a bunch of string eval
    boilerplate code.

diff --git a/etc/schema.mysql-4.1 b/etc/schema.mysql-4.1
index 172e477..0552ec1 100755
--- a/etc/schema.mysql-4.1
+++ b/etc/schema.mysql-4.1
@@ -168,7 +168,7 @@ CREATE TABLE ACL (
   id INTEGER NOT NULL  AUTO_INCREMENT,
   PrincipalType varchar(25) CHARACTER SET ascii NOT NULL, #"User" "Group", "Owner", "Cc" "AdminCc", "Requestor"
 
-  PrincipalId integer NOT NULL  , #Foreign key to principals
+  PrincipalId integer NOT NULL DEFAULT 0 , #Foreign key to principals
   RightName varchar(25) CHARACTER SET ascii NOT NULL,
   ObjectType varchar(25) CHARACTER SET ascii NOT NULL,
   ObjectId integer NOT NULL default 0,
diff --git a/lib/RT/ACE.pm b/lib/RT/ACE.pm
index 23b30fb..271405d 100755
--- a/lib/RT/ACE.pm
+++ b/lib/RT/ACE.pm
@@ -285,22 +285,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::ACE_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ACE_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ACE_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ACE_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ACE_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ACE_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/ACL.pm b/lib/RT/ACL.pm
index efe3898..0e14a0c 100755
--- a/lib/RT/ACL.pm
+++ b/lib/RT/ACL.pm
@@ -72,9 +72,10 @@ use strict;
 
 package RT::ACL;
 
-use base 'RT::SearchBuilder';
 use RT::ACE;
 
+use base 'RT::SearchBuilder';
+
 
 sub _Init {
     my $self = shift;
@@ -97,22 +98,8 @@ sub NewItem {
     return(RT::ACE->new($self->CurrentUser));
 }
 
-        eval "require RT::ACL_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ACL_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ACL_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ACL_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ACL_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ACL_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Attachment.pm b/lib/RT/Attachment.pm
index ab69f98..137830c 100755
--- a/lib/RT/Attachment.pm
+++ b/lib/RT/Attachment.pm
@@ -69,11 +69,7 @@ RT::Attachment
 =cut
 
 package RT::Attachment;
-use RT::Record; 
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -97,7 +93,7 @@ Create takes a hash of values and creates a row in the database:
   varchar(255) 'Filename'.
   varchar(80) 'ContentType'.
   varchar(80) 'ContentEncoding'.
-  longtext 'Content'.
+  longblob 'Content'.
   longtext 'Headers'.
 
 =cut
@@ -108,7 +104,7 @@ Create takes a hash of values and creates a row in the database:
 sub Create {
     my $self = shift;
     my %args = ( 
-                TransactionId => '0',
+                TransactionId => '',
                 Parent => '0',
                 MessageId => '',
                 Subject => '',
@@ -273,7 +269,7 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =head2 Content
 
 Returns the current value of Content. 
-(In the database, Content is stored as longtext.)
+(In the database, Content is stored as longblob.)
 
 
 
@@ -282,7 +278,7 @@ Returns the current value of Content.
 
 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 longtext.)
+(In the database, Content will be stored as a longblob.)
 
 
 =cut
@@ -331,7 +327,7 @@ sub _CoreAccessible {
         id =>
 		{read => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
         TransactionId => 
-		{read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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 => ''},
         Parent => 
 		{read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
         MessageId => 
@@ -345,7 +341,7 @@ sub _CoreAccessible {
         ContentEncoding => 
 		{read => 1, write => 1, sql_type => 12, length => 80,  is_blob => 0,  is_numeric => 0,  type => 'varchar(80)', default => ''},
         Content => 
-		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'longtext', default => ''},
+		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'longblob', default => ''},
         Headers => 
 		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'longtext', default => ''},
         Creator => 
@@ -357,22 +353,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::Attachment_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attachment_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attachment_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Attachments.pm b/lib/RT/Attachments.pm
index 8b6b154..733e02e 100755
--- a/lib/RT/Attachments.pm
+++ b/lib/RT/Attachments.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::Attachments;
 
-use RT::SearchBuilder;
 use RT::Attachment;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,22 +98,8 @@ sub NewItem {
     return(RT::Attachment->new($self->CurrentUser));
 }
 
-        eval "require RT::Attachments_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attachments_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attachments_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attachments_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attachments_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attachments_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Attribute.pm b/lib/RT/Attribute.pm
index dd293bc..ab4d5ff 100644
--- a/lib/RT/Attribute.pm
+++ b/lib/RT/Attribute.pm
@@ -69,11 +69,7 @@ RT::Attribute
 =cut
 
 package RT::Attribute;
-use RT::Record; 
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -92,7 +88,7 @@ Create takes a hash of values and creates a row in the database:
 
   varchar(255) 'Name'.
   varchar(255) 'Description'.
-  text 'Content'.
+  blob 'Content'.
   varchar(16) 'ContentType'.
   varchar(64) 'ObjectType'.
   int(11) 'ObjectId'.
@@ -174,7 +170,7 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =head2 Content
 
 Returns the current value of Content. 
-(In the database, Content is stored as text.)
+(In the database, Content is stored as blob.)
 
 
 
@@ -183,7 +179,7 @@ Returns the current value of Content.
 
 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 text.)
+(In the database, Content will be stored as a blob.)
 
 
 =cut
@@ -290,7 +286,7 @@ sub _CoreAccessible {
         Description => 
 		{read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
         Content => 
-		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'text', default => ''},
+		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'blob', default => ''},
         ContentType => 
 		{read => 1, write => 1, sql_type => 12, length => 16,  is_blob => 0,  is_numeric => 0,  type => 'varchar(16)', default => ''},
         ObjectType => 
@@ -310,22 +306,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::Attribute_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attribute_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attribute_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attribute_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attribute_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attribute_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Attributes.pm b/lib/RT/Attributes.pm
index 9b8883b..06c8b49 100644
--- a/lib/RT/Attributes.pm
+++ b/lib/RT/Attributes.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::Attributes;
 
-use RT::SearchBuilder;
 use RT::Attribute;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,22 +98,8 @@ sub NewItem {
     return(RT::Attribute->new($self->CurrentUser));
 }
 
-        eval "require RT::Attributes_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attributes_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attributes_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attributes_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attributes_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attributes_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/CachedGroupMember.pm b/lib/RT/CachedGroupMember.pm
index 82dfd3d..e708637 100755
--- a/lib/RT/CachedGroupMember.pm
+++ b/lib/RT/CachedGroupMember.pm
@@ -69,11 +69,7 @@ RT::CachedGroupMember
 =cut
 
 package RT::CachedGroupMember;
-use RT::Record; 
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -243,22 +239,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::CachedGroupMember_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/CachedGroupMember_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CachedGroupMember_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/CachedGroupMember_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CachedGroupMember_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/CachedGroupMember_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/CachedGroupMembers.pm b/lib/RT/CachedGroupMembers.pm
index 56ca32d..4a02b4b 100755
--- a/lib/RT/CachedGroupMembers.pm
+++ b/lib/RT/CachedGroupMembers.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::CachedGroupMembers;
 
-use RT::SearchBuilder;
 use RT::CachedGroupMember;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,22 +98,8 @@ sub NewItem {
     return(RT::CachedGroupMember->new($self->CurrentUser));
 }
 
-        eval "require RT::CachedGroupMembers_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/CachedGroupMembers_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CachedGroupMembers_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/CachedGroupMembers_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CachedGroupMembers_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/CachedGroupMembers_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/CustomField.pm b/lib/RT/CustomField.pm
index 743f154..95f58b7 100755
--- a/lib/RT/CustomField.pm
+++ b/lib/RT/CustomField.pm
@@ -69,11 +69,7 @@ RT::CustomField
 =cut
 
 package RT::CustomField;
-use RT::Record; 
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -93,16 +89,13 @@ Create takes a hash of values and creates a row in the database:
   varchar(200) 'Name'.
   varchar(200) 'Type'.
   int(11) 'MaxValues'.
-  longtext 'Pattern'.
+  text 'Pattern'.
   smallint(6) 'Repeated'.
   varchar(255) 'Description'.
   int(11) 'SortOrder'.
   varchar(255) 'LookupType'.
   smallint(6) 'Disabled'.
 
-  'LookupType' is generally the result of either 
-  RT::Ticket->CustomFieldLookupType or RT::Transaction->CustomFieldLookupType
-
 =cut
 
 
@@ -120,10 +113,8 @@ sub Create {
                 SortOrder => '0',
                 LookupType => '',
                 Disabled => '0',
-                LinkToValue => '',
-                IncludeContentForValue => '',
 
-                  @_);
+		  @_);
     $self->SUPER::Create(
                          Name => $args{'Name'},
                          Type => $args{'Type'},
@@ -134,8 +125,6 @@ sub Create {
                          SortOrder => $args{'SortOrder'},
                          LookupType => $args{'LookupType'},
                          Disabled => $args{'Disabled'},
-                         LinkToValue => $args{'LinkToValue'},
-                         IncludeContentForValue => $args{'IncludeContentForValue'}
 );
 
 }
@@ -208,7 +197,7 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =head2 Pattern
 
 Returns the current value of Pattern. 
-(In the database, Pattern is stored as longtext.)
+(In the database, Pattern is stored as text.)
 
 
 
@@ -217,7 +206,7 @@ Returns the current value of Pattern.
 
 Set Pattern to VALUE. 
 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Pattern will be stored as a longtext.)
+(In the database, Pattern will be stored as a text.)
 
 
 =cut
@@ -362,7 +351,7 @@ sub _CoreAccessible {
         MaxValues => 
 		{read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
         Pattern => 
-		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'longtext', default => ''},
+		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'text', default => ''},
         Repeated => 
 		{read => 1, write => 1, sql_type => 5, length => 6,  is_blob => 0,  is_numeric => 1,  type => 'smallint(6)', default => '0'},
         Description => 
@@ -386,22 +375,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::CustomField_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomField_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomField_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/CustomFieldValue.pm b/lib/RT/CustomFieldValue.pm
index 3967f70..0a1eb15 100755
--- a/lib/RT/CustomFieldValue.pm
+++ b/lib/RT/CustomFieldValue.pm
@@ -69,12 +69,8 @@ RT::CustomFieldValue
 =cut
 
 package RT::CustomFieldValue;
-use RT::Record; 
 use RT::CustomField;
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -104,7 +100,7 @@ Create takes a hash of values and creates a row in the database:
 sub Create {
     my $self = shift;
     my %args = ( 
-                CustomField => '0',
+                CustomField => '',
                 Name => '',
                 Description => '',
                 SortOrder => '0',
@@ -259,7 +255,7 @@ sub _CoreAccessible {
         id =>
 		{read => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
         CustomField => 
-		{read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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 => ''},
         Name => 
 		{read => 1, write => 1, sql_type => 12, length => 200,  is_blob => 0,  is_numeric => 0,  type => 'varchar(200)', default => ''},
         Description => 
@@ -279,22 +275,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::CustomFieldValue_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValue_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomFieldValue_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValue_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomFieldValue_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValue_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/CustomFieldValues.pm b/lib/RT/CustomFieldValues.pm
index 1e33302..e8464c7 100755
--- a/lib/RT/CustomFieldValues.pm
+++ b/lib/RT/CustomFieldValues.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::CustomFieldValues;
 
-use RT::SearchBuilder;
 use RT::CustomFieldValue;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -84,18 +82,20 @@ sub _Init {
     $self->{'table'} = 'CustomFieldValues';
     $self->{'primary_key'} = 'id';
 
-    # By default, order by SortOrder
-    $self->OrderByCols(
-         { ALIAS => 'main',
-           FIELD => 'SortOrder',
-           ORDER => 'ASC' },
-         { ALIAS => 'main',
-           FIELD => 'Name',
-           ORDER => 'ASC' },
-         { ALIAS => 'main',
-           FIELD => 'id',
-           ORDER => 'ASC' },
-    );
+
+
+  # By default, order by SortOrder
+  $self->OrderByCols(
+	 { ALIAS => 'main',
+	   FIELD => 'SortOrder',
+	   ORDER => 'ASC' },
+	 { ALIAS => 'main',
+	   FIELD => 'Name',
+	   ORDER => 'ASC' },
+	 { ALIAS => 'main',
+	   FIELD => 'id',
+	   ORDER => 'ASC' },
+     );
 
     return ( $self->SUPER::_Init(@_) );
 }
@@ -112,22 +112,8 @@ sub NewItem {
     return(RT::CustomFieldValue->new($self->CurrentUser));
 }
 
-        eval "require RT::CustomFieldValues_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValues_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomFieldValues_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValues_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomFieldValues_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValues_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/CustomFields.pm b/lib/RT/CustomFields.pm
index 894be0c..96027fb 100755
--- a/lib/RT/CustomFields.pm
+++ b/lib/RT/CustomFields.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::CustomFields;
 
-use RT::SearchBuilder;
 use RT::CustomField;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -92,6 +90,9 @@ sub _Init {
 	   FIELD => 'SortOrder',
 	   ORDER => 'ASC' },
 	 { ALIAS => 'main',
+	   FIELD => 'Name',
+	   ORDER => 'ASC' },
+	 { ALIAS => 'main',
 	   FIELD => 'id',
 	   ORDER => 'ASC' },
      );
@@ -111,22 +112,8 @@ sub NewItem {
     return(RT::CustomField->new($self->CurrentUser));
 }
 
-        eval "require RT::CustomFields_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFields_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomFields_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFields_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomFields_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFields_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Graph/Tickets.pm b/lib/RT/Graph/Tickets.pm
index 96ef34d..2e0e07f 100644
--- a/lib/RT/Graph/Tickets.pm
+++ b/lib/RT/Graph/Tickets.pm
@@ -345,14 +345,6 @@ sub TicketLinks {
     return $args{'Graph'};
 }
 
-eval "require RT::Graph::Tickets_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Graph/Tickets_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Graph::Tickets_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Graph/Tickets_Local.pm}) {
-    die $@;
-};
+__PACKAGE__->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Group.pm b/lib/RT/Group.pm
index aaad13f..8600861 100755
--- a/lib/RT/Group.pm
+++ b/lib/RT/Group.pm
@@ -69,11 +69,7 @@ RT::Group
 =cut
 
 package RT::Group;
-use RT::Record; 
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -243,22 +239,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::Group_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Group_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Group_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Group_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Group_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Group_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/GroupMember.pm b/lib/RT/GroupMember.pm
index 7bd261a..6616f2f 100755
--- a/lib/RT/GroupMember.pm
+++ b/lib/RT/GroupMember.pm
@@ -69,11 +69,7 @@ RT::GroupMember
 =cut
 
 package RT::GroupMember;
-use RT::Record; 
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -174,22 +170,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::GroupMember_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/GroupMember_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::GroupMember_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/GroupMember_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::GroupMember_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/GroupMember_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/GroupMembers.pm b/lib/RT/GroupMembers.pm
index ac5e379..282e2a6 100755
--- a/lib/RT/GroupMembers.pm
+++ b/lib/RT/GroupMembers.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::GroupMembers;
 
-use RT::SearchBuilder;
 use RT::GroupMember;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,22 +98,8 @@ sub NewItem {
     return(RT::GroupMember->new($self->CurrentUser));
 }
 
-        eval "require RT::GroupMembers_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/GroupMembers_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::GroupMembers_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/GroupMembers_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::GroupMembers_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/GroupMembers_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Groups.pm b/lib/RT/Groups.pm
index 3f09dd0..86f803d 100755
--- a/lib/RT/Groups.pm
+++ b/lib/RT/Groups.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::Groups;
 
-use RT::SearchBuilder;
 use RT::Group;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,20 +98,8 @@ sub NewItem {
     return(RT::Group->new($self->CurrentUser));
 }
 
-        eval "require RT::Groups_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Groups_Overlay.pm}) {
-            die $@;
-        };
 
-        eval "require RT::Groups_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Groups_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Groups_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Groups_Local.pm}) {
-            die $@;
-        };
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Link.pm b/lib/RT/Link.pm
index 3c0a87e..6eb8c98 100755
--- a/lib/RT/Link.pm
+++ b/lib/RT/Link.pm
@@ -69,11 +69,7 @@ RT::Link
 =cut
 
 package RT::Link;
-use RT::Record; 
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -287,22 +283,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::Link_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Link_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Link_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Link_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Link_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Link_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Links.pm b/lib/RT/Links.pm
index 223097d..06f64e1 100755
--- a/lib/RT/Links.pm
+++ b/lib/RT/Links.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::Links;
 
-use RT::SearchBuilder;
 use RT::Link;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,22 +98,8 @@ sub NewItem {
     return(RT::Link->new($self->CurrentUser));
 }
 
-        eval "require RT::Links_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Links_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Links_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Links_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Links_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Links_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/ObjectCustomField.pm b/lib/RT/ObjectCustomField.pm
index a696b99..353fd56 100644
--- a/lib/RT/ObjectCustomField.pm
+++ b/lib/RT/ObjectCustomField.pm
@@ -69,12 +69,8 @@ RT::ObjectCustomField
 =cut
 
 package RT::ObjectCustomField;
-use RT::Record; 
 use RT::CustomField;
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -103,8 +99,8 @@ Create takes a hash of values and creates a row in the database:
 sub Create {
     my $self = shift;
     my %args = ( 
-                CustomField => '0',
-                ObjectId => '0',
+                CustomField => '',
+                ObjectId => '',
                 SortOrder => '0',
 
 		  @_);
@@ -238,9 +234,9 @@ sub _CoreAccessible {
         id =>
 		{read => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
         CustomField => 
-		{read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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 => ''},
         ObjectId => 
-		{read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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 => ''},
         SortOrder => 
 		{read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
         Creator => 
@@ -256,22 +252,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::ObjectCustomField_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomField_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomField_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomField_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomField_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomField_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/ObjectCustomFieldValue.pm b/lib/RT/ObjectCustomFieldValue.pm
index 32617ad..c8b2fbd 100644
--- a/lib/RT/ObjectCustomFieldValue.pm
+++ b/lib/RT/ObjectCustomFieldValue.pm
@@ -69,12 +69,8 @@ RT::ObjectCustomFieldValue
 =cut
 
 package RT::ObjectCustomFieldValue;
-use RT::Record; 
 use RT::CustomField;
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -96,7 +92,7 @@ Create takes a hash of values and creates a row in the database:
   int(11) 'ObjectId'.
   int(11) 'SortOrder'.
   varchar(255) 'Content'.
-  longtext 'LargeContent'.
+  longblob 'LargeContent'.
   varchar(80) 'ContentType'.
   varchar(80) 'ContentEncoding'.
   smallint(6) 'Disabled'.
@@ -109,9 +105,9 @@ Create takes a hash of values and creates a row in the database:
 sub Create {
     my $self = shift;
     my %args = ( 
-                CustomField => '0',
+                CustomField => '',
                 ObjectType => '',
-                ObjectId => '0',
+                ObjectId => '',
                 SortOrder => '0',
                 Content => '',
                 LargeContent => '',
@@ -163,6 +159,20 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =cut
 
 
+=head2 CustomFieldObj
+
+Returns the CustomField Object which has the id returned by CustomField
+
+
+=cut
+
+sub CustomFieldObj {
+	my $self = shift;
+	my $CustomField =  RT::CustomField->new($self->CurrentUser);
+	$CustomField->Load($self->__Value('CustomField'));
+	return($CustomField);
+}
+
 =head2 ObjectType
 
 Returns the current value of ObjectType. 
@@ -238,7 +248,7 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =head2 LargeContent
 
 Returns the current value of LargeContent. 
-(In the database, LargeContent is stored as longtext.)
+(In the database, LargeContent is stored as longblob.)
 
 
 
@@ -247,7 +257,7 @@ Returns the current value of LargeContent.
 
 Set LargeContent to VALUE. 
 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, LargeContent will be stored as a longtext.)
+(In the database, LargeContent will be stored as a longblob.)
 
 
 =cut
@@ -350,17 +360,17 @@ sub _CoreAccessible {
         id =>
 		{read => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
         CustomField => 
-		{read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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 => ''},
         ObjectType => 
 		{read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
         ObjectId => 
-		{read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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 => ''},
         SortOrder => 
 		{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, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
         LargeContent => 
-		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'longtext', default => ''},
+		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'longblob', default => ''},
         ContentType => 
 		{read => 1, write => 1, sql_type => 12, length => 80,  is_blob => 0,  is_numeric => 0,  type => 'varchar(80)', default => ''},
         ContentEncoding => 
@@ -380,22 +390,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::ObjectCustomFieldValue_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValue_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomFieldValue_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValue_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomFieldValue_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValue_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/ObjectCustomFieldValues.pm b/lib/RT/ObjectCustomFieldValues.pm
index bdff71e..d7f8764 100644
--- a/lib/RT/ObjectCustomFieldValues.pm
+++ b/lib/RT/ObjectCustomFieldValues.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::ObjectCustomFieldValues;
 
-use RT::SearchBuilder;
 use RT::ObjectCustomFieldValue;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -111,22 +109,8 @@ sub NewItem {
     return(RT::ObjectCustomFieldValue->new($self->CurrentUser));
 }
 
-        eval "require RT::ObjectCustomFieldValues_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValues_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomFieldValues_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValues_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomFieldValues_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValues_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/ObjectCustomFields.pm b/lib/RT/ObjectCustomFields.pm
index 8b309a4..e0803da 100644
--- a/lib/RT/ObjectCustomFields.pm
+++ b/lib/RT/ObjectCustomFields.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::ObjectCustomFields;
 
-use RT::SearchBuilder;
 use RT::ObjectCustomField;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -111,22 +109,8 @@ sub NewItem {
     return(RT::ObjectCustomField->new($self->CurrentUser));
 }
 
-        eval "require RT::ObjectCustomFields_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFields_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomFields_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFields_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomFields_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFields_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Principal.pm b/lib/RT/Principal.pm
index aaa4fa7..f7b3b27 100755
--- a/lib/RT/Principal.pm
+++ b/lib/RT/Principal.pm
@@ -69,11 +69,7 @@ RT::Principal
 =cut
 
 package RT::Principal;
-use RT::Record; 
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -197,22 +193,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::Principal_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Principal_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Principal_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Principal_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Principal_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Principal_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Principals.pm b/lib/RT/Principals.pm
index 1be2851..18768eb 100755
--- a/lib/RT/Principals.pm
+++ b/lib/RT/Principals.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::Principals;
 
-use RT::SearchBuilder;
 use RT::Principal;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,22 +98,8 @@ sub NewItem {
     return(RT::Principal->new($self->CurrentUser));
 }
 
-        eval "require RT::Principals_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Principals_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Principals_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Principals_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Principals_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Principals_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Queue.pm b/lib/RT/Queue.pm
index cb12108..15b7a65 100755
--- a/lib/RT/Queue.pm
+++ b/lib/RT/Queue.pm
@@ -69,11 +69,7 @@ RT::Queue
 =cut
 
 package RT::Queue;
-use RT::Record; 
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -356,22 +352,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::Queue_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Queue_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Queue_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Queue_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Queue_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Queue_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Queues.pm b/lib/RT/Queues.pm
index eeb9b98..5b56fa6 100755
--- a/lib/RT/Queues.pm
+++ b/lib/RT/Queues.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::Queues;
 
-use RT::SearchBuilder;
 use RT::Queue;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,22 +98,8 @@ sub NewItem {
     return(RT::Queue->new($self->CurrentUser));
 }
 
-        eval "require RT::Queues_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Queues_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Queues_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Queues_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Queues_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Queues_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Scrip.pm b/lib/RT/Scrip.pm
index d552872..fad74c0 100755
--- a/lib/RT/Scrip.pm
+++ b/lib/RT/Scrip.pm
@@ -69,15 +69,11 @@ RT::Scrip
 =cut
 
 package RT::Scrip;
-use RT::Record; 
 use RT::Queue;
 use RT::Template;
 use RT::ScripCondition;
 use RT::ScripAction;
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -485,22 +481,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::Scrip_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Scrip_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Scrip_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Scrip_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Scrip_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Scrip_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/ScripAction.pm b/lib/RT/ScripAction.pm
index c0d84f6..70956ad 100755
--- a/lib/RT/ScripAction.pm
+++ b/lib/RT/ScripAction.pm
@@ -69,11 +69,7 @@ RT::ScripAction
 =cut
 
 package RT::ScripAction;
-use RT::Record; 
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -93,7 +89,7 @@ Create takes a hash of values and creates a row in the database:
   varchar(200) 'Name'.
   varchar(255) 'Description'.
   varchar(60) 'ExecModule'.
-  varchar(255) 'Argument'.
+  varbinary(255) 'Argument'.
 
 =cut
 
@@ -186,7 +182,7 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =head2 Argument
 
 Returns the current value of Argument. 
-(In the database, Argument is stored as varchar(255).)
+(In the database, Argument is stored as varbinary(255).)
 
 
 
@@ -195,7 +191,7 @@ Returns the current value of Argument.
 
 Set Argument to VALUE. 
 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Argument will be stored as a varchar(255).)
+(In the database, Argument will be stored as a varbinary(255).)
 
 
 =cut
@@ -250,7 +246,7 @@ sub _CoreAccessible {
         ExecModule => 
 		{read => 1, write => 1, sql_type => 12, length => 60,  is_blob => 0,  is_numeric => 0,  type => 'varchar(60)', default => ''},
         Argument => 
-		{read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
+		{read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varbinary(255)', default => ''},
         Creator => 
 		{read => 1, auto => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
         Created => 
@@ -264,22 +260,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::ScripAction_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripAction_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripAction_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripAction_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripAction_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripAction_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/ScripActions.pm b/lib/RT/ScripActions.pm
index 351fc99..900b9c2 100755
--- a/lib/RT/ScripActions.pm
+++ b/lib/RT/ScripActions.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::ScripActions;
 
-use RT::SearchBuilder;
 use RT::ScripAction;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,22 +98,8 @@ sub NewItem {
     return(RT::ScripAction->new($self->CurrentUser));
 }
 
-        eval "require RT::ScripActions_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripActions_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripActions_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripActions_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripActions_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripActions_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/ScripCondition.pm b/lib/RT/ScripCondition.pm
index 4387745..f607cc6 100755
--- a/lib/RT/ScripCondition.pm
+++ b/lib/RT/ScripCondition.pm
@@ -69,11 +69,7 @@ RT::ScripCondition
 =cut
 
 package RT::ScripCondition;
-use RT::Record; 
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -93,7 +89,7 @@ Create takes a hash of values and creates a row in the database:
   varchar(200) 'Name'.
   varchar(255) 'Description'.
   varchar(60) 'ExecModule'.
-  varchar(255) 'Argument'.
+  varbinary(255) 'Argument'.
   varchar(60) 'ApplicableTransTypes'.
 
 =cut
@@ -189,7 +185,7 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =head2 Argument
 
 Returns the current value of Argument. 
-(In the database, Argument is stored as varchar(255).)
+(In the database, Argument is stored as varbinary(255).)
 
 
 
@@ -198,7 +194,7 @@ Returns the current value of Argument.
 
 Set Argument to VALUE. 
 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Argument will be stored as a varchar(255).)
+(In the database, Argument will be stored as a varbinary(255).)
 
 
 =cut
@@ -271,7 +267,7 @@ sub _CoreAccessible {
         ExecModule => 
 		{read => 1, write => 1, sql_type => 12, length => 60,  is_blob => 0,  is_numeric => 0,  type => 'varchar(60)', default => ''},
         Argument => 
-		{read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
+		{read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varbinary(255)', default => ''},
         ApplicableTransTypes => 
 		{read => 1, write => 1, sql_type => 12, length => 60,  is_blob => 0,  is_numeric => 0,  type => 'varchar(60)', default => ''},
         Creator => 
@@ -287,22 +283,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::ScripCondition_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripCondition_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripCondition_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripCondition_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripCondition_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripCondition_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/ScripConditions.pm b/lib/RT/ScripConditions.pm
index 020c394..1cd6551 100755
--- a/lib/RT/ScripConditions.pm
+++ b/lib/RT/ScripConditions.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::ScripConditions;
 
-use RT::SearchBuilder;
 use RT::ScripCondition;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,22 +98,8 @@ sub NewItem {
     return(RT::ScripCondition->new($self->CurrentUser));
 }
 
-        eval "require RT::ScripConditions_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripConditions_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripConditions_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripConditions_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripConditions_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripConditions_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Scrips.pm b/lib/RT/Scrips.pm
index 048d488..54fa5e9 100755
--- a/lib/RT/Scrips.pm
+++ b/lib/RT/Scrips.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::Scrips;
 
-use RT::SearchBuilder;
 use RT::Scrip;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,22 +98,8 @@ sub NewItem {
     return(RT::Scrip->new($self->CurrentUser));
 }
 
-        eval "require RT::Scrips_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Scrips_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Scrips_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Scrips_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Scrips_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Scrips_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Template.pm b/lib/RT/Template.pm
index b3f5c7d..026f765 100755
--- a/lib/RT/Template.pm
+++ b/lib/RT/Template.pm
@@ -69,12 +69,8 @@ RT::Template
 =cut
 
 package RT::Template;
-use RT::Record; 
 use RT::Queue;
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -97,7 +93,7 @@ Create takes a hash of values and creates a row in the database:
   varchar(16) 'Type'.
   varchar(16) 'Language'.
   int(11) 'TranslationOf'.
-  blob 'Content'.
+  text 'Content'.
 
 =cut
 
@@ -264,7 +260,7 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =head2 Content
 
 Returns the current value of Content. 
-(In the database, Content is stored as blob.)
+(In the database, Content is stored as text.)
 
 
 
@@ -273,7 +269,7 @@ Returns the current value of Content.
 
 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.)
+(In the database, Content will be stored as a text.)
 
 
 =cut
@@ -334,7 +330,7 @@ sub _CoreAccessible {
         TranslationOf => 
 		{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, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'blob', default => ''},
+		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'text', default => ''},
         LastUpdated => 
 		{read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
         LastUpdatedBy => 
@@ -348,22 +344,8 @@ sub _CoreAccessible {
 };
 
 
-        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 $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Templates.pm b/lib/RT/Templates.pm
index da31572..bc358f7 100755
--- a/lib/RT/Templates.pm
+++ b/lib/RT/Templates.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::Templates;
 
-use RT::SearchBuilder;
 use RT::Template;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,22 +98,8 @@ sub NewItem {
     return(RT::Template->new($self->CurrentUser));
 }
 
-        eval "require RT::Templates_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Templates_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Templates_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Templates_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Templates_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Templates_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index d98edb5..9e9cfda 100755
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -69,12 +69,8 @@ RT::Ticket
 =cut
 
 package RT::Ticket;
-use RT::Record; 
 use RT::Queue;
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -141,7 +137,7 @@ sub Create {
                 Resolved => '',
                 Disabled => '0',
 
-          @_);
+		  @_);
     $self->SUPER::Create(
                          EffectiveId => $args{'EffectiveId'},
                          Queue => $args{'Queue'},
@@ -222,14 +218,12 @@ 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);
+	my $self = shift;
+	my $Queue =  RT::Queue->new($self->CurrentUser);
+	$Queue->Load($self->__Value('Queue'));
+	return($Queue);
 }
 
-
-
 =head2 Type
 
 Returns the current value of Type. 
@@ -595,76 +589,62 @@ sub _CoreAccessible {
     {
      
         id =>
-        {read => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
+		{read => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
         EffectiveId => 
-        {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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'},
         Queue => 
-        {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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'},
         Type => 
-        {read => 1, write => 1, sql_type => 12, length => 16,  is_blob => 0,  is_numeric => 0,  type => 'varchar(16)', default => ''},
+		{read => 1, write => 1, sql_type => 12, length => 16,  is_blob => 0,  is_numeric => 0,  type => 'varchar(16)', default => ''},
         IssueStatement => 
-        {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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'},
         Resolution => 
-        {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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'},
         Owner => 
-        {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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'},
         Subject => 
-        {read => 1, write => 1, sql_type => 12, length => 200,  is_blob => 0,  is_numeric => 0,  type => 'varchar(200)', default => '[no subject]'},
+		{read => 1, write => 1, sql_type => 12, length => 200,  is_blob => 0,  is_numeric => 0,  type => 'varchar(200)', default => '[no subject]'},
         InitialPriority => 
-        {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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'},
         FinalPriority => 
-        {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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'},
         Priority => 
-        {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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'},
         TimeEstimated => 
-        {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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'},
         TimeWorked => 
-        {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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'},
         Status => 
-        {read => 1, write => 1, sql_type => 12, length => 10,  is_blob => 0,  is_numeric => 0,  type => 'varchar(10)', default => ''},
+		{read => 1, write => 1, sql_type => 12, length => 10,  is_blob => 0,  is_numeric => 0,  type => 'varchar(10)', default => ''},
         TimeLeft => 
-        {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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'},
         Told => 
-        {read => 1, write => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
+		{read => 1, write => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
         Starts => 
-        {read => 1, write => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
+		{read => 1, write => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
         Started => 
-        {read => 1, write => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
+		{read => 1, write => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
         Due => 
-        {read => 1, write => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
+		{read => 1, write => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
         Resolved => 
-        {read => 1, write => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
+		{read => 1, write => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
         LastUpdatedBy => 
-        {read => 1, auto => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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'},
         LastUpdated => 
-        {read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
+		{read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
         Creator => 
-        {read => 1, auto => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 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, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
+		{read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
         Disabled => 
-        {read => 1, write => 1, sql_type => 5, length => 6,  is_blob => 0,  is_numeric => 1,  type => 'smallint(6)', default => '0'},
+		{read => 1, write => 1, sql_type => 5, length => 6,  is_blob => 0,  is_numeric => 1,  type => 'smallint(6)', default => '0'},
 
  }
 };
 
 
-        eval "require RT::Ticket_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Ticket_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Ticket_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Tickets.pm b/lib/RT/Tickets.pm
index 3dcd466..d98c95c 100755
--- a/lib/RT/Tickets.pm
+++ b/lib/RT/Tickets.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::Tickets;
 
-use RT::SearchBuilder;
 use RT::Ticket;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,22 +98,8 @@ sub NewItem {
     return(RT::Ticket->new($self->CurrentUser));
 }
 
-        eval "require RT::Tickets_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Tickets_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Tickets_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Tickets_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Tickets_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Tickets_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Transaction.pm b/lib/RT/Transaction.pm
index 5e84ce3..e9ae434 100755
--- a/lib/RT/Transaction.pm
+++ b/lib/RT/Transaction.pm
@@ -69,11 +69,7 @@ RT::Transaction
 =cut
 
 package RT::Transaction;
-use RT::Record; 
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -403,22 +399,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::Transaction_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Transaction_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Transaction_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Transactions.pm b/lib/RT/Transactions.pm
index 617045f..444ce53 100755
--- a/lib/RT/Transactions.pm
+++ b/lib/RT/Transactions.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::Transactions;
 
-use RT::SearchBuilder;
 use RT::Transaction;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,22 +98,8 @@ sub NewItem {
     return(RT::Transaction->new($self->CurrentUser));
 }
 
-        eval "require RT::Transactions_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Transactions_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Transactions_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Transactions_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Transactions_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Transactions_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/User.pm b/lib/RT/User.pm
index 94ae222..c359595 100755
--- a/lib/RT/User.pm
+++ b/lib/RT/User.pm
@@ -69,11 +69,7 @@ RT::User
 =cut
 
 package RT::User;
-use RT::Record; 
-
-
-use vars qw( @ISA );
- at ISA= qw( RT::Record );
+use base 'RT::Record';
 
 sub _Init {
   my $self = shift; 
@@ -91,11 +87,11 @@ sub _Init {
 Create takes a hash of values and creates a row in the database:
 
   varchar(200) 'Name'.
-  varchar(40) 'Password'.
-  blob 'Comments'.
-  blob 'Signature'.
+  varbinary(40) 'Password'.
+  text 'Comments'.
+  text 'Signature'.
   varchar(120) 'EmailAddress'.
-  blob 'FreeformContactInfo'.
+  text 'FreeformContactInfo'.
   varchar(200) 'Organization'.
   varchar(120) 'RealName'.
   varchar(16) 'NickName'.
@@ -225,7 +221,7 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =head2 Password
 
 Returns the current value of Password. 
-(In the database, Password is stored as varchar(40).)
+(In the database, Password is stored as varbinary(40).)
 
 
 
@@ -234,7 +230,7 @@ Returns the current value of Password.
 
 Set Password to VALUE. 
 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Password will be stored as a varchar(40).)
+(In the database, Password will be stored as a varbinary(40).)
 
 
 =cut
@@ -243,7 +239,7 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =head2 Comments
 
 Returns the current value of Comments. 
-(In the database, Comments is stored as blob.)
+(In the database, Comments is stored as text.)
 
 
 
@@ -252,7 +248,7 @@ Returns the current value of Comments.
 
 Set Comments to VALUE. 
 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Comments will be stored as a blob.)
+(In the database, Comments will be stored as a text.)
 
 
 =cut
@@ -261,7 +257,7 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =head2 Signature
 
 Returns the current value of Signature. 
-(In the database, Signature is stored as blob.)
+(In the database, Signature is stored as text.)
 
 
 
@@ -270,7 +266,7 @@ Returns the current value of Signature.
 
 Set Signature to VALUE. 
 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Signature will be stored as a blob.)
+(In the database, Signature will be stored as a text.)
 
 
 =cut
@@ -297,7 +293,7 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =head2 FreeformContactInfo
 
 Returns the current value of FreeformContactInfo. 
-(In the database, FreeformContactInfo is stored as blob.)
+(In the database, FreeformContactInfo is stored as text.)
 
 
 
@@ -306,7 +302,7 @@ Returns the current value of FreeformContactInfo.
 
 Set FreeformContactInfo to VALUE. 
 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, FreeformContactInfo will be stored as a blob.)
+(In the database, FreeformContactInfo will be stored as a text.)
 
 
 =cut
@@ -771,15 +767,15 @@ sub _CoreAccessible {
         Name => 
 		{read => 1, write => 1, sql_type => 12, length => 200,  is_blob => 0,  is_numeric => 0,  type => 'varchar(200)', default => ''},
         Password => 
-		{read => 1, write => 1, sql_type => 12, length => 40,  is_blob => 0,  is_numeric => 0,  type => 'varchar(40)', default => ''},
+		{read => 1, write => 1, sql_type => 12, length => 40,  is_blob => 0,  is_numeric => 0,  type => 'varbinary(40)', default => ''},
         Comments => 
-		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'blob', default => ''},
+		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'text', default => ''},
         Signature => 
-		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'blob', default => ''},
+		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'text', default => ''},
         EmailAddress => 
 		{read => 1, write => 1, sql_type => 12, length => 120,  is_blob => 0,  is_numeric => 0,  type => 'varchar(120)', default => ''},
         FreeformContactInfo => 
-		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'blob', default => ''},
+		{read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'text', default => ''},
         Organization => 
 		{read => 1, write => 1, sql_type => 12, length => 200,  is_blob => 0,  is_numeric => 0,  type => 'varchar(200)', default => ''},
         RealName => 
@@ -839,22 +835,8 @@ sub _CoreAccessible {
 };
 
 
-        eval "require RT::User_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/User_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::User_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/User_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::User_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/User_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO
diff --git a/lib/RT/Users.pm b/lib/RT/Users.pm
index d3eb078..025767f 100755
--- a/lib/RT/Users.pm
+++ b/lib/RT/Users.pm
@@ -72,11 +72,9 @@ use strict;
 
 package RT::Users;
 
-use RT::SearchBuilder;
 use RT::User;
 
-use vars qw( @ISA );
- at ISA= qw(RT::SearchBuilder);
+use base 'RT::SearchBuilder';
 
 
 sub _Init {
@@ -100,22 +98,8 @@ sub NewItem {
     return(RT::User->new($self->CurrentUser));
 }
 
-        eval "require RT::Users_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Users_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Users_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Users_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Users_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Users_Local.pm}) {
-            die $@;
-        };
-
 
+RT::Base->_ImportOverlays();
 
 
 =head1 SEE ALSO

-----------------------------------------------------------------------


More information about the Rt-commit mailing list