[Rt-commit] r10053 - in rt/branches/3.999-DANGEROUS: . etc html/Admin/Users html/REST/1.0/Forms/user html/User html/User/Elements html/User/Groups html/Widgets lib lib/RT lib/RT/Crypt lib/RT/I18N lib/RT/Model lib/RT/Report lib/RT/ScripAction lib/RT/Search lib/RT/Shredder/Plugin sbin t t/api t/shredder t/web

jesse at bestpractical.com jesse at bestpractical.com
Mon Dec 24 00:28:11 EST 2007


Author: jesse
Date: Mon Dec 24 00:28:10 2007
New Revision: 10053

Modified:
   rt/branches/3.999-DANGEROUS/   (props changed)
   rt/branches/3.999-DANGEROUS/COPYING
   rt/branches/3.999-DANGEROUS/etc/RT_Config.pm
   rt/branches/3.999-DANGEROUS/etc/schema.Informix
   rt/branches/3.999-DANGEROUS/etc/schema.Oracle
   rt/branches/3.999-DANGEROUS/etc/schema.Pg
   rt/branches/3.999-DANGEROUS/etc/schema.SQLite
   rt/branches/3.999-DANGEROUS/etc/schema.Sybase
   rt/branches/3.999-DANGEROUS/etc/schema.mysql
   rt/branches/3.999-DANGEROUS/html/Admin/Users/Modify.html
   rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/user/default
   rt/branches/3.999-DANGEROUS/html/User/Delegation.html
   rt/branches/3.999-DANGEROUS/html/User/Elements/DelegateRights
   rt/branches/3.999-DANGEROUS/html/User/Groups/Modify.html
   rt/branches/3.999-DANGEROUS/html/User/Groups/index.html
   rt/branches/3.999-DANGEROUS/html/User/Prefs.html
   rt/branches/3.999-DANGEROUS/html/Widgets/ComboBox
   rt/branches/3.999-DANGEROUS/lib/RT.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Crypt/GnuPG.pm
   rt/branches/3.999-DANGEROUS/lib/RT/CurrentUser.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Date.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm
   rt/branches/3.999-DANGEROUS/lib/RT/I18N.pm
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/cs.pm
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/cs.po
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/da.po
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/es.po
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/fi.po
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/fr.po
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/i_default.pm
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/id.po
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/it.po
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/ja.po
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/nl.po
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/no.po
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/pl.po
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/pt_br.po
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/ru.po
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/zh_cn.po
   rt/branches/3.999-DANGEROUS/lib/RT/I18N/zh_tw.po
   rt/branches/3.999-DANGEROUS/lib/RT/Model/ACE.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Queue.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Record.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Report/Tickets.pm
   rt/branches/3.999-DANGEROUS/lib/RT/SavedSearch.pm
   rt/branches/3.999-DANGEROUS/lib/RT/SavedSearches.pm
   rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/CreateTickets.pm
   rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordComment.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Search/Googleish.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Users.pm
   rt/branches/3.999-DANGEROUS/lib/RT/StyleGuide.pod
   rt/branches/3.999-DANGEROUS/sbin/extract-message-catalog
   rt/branches/3.999-DANGEROUS/t/api/ace.t
   rt/branches/3.999-DANGEROUS/t/api/cf_combo_casacade.t
   rt/branches/3.999-DANGEROUS/t/api/cf_pattern.t
   rt/branches/3.999-DANGEROUS/t/api/date.t
   rt/branches/3.999-DANGEROUS/t/cron.t
   rt/branches/3.999-DANGEROUS/t/savedsearch.t
   rt/branches/3.999-DANGEROUS/t/shredder/utils.pl
   rt/branches/3.999-DANGEROUS/t/ticket/link_search.t
   rt/branches/3.999-DANGEROUS/t/web/compilation_errors.t
   rt/branches/3.999-DANGEROUS/t/web/rights1.t
   rt/branches/3.999-DANGEROUS/t/web/ticket_owner.t
   rt/branches/3.999-DANGEROUS/t/web/ticket_seen.t

Log:
 r74087 at pinglin:  jesse | 2007-12-23 20:27:06 -0500
 checkpoint


Modified: rt/branches/3.999-DANGEROUS/COPYING
==============================================================================
--- rt/branches/3.999-DANGEROUS/COPYING	(original)
+++ rt/branches/3.999-DANGEROUS/COPYING	Mon Dec 24 00:28:10 2007
@@ -66,7 +66,7 @@
 means either the Program or any derivative work under copyright law:
 that is to say, a work containing the Program or a portion of it,
 either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
+Language.  (Hereinafter, translation is included without limitation in
 the term "modification".)  Each licensee is addressed as "you".
 
 Activities other than copying, distribution and modification are not

Modified: rt/branches/3.999-DANGEROUS/etc/RT_Config.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/etc/RT_Config.pm	(original)
+++ rt/branches/3.999-DANGEROUS/etc/RT_Config.pm	Mon Dec 24 00:28:10 2007
@@ -628,7 +628,7 @@
 
 # {{{ RT UTF-8 settings
 
-# An array that contains languages supported by RT's internationalization
+# An array that contains Languages supported by RT's internationalization
 # interface.  Defaults to all *.po lexicons; setting it to qw(en ja) will make
 # RT bilingual instead of multilingual, but will save some memory.
 

Modified: rt/branches/3.999-DANGEROUS/etc/schema.Informix
==============================================================================
--- rt/branches/3.999-DANGEROUS/etc/schema.Informix	(original)
+++ rt/branches/3.999-DANGEROUS/etc/schema.Informix	Mon Dec 24 00:28:10 2007
@@ -189,7 +189,7 @@
 	organization		VARCHAR(200),
   	real_name 		VARCHAR(120),
   	nickname 		VARCHAR(16),
-  	Lang 			VARCHAR(16),
+  	lang 			VARCHAR(16),
 	email_encoding		VARCHAR(16),
 	web_encoding		VARCHAR(16),
 	ExternalContactInfoId	VARCHAR(100),

Modified: rt/branches/3.999-DANGEROUS/etc/schema.Oracle
==============================================================================
--- rt/branches/3.999-DANGEROUS/etc/schema.Oracle	(original)
+++ rt/branches/3.999-DANGEROUS/etc/schema.Oracle	Mon Dec 24 00:28:10 2007
@@ -198,7 +198,7 @@
 	organization		VARCHAR2(200),
   	real_name 		VARCHAR2(120),
   	nickname 		VARCHAR2(16),
-  	Lang 			VARCHAR2(16),
+  	lang 			VARCHAR2(16),
 	email_encoding		VARCHAR2(16),
 	web_encoding		VARCHAR2(16),
 	ExternalContactInfoId	VARCHAR2(100),

Modified: rt/branches/3.999-DANGEROUS/etc/schema.Pg
==============================================================================
--- rt/branches/3.999-DANGEROUS/etc/schema.Pg	(original)
+++ rt/branches/3.999-DANGEROUS/etc/schema.Pg	Mon Dec 24 00:28:10 2007
@@ -333,7 +333,7 @@
   organization varchar(200) NULL  ,
   real_name varchar(120) NULL  ,
   nickname varchar(16) NULL  ,
-  Lang varchar(16) NULL  ,
+  lang varchar(16) NULL  ,
   email_encoding varchar(16) NULL  ,
   web_encoding varchar(16) NULL  ,
   ExternalContactInfoId varchar(100) NULL  ,

Modified: rt/branches/3.999-DANGEROUS/etc/schema.SQLite
==============================================================================
--- rt/branches/3.999-DANGEROUS/etc/schema.SQLite	(original)
+++ rt/branches/3.999-DANGEROUS/etc/schema.SQLite	Mon Dec 24 00:28:10 2007
@@ -216,7 +216,7 @@
   organization varchar(200) NULL  ,
   real_name varchar(120) NULL  ,
   nickname varchar(16) NULL  ,
-  Lang varchar(16) NULL  ,
+  lang varchar(16) NULL  ,
   email_encoding varchar(16) NULL  ,
   web_encoding varchar(16) NULL  ,
   ExternalContactInfoId varchar(100) NULL  ,

Modified: rt/branches/3.999-DANGEROUS/etc/schema.Sybase
==============================================================================
--- rt/branches/3.999-DANGEROUS/etc/schema.Sybase	(original)
+++ rt/branches/3.999-DANGEROUS/etc/schema.Sybase	Mon Dec 24 00:28:10 2007
@@ -227,7 +227,7 @@
   organization varchar(200) NULL  ,
   real_name varchar(120) NULL  ,
   nickname varchar(16) NULL  ,
-  Lang varchar(16) NULL  ,
+  lang varchar(16) NULL  ,
   email_encoding varchar(16) NULL  ,
   web_encoding varchar(16) NULL  ,
   ExternalContactInfoId varchar(100) NULL  ,

Modified: rt/branches/3.999-DANGEROUS/etc/schema.mysql
==============================================================================
--- rt/branches/3.999-DANGEROUS/etc/schema.mysql	(original)
+++ rt/branches/3.999-DANGEROUS/etc/schema.mysql	Mon Dec 24 00:28:10 2007
@@ -227,7 +227,7 @@
   organization varchar(200) NULL  ,
   real_name varchar(120) NULL  ,
   nickname varchar(16) NULL  ,
-  Lang varchar(16) NULL  ,
+  lang varchar(16) NULL  ,
   email_encoding varchar(16) NULL  ,
   web_encoding varchar(16) NULL  ,
   ExternalContactInfoId varchar(100) NULL  ,

Modified: rt/branches/3.999-DANGEROUS/html/Admin/Users/Modify.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Admin/Users/Modify.html	(original)
+++ rt/branches/3.999-DANGEROUS/html/Admin/Users/Modify.html	Mon Dec 24 00:28:10 2007
@@ -95,7 +95,7 @@
 <tr><td align="right">
 <&|/l&>Language</&>: 
 </td><td>
-<& /Elements/SelectLang, name => 'Lang', Default => $user_object->Lang &>
+<& /Elements/Selectlang, name => 'lang', Default => $user_object->lang &>
 </td></tr>
 <tr><td align="right">
 <&|/l&>Extra info</&>: 
@@ -273,7 +273,7 @@
 	    organization          => $ARGS{'organization'},
 	    real_name              => $ARGS{'real_name'},
 	    nickname              => $ARGS{'nickname'},
-	    Lang                  => $ARGS{'Lang'},
+	    lang                  => $ARGS{'lang'},
 	    email_encoding         => $ARGS{'email_encoding'},
 	    web_encoding           => $ARGS{'web_encoding'},
 	    ExternalContactInfoId => $ARGS{'ExternalContactInfoId'},
@@ -330,7 +330,7 @@
 if ($user_object->id && $id ne 'new') {
 
     my @fields = qw(name comments Signature email freeform_contact_info 
-		    organization real_name nickname Lang email_encoding web_encoding 
+		    organization real_name nickname lang email_encoding web_encoding 
 		    ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId 
 		    auth_system HomePhone WorkPhone MobilePhone PagerPhone Address1
 		    Address2 City State Zip Country 
@@ -410,7 +410,7 @@
 $Setprivileged => undef
 $Enabled => undef
 $SetEnabled => undef
-$Lang  => undef
+$lang  => undef
 $email_encoding  => undef
 $web_encoding => undef
 $ExternalContactInfoId  => undef

Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/user/default
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/user/default	(original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/user/default	Mon Dec 24 00:28:10 2007
@@ -59,7 +59,7 @@
 my $user = RT::Model::User->new() ;
 my @fields = qw(real_name nickname Gecos organization Address1 Address2 City
                 State Zip Country HomePhone WorkPhone MobilePhone PagerPhone
-                freeform_contact_info comments Signature Lang email_encoding
+                freeform_contact_info comments Signature lang email_encoding
                 web_encoding ExternalContactInfoId ContactInfoSystem
                 ExternalAuthId auth_system);
 my %fields = map { lc $_ => $_ } @fields;

Modified: rt/branches/3.999-DANGEROUS/html/User/Delegation.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/User/Delegation.html	(original)
+++ rt/branches/3.999-DANGEROUS/html/User/Delegation.html	Mon Dec 24 00:28:10 2007
@@ -92,12 +92,12 @@
 }
 
 my $personalgroups = RT::Model::GroupCollection->new();
-$personalgroups->LimitToPersonalGroupsFor(Jifty->web->current_user->principal_id);
+$personalgroups->LimitToPersonalGroupsFor(Jifty->web->current_user->id);
 
 my $objects;
 my $acl = RT::Model::ACECollection->new();
 $acl->ExcludeDelegatedRights();
-$acl->LimitToPrincipal(Id => Jifty->web->current_user->principal_id, 
+$acl->LimitToPrincipal(Id => Jifty->web->current_user->id, 
                        IncludeGroupMembership => 1
                        );
 

Modified: rt/branches/3.999-DANGEROUS/html/User/Elements/DelegateRights
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/User/Elements/DelegateRights	(original)
+++ rt/branches/3.999-DANGEROUS/html/User/Elements/DelegateRights	Mon Dec 24 00:28:10 2007
@@ -66,7 +66,7 @@
 my $i;
 foreach my $right (@{$objects->{$object_type}{$object}}) {
 my $delegations = RT::Model::ACECollection->new();
-$delegations->DelegatedBy( Id => Jifty->web->current_user->principal_id);
+$delegations->DelegatedBy( Id => Jifty->web->current_user->id);
 $delegations->DelegatedFrom ( Id => $right->id);
 
 my $del_hash = {};

Modified: rt/branches/3.999-DANGEROUS/html/User/Groups/Modify.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/User/Groups/Modify.html	(original)
+++ rt/branches/3.999-DANGEROUS/html/User/Groups/Modify.html	Mon Dec 24 00:28:10 2007
@@ -94,7 +94,7 @@
 
         my ( $id, $msg ) = $Group->createPersonalGroup(
                              name        => "$name",
-                             principal_id => Jifty->web->current_user->principal_id
+                             principal_id => Jifty->web->current_user->id
         );
         unless ($id) {
             Abort( loc("Could not create group") );

Modified: rt/branches/3.999-DANGEROUS/html/User/Groups/index.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/User/Groups/index.html	(original)
+++ rt/branches/3.999-DANGEROUS/html/User/Groups/index.html	Mon Dec 24 00:28:10 2007
@@ -59,7 +59,7 @@
 
 <%INIT>
 my $Groups = RT::Model::GroupCollection->new();
-$Groups->LimitToPersonalGroupsFor(Jifty->web->current_user->principal_id());
+$Groups->LimitToPersonalGroupsFor(Jifty->web->current_user->id);
 my $title = loc('Personal groups');
 
 </%INIT>

Modified: rt/branches/3.999-DANGEROUS/html/User/Prefs.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/User/Prefs.html	(original)
+++ rt/branches/3.999-DANGEROUS/html/User/Prefs.html	Mon Dec 24 00:28:10 2007
@@ -76,7 +76,7 @@
   </tr>
   <tr>
     <td class="label"><&|/l&>Language</&>:</td>
-    <td class="value"><& /Elements/SelectLang, name => 'Lang', Default => $user_object->Lang &></td>
+    <td class="value"><& /Elements/Selectlang, name => 'lang', Default => $user_object->lang &></td>
   </tr>
 </table>
 </&>
@@ -207,10 +207,10 @@
 if ($user_object->id) {
     
     my @fields = qw(name comments Signature email freeform_contact_info 
-		    organization real_name nickname Lang email_encoding web_encoding 
+		    organization real_name nickname lang email_encoding web_encoding 
 		    ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId 
 		    auth_system HomePhone WorkPhone MobilePhone PagerPhone Address1
-		Address2 City State Zip Country Lang
+		Address2 City State Zip Country lang
 		   );
 
     $m->callback(
@@ -224,11 +224,6 @@
     my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields,
 					    Object => $user_object,
 					    ARGSRef => \%ARGS );
-    if ($Lang) {
-	Jifty->web->current_user->LanguageHandle($Lang);
-	Jifty->web->current_user = Jifty->web->current_user; # force writeback
-    }
-
     push (@results, at fieldresults);
 
 
@@ -270,7 +265,7 @@
 $Setprivileged => undef
 $Enabled => undef
 $SetEnabled => undef
-$Lang  => undef
+$lang  => undef
 $email_encoding  => undef
 $web_encoding => undef
 $ExternalContactInfoId  => undef

Modified: rt/branches/3.999-DANGEROUS/html/Widgets/ComboBox
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Widgets/ComboBox	(original)
+++ rt/branches/3.999-DANGEROUS/html/Widgets/ComboBox	Mon Dec 24 00:28:10 2007
@@ -56,7 +56,7 @@
         <option value="<%$value%>"><% $value%></option>
 % }
 </select>
-<script language="javascript"><!--
+<script Language="javascript"><!--
 ComboBox_InitWith('<% $name %>');
 //--></script>
 </nobr>

Modified: rt/branches/3.999-DANGEROUS/lib/RT.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT.pm	Mon Dec 24 00:28:10 2007
@@ -9,7 +9,7 @@
 use strict;
 use warnings;
 use File::Spec ();
-use vars qw($Config $System $system_user $nobody $Handle $Logger);
+use vars qw($Config $System $nobody $Handle $Logger);
 our $VERSION = '3.7.14';
 
 
@@ -357,12 +357,11 @@
 =cut
 
 sub system_user { 
-    
-    unless ($system_user) { 
-        $system_user = RT::CurrentUser->new(name => 'RT_System');
-    }
-    
-    return $system_user }
+       my $system_user = RT::CurrentUser->new(name => 'RT_System');
+        $system_user->is_superuser(1);
+    return $system_user;
+
+}
 
 =head2 Nobody
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Crypt/GnuPG.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Crypt/GnuPG.pm	Mon Dec 24 00:28:10 2007
@@ -1640,7 +1640,7 @@
             # good, one suitable and trusted key 
             next;
         }
-        my $user = RT::Model::User->new( $RT::system_user );
+        my $user = RT::Model::User->new( current_user => RT->system_user );
         $user->load_by_email( $address );
         # it's possible that we have no User record with the email
         $user = undef unless $user->id;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/CurrentUser.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/CurrentUser.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/CurrentUser.pm	Mon Dec 24 00:28:10 2007
@@ -147,15 +147,15 @@
 
 =head2 LanguageHandle
 
-Returns this current user's langauge handle. Should take a language
+Returns this current user's langauge handle. Should take a Language
 specification. but currently doesn't
 
 =cut 
 
 sub LanguageHandle {
     my $self = shift;
-    if (   !defined $self->{'LangHandle'}
-        || !UNIVERSAL::can( $self->{'LangHandle'}, 'maketext' )
+    if (   !defined $self->{'langHandle'}
+        || !UNIVERSAL::can( $self->{'langHandle'}, 'maketext' )
         || @_ )
     {
         if (   !RT->system_user
@@ -167,14 +167,14 @@
             push @_, $self->user_object->lang;
         }
 
-        $self->{'LangHandle'} = RT::I18N->get_handle(@_);
+        $self->{'langHandle'} = RT::I18N->get_handle(@_);
     }
 
     # Fall back to english.
-    unless ( $self->{'LangHandle'} ) {
+    unless ( $self->{'langHandle'} ) {
         die "We couldn't get a dictionary. Ne mogu naidti slovar. No puedo encontrar dictionario.";
     }
-    return $self->{'LangHandle'};
+    return $self->{'langHandle'};
 }
 
 sub loc {
@@ -256,7 +256,7 @@
 
 sub has_right {
     my $self = shift;
-    Carp::cluck unless ($self->user_object);
+    return 1 if ($self->is_superuser);
     $self->user_object->has_right(@_);
 }
 
@@ -266,6 +266,9 @@
     return RT->system_user;
 }
 
+sub email { shift->user_object->email }
 sub name { shift->user_object->name }
-sub principal_object { shift->user_object->principal_object }
+sub principal_object { my $self = shift;
+    Carp::confess unless ($self->user_object); 
+    return $self->user_object->principal_object }
 1;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Date.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Date.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Date.pm	Mon Dec 24 00:28:10 2007
@@ -117,7 +117,7 @@
 sub new {
     my $class = shift;
     my $self = {};
-    bless $self => $class;
+    bless $self => ref($class) || $class;
     $self->_get_current_user(@_);
     $self->Unix(0);
     return $self;
@@ -316,38 +316,38 @@
 
     if ( $duration < $MINUTE ) {
         $s         = $duration;
-        $time_unit = $self->loc("sec");
+        $time_unit = _("sec");
     }
     elsif ( $duration < ( 2 * $HOUR ) ) {
         $s         = int( $duration / $MINUTE + 0.5 );
-        $time_unit = $self->loc("min");
+        $time_unit = _("min");
     }
     elsif ( $duration < ( 2 * $DAY ) ) {
         $s         = int( $duration / $HOUR + 0.5 );
-        $time_unit = $self->loc("hours");
+        $time_unit = _("hours");
     }
     elsif ( $duration < ( 2 * $WEEK ) ) {
         $s         = int( $duration / $DAY + 0.5 );
-        $time_unit = $self->loc("days");
+        $time_unit = _("days");
     }
     elsif ( $duration < ( 2 * $MONTH ) ) {
         $s         = int( $duration / $WEEK + 0.5 );
-        $time_unit = $self->loc("weeks");
+        $time_unit = _("weeks");
     }
     elsif ( $duration < $YEAR ) {
         $s         = int( $duration / $MONTH + 0.5 );
-        $time_unit = $self->loc("months");
+        $time_unit = _("months");
     }
     else {
         $s         = int( $duration / $YEAR + 0.5 );
-        $time_unit = $self->loc("years");
+        $time_unit = _("years");
     }
 
     if ( $negative ) {
-        return $self->loc( "%1 %2 ago", $s, $time_unit );
+        return _( "%1 %2 ago", $s, $time_unit );
     }
     else {
-        return $self->loc( "%1 %2", $s, $time_unit );
+        return _( "%1 %2", $s, $time_unit );
     }
 }
 
@@ -377,7 +377,7 @@
     my $self = shift;
     my %args = (@_);
 
-    return $self->loc("Not set") unless $self->Unix > 0;
+    return _("Not set") unless $self->Unix > 0;
 
     my $format = RT->Config->Get( 'DateTimeFormat', $self->current_user ) || 'DefaultFormat';
     $format = { Format => $format } unless ref $format;
@@ -398,7 +398,7 @@
     my $self = shift;
     my $dow = shift;
     
-    return $self->loc("$DAYS_OF_WEEK[$dow].") if $DAYS_OF_WEEK[$dow];
+    return _("$DAYS_OF_WEEK[$dow].") if $DAYS_OF_WEEK[$dow];
     return '';
 }
 
@@ -413,7 +413,7 @@
     my $self = shift;
     my $mon = shift;
 
-    return $self->loc("$MONTHS[$mon].") if $MONTHS[$mon];
+    return _("$MONTHS[$mon].") if $MONTHS[$mon];
     return '';
 }
 
@@ -567,13 +567,13 @@
     ($mday, $hour, $min, $sec) = map { sprintf "%02d", $_ } ($mday, $hour, $min, $sec);
 
     if( $args{'Date'} && !$args{'Time'} ) {
-        return $self->loc('%1 %2 %3 %4',
+        return _('%1 %2 %3 %4',
                           $wday,$mon,$mday,$year);
     } elsif( !$args{'Date'} && $args{'Time'} ) {
-        return $self->loc('%1:%2:%3',
+        return _('%1:%2:%3',
                           $hour,$min,$sec);
     } else {
-        return $self->loc('%1 %2 %3 %4:%5:%6 %7',
+        return _('%1 %2 %3 %4:%5:%6 %7',
                           $wday,$mon,$mday,$hour,$min,$sec,$year);
     }
 }

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm	Mon Dec 24 00:28:10 2007
@@ -39,7 +39,7 @@
 # This code canonicalize_s time inputs in hours into minutes
 # If it's a noauth file, don't ask for auth.
 
-    # Set the proper encoding for the current language handle
+    # Set the proper encoding for the current Language handle
 #    content_type("text/html; charset=utf-8");
 
     return;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N.pm	Mon Dec 24 00:28:10 2007
@@ -64,7 +64,7 @@
 use MIME::Entity;
 use MIME::Head;
 
-# I decree that this project's first language is English.
+# I decree that this project's first Language is English.
 
 our %Lexicon = (
    'TEST_STRING' => 'Concrete Mixer',

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/cs.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/cs.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/cs.pm	Mon Dec 24 00:28:10 2007
@@ -75,7 +75,7 @@
   # Note that the formatting of $num is preserved.
   #return( $handle->numf($num) . ' ' . $handle->numerate($num, @forms) );
   return( $handle->numerate($num, @forms) );
-   # Most human languages put the number phrase before the qualified phrase.
+   # Most human Languages put the number phrase before the qualified phrase.
 }
 
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/cs.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/cs.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/cs.po	Mon Dec 24 00:28:10 2007
@@ -2629,7 +2629,7 @@
 msgstr "Klíčové slovo"
 
 #: NOT FOUND IN SOURCE
-msgid "Lang"
+msgid "lang"
 msgstr "Jazyk"
 
 #: html/Admin/Users/Modify.html:94 html/User/Prefs.html:76

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/da.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/da.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/da.po	Mon Dec 24 00:28:10 2007
@@ -2970,7 +2970,7 @@
 msgstr "Nøgleord"
 
 #: NOT FOUND IN SOURCE
-msgid "Lang"
+msgid "lang"
 msgstr "Sprog"
 
 #: html/Admin/Users/Modify.html:94

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/es.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/es.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/es.po	Mon Dec 24 00:28:10 2007
@@ -2811,7 +2811,7 @@
 msgstr "Palabras clave"
 
 #: NOT FOUND IN SOURCE
-msgid "Lang"
+msgid "lang"
 msgstr "Leng"
 
 #: html/Admin/Users/Modify.html:94 html/User/Prefs.html:76

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/fi.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/fi.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/fi.po	Mon Dec 24 00:28:10 2007
@@ -2645,7 +2645,7 @@
 msgstr "Avainsana"
 
 #: NOT FOUND IN SOURCE
-msgid "Lang"
+msgid "lang"
 msgstr "Kieli"
 
 #: html/Admin/Users/Modify.html:94 html/User/Prefs.html:76

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/fr.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/fr.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/fr.po	Mon Dec 24 00:28:10 2007
@@ -2145,7 +2145,7 @@
 
 #: html/Admin/Users/Modify.html:94 html/User/Prefs.html:76
 msgid "Language"
-msgstr "Langue"
+msgstr "langue"
 
 #: html/Search/Elements/EditFormat:79
 msgid "Large"

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/i_default.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/i_default.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/i_default.pm	Mon Dec 24 00:28:10 2007
@@ -86,17 +86,17 @@
 4.5.  Default Language
 
    When human-readable text must be presented in a context where the
-   sender has no knowledge of the recipient's language preferences (such
-   as login failures or E-mailed warnings, or prior to language
+   sender has no knowledge of the recipient's Language preferences (such
+   as login failures or E-mailed warnings, or prior to Language
    negotiation), text SHOULD be presented in Default Language.
 
    Default Language is assigned the tag "i-default" according to the
-   procedures of RFC 1766. It is not a specific language, but rather
-   identifies the condition where the language preferences of the user
+   procedures of RFC 1766. It is not a specific Language, but rather
+   identifies the condition where the Language preferences of the user
    cannot be established.
 
    Messages in Default Language MUST be understandable by an English-
-   speaking person, since English is the language which, worldwide, the
+   speaking person, since English is the Language which, worldwide, the
    greatest number of people will be able to get adequate help in
    interpreting when working with computers.
 
@@ -105,6 +105,6 @@
    situations.
 
    In many cases, using only English text is reasonable; in some cases,
-   the English text may be augumented by text in other languages.
+   the English text may be augumented by text in other Languages.
 
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/id.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/id.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/id.po	Mon Dec 24 00:28:10 2007
@@ -2305,7 +2305,7 @@
 msgstr "Jun."
 
 #: NOT FOUND IN SOURCE
-msgid "Lang"
+msgid "lang"
 msgstr "Bhs"
 
 #: html/Admin/Users/Modify.html:94 html/User/Prefs.html:76

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/it.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/it.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/it.po	Mon Dec 24 00:28:10 2007
@@ -2888,7 +2888,7 @@
 msgstr "Parola chiave"
 
 #: NOT FOUND IN SOURCE
-msgid "Lang"
+msgid "lang"
 msgstr "Lingua"
 
 #: html/Admin/Users/Modify.html:94 html/User/Prefs.html:76

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/ja.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/ja.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/ja.po	Mon Dec 24 00:28:10 2007
@@ -2517,7 +2517,7 @@
 msgstr "キーワード"
 
 #: NOT FOUND IN SOURCE
-msgid "Lang"
+msgid "lang"
 msgstr "長い"
 
 #: html/Admin/Users/Modify.html:94 html/User/Prefs.html:76

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/nl.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/nl.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/nl.po	Mon Dec 24 00:28:10 2007
@@ -2651,7 +2651,7 @@
 msgstr "Sleutelwoord"
 
 #: NOT FOUND IN SOURCE
-msgid "Lang"
+msgid "lang"
 msgstr "Taal"
 
 #: html/Admin/Users/Modify.html:94 html/User/Prefs.html:76

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/no.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/no.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/no.po	Mon Dec 24 00:28:10 2007
@@ -2856,7 +2856,7 @@
 msgstr "Nøkkelord"
 
 #: NOT FOUND IN SOURCE
-msgid "Lang"
+msgid "lang"
 msgstr "Språk"
 
 #: html/Admin/Users/Modify.html:94 html/User/Prefs.html:76

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/pl.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/pl.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/pl.po	Mon Dec 24 00:28:10 2007
@@ -2907,7 +2907,7 @@
 msgstr "Słowo kluczowe"
 
 #: NOT FOUND IN SOURCE
-msgid "Lang"
+msgid "lang"
 msgstr "Język"
 
 #: html/Admin/Users/Modify.html:94 html/User/Prefs.html:76

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/pt_br.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/pt_br.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/pt_br.po	Mon Dec 24 00:28:10 2007
@@ -2836,7 +2836,7 @@
 msgstr "Palavra chave"
 
 #: NOT FOUND IN SOURCE
-msgid "Lang"
+msgid "lang"
 msgstr "Líng"
 
 #: html/Admin/Users/Modify.html:94 html/User/Prefs.html:76

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/ru.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/ru.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/ru.po	Mon Dec 24 00:28:10 2007
@@ -2894,7 +2894,7 @@
 msgstr "Ключевое слово"
 
 #: NOT FOUND IN SOURCE
-msgid "Lang"
+msgid "lang"
 msgstr "Язык"
 
 #: html/Admin/Users/Modify.html:94 html/User/Prefs.html:76

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/zh_cn.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/zh_cn.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/zh_cn.po	Mon Dec 24 00:28:10 2007
@@ -3803,7 +3803,7 @@
 msgstr "链接卷标"
 
 #: NOT FOUND IN SOURCE
-msgid "Lang"
+msgid "lang"
 msgstr "使用语言"
 
 #: html/Admin/Users/Modify.html:94 html/User/Prefs.html:76

Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N/zh_tw.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N/zh_tw.po	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N/zh_tw.po	Mon Dec 24 00:28:10 2007
@@ -3803,7 +3803,7 @@
 msgstr "鏈結標籤"
 
 #: NOT FOUND IN SOURCE
-msgid "Lang"
+msgid "lang"
 msgstr "使用語言"
 
 #: html/Admin/Users/Modify.html:94 html/User/Prefs.html:76

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/ACE.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/ACE.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/ACE.pm	Mon Dec 24 00:28:10 2007
@@ -395,7 +395,7 @@
                                 right_name     => $self->__value('right_name'),
                                 object_type    => $self->__value('object_type'),
                                 object_id      => $self->__value('object_id'),
-                                DelegatedBy => $self->current_user->principal_id,
+                                DelegatedBy => $self->current_user->id,
                                 DelegatedFrom => $self->id );
     if ( $delegated_ace->id ) {
         return ( 0, $self->loc('That principal already has that right') );
@@ -406,7 +406,7 @@
         right_name     => $self->__value('right_name'),
         object_type    => $self->__value('object_type'),
         object_id      => $self->__value('object_id'),
-        DelegatedBy   => $self->current_user->principal_id,
+        DelegatedBy   => $self->current_user->id,
         DelegatedFrom => $self->id );
 
     #Clear the key cache. TODO someday we may want to just clear a little bit of the keycache space. 
@@ -447,7 +447,7 @@
     unless (
          (    $self->current_user->has_right(Right => 'ModifyACL', Object => $self->Object)
            && $self->__value('DelegatedBy') == 0 )
-         || ( $self->__value('DelegatedBy') == $self->current_user->principal_id )
+         || ( $self->__value('DelegatedBy') == $self->current_user->id )
       ) {
         return ( 0, $self->loc('Permission Denied') );
     }
@@ -639,7 +639,7 @@
 sub _value {
     my $self = shift;
 
-    if ( $self->__value('DelegatedBy') eq $self->current_user->principal_id ) {
+    if ( $self->__value('DelegatedBy') eq $self->current_user->id ) {
         return ( $self->__value(@_) );
     }
     elsif ( $self->principal_object->IsGroup

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm	Mon Dec 24 00:28:10 2007
@@ -494,10 +494,10 @@
     my %args = (
         name        => undef,
         Description => undef,
-        principal_id => $self->current_user->principal_id,
+        principal_id => $self->current_user->id,
         @_
     );
-    if ( $self->current_user->principal_id == $args{'principal_id'} ) {
+    if ( $self->current_user->id == $args{'principal_id'} ) {
 
         unless ( $self->current_user_has_right('AdminOwnPersonalGroups') ) {
             $RT::Logger->warning( $self->current_user->name
@@ -606,7 +606,7 @@
      my $self = shift;
      my $val = shift;
     if ($self->Domain eq 'Personal') {
-   		if ($self->current_user->principal_id == $self->Instance) {
+   		if ($self->current_user->id == $self->Instance) {
     		unless ( $self->current_user_has_right('AdminOwnPersonalGroups')) {
         		return ( 0, $self->loc('Permission Denied') );
     		}
@@ -685,7 +685,7 @@
 
     #If we don't have rights, don't include any results
     # TODO XXX  WHY IS THERE NO ACL CHECK HERE?
-    $members_obj->LimitToMembersOfGroup( $self->principal_id );
+    $members_obj->LimitToMembersOfGroup( $self->id );
 
     return ( $members_obj );
 
@@ -707,7 +707,7 @@
 
     #If we don't have rights, don't include any results
     # TODO XXX  WHY IS THERE NO ACL CHECK HERE?
-    $members_obj->LimitToMembersOfGroup( $self->principal_id );
+    $members_obj->LimitToMembersOfGroup( $self->id );
 
     return ( $members_obj );
 
@@ -744,7 +744,7 @@
     $groups->limit(
         alias    => $members_alias,
         column    => 'GroupId',
-        value    => $self->principal_id,
+        value    => $self->id,
     );
     $groups->limit(
         alias => $members_alias,
@@ -786,7 +786,7 @@
     $users->limit(
         alias => $members_alias,
         column => 'GroupId',
-        value => $self->principal_id,
+        value => $self->id,
     );
     $users->limit(
         alias => $members_alias,
@@ -855,7 +855,7 @@
 
 
     if ($self->Domain eq 'Personal') {
-   		if ($self->current_user->principal_id == $self->Instance) {
+   		if ($self->current_user->id == $self->Instance) {
     		unless ( $self->current_user_has_right('AdminOwnPersonalGroups')) {
         		return ( 0, $self->loc('Permission Denied') );
     		}
@@ -870,7 +870,7 @@
     # We should only allow membership changes if the user has the right 
     # to modify group membership or the user is the principal in question
     # and the user has the right to modify his own membership
-    unless ( ($new_member == $self->current_user->principal_id &&
+    unless ( ($new_member == $self->current_user->user_object->id &&
 	      $self->current_user_has_right('ModifyOwnMembership') ) ||
 	      $self->current_user_has_right('AdminGroupMembership') ) {
         #User has no permission to be doing this
@@ -970,7 +970,7 @@
 
     my $member_obj = RT::Model::GroupMember->new;
     $member_obj->load_by_cols( MemberId => $principal->id, 
-                             GroupId => $self->principal_id );
+                             GroupId => $self->id );
 
     #If we have a member object
     if ( defined $member_obj->id ) {
@@ -1009,7 +1009,7 @@
     }
     my $member_obj = RT::Model::CachedGroupMember->new;
     $member_obj->load_by_cols( MemberId => $principal->id,
-                             GroupId => $self->principal_id ,
+                             GroupId => $self->id ,
                              disabled => 0
                              );
 
@@ -1048,7 +1048,7 @@
     # and the user has the right to modify his own membership
 
     if ($self->Domain eq 'Personal') {
-   		if ($self->current_user->principal_id == $self->Instance) {
+   		if ($self->current_user->id == $self->Instance) {
     		unless ( $self->current_user_has_right('AdminOwnPersonalGroups')) {
         		return ( 0, $self->loc('Permission Denied') );
     		}
@@ -1059,7 +1059,7 @@
     	}
 	}
 	else {
-    unless ( (($member_id == $self->current_user->principal_id) &&
+    unless ( (($member_id == $self->current_user->id) &&
 	      $self->current_user_has_right('ModifyOwnMembership') ) ||
 	      $self->current_user_has_right('AdminGroupMembership') ) {
         #User has no permission to be doing this
@@ -1082,7 +1082,7 @@
     my $member_obj =  RT::Model::GroupMember->new;
     
     $member_obj->load_by_cols( MemberId  => $member_id,
-                             GroupId => $self->principal_id);
+                             GroupId => $self->id);
 
 
     #If we couldn't load it, return undef.
@@ -1171,7 +1171,7 @@
     );
 
 	if ($self->Domain eq 'Personal') {
-   		if ($self->current_user->principal_id == $self->Instance) {
+   		if ($self->current_user->id == $self->Instance) {
     		unless ( $self->current_user_has_right('AdminOwnPersonalGroups')) {
         		return ( 0, $self->loc('Permission Denied') );
     		}

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Queue.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Queue.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Queue.pm	Mon Dec 24 00:28:10 2007
@@ -685,7 +685,7 @@
     # {{{ Check ACLS
     #If the watcher we're trying to add is for the current user
     if ( defined $args{'principal_id'} && 
-            $self->current_user->principal_id  eq $args{'principal_id'}) {
+            $self->current_user->id  eq $args{'principal_id'}) {
         #  If it's an AdminCc and they don't have 
         #   'WatchAsAdminCc' or 'ModifyTicket', bail
         if ( defined $args{'Type'} && ($args{'Type'} eq 'AdminCc') ) {
@@ -847,7 +847,7 @@
 
     # {{{ Check ACLS
     #If the watcher we're trying to add is for the current user
-    if ( $self->current_user->principal_id  eq $args{'principal_id'}) {
+    if ( $self->current_user->id  eq $args{'principal_id'}) {
         #  If it's an AdminCc and they don't have 
         #   'WatchAsAdminCc' or 'ModifyQueue', bail
   if ( $args{'Type'} eq 'AdminCc' ) {

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm	Mon Dec 24 00:28:10 2007
@@ -1236,7 +1236,7 @@
 
     # {{{ Check ACLS
     #If the watcher we're trying to add is for the current user
-    if ( $self->current_user->principal_id == $principal->id ) {
+    if ( $self->current_user->id == $principal->id ) {
 
         #  If it's an AdminCc and they don't have
         #   'WatchAsAdminCc' or 'ModifyTicket', bail

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Record.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Record.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Record.pm	Mon Dec 24 00:28:10 2007
@@ -1660,17 +1660,17 @@
     unless (defined $field) {
         Carp::confess;
     }
-    my $cf = RT::Model::CustomField->new;
+    my $cf = RT::Model::CustomField->new();
 
     if ( UNIVERSAL::isa( $field, "RT::Model::CustomField" ) ) {
         $cf->load_by_id( $field->id );
     }
     elsif ($field =~ /^\d+$/) {
-        $cf = RT::Model::CustomField->new;
+        $cf = RT::Model::CustomField->new();
         $cf->load_by_id($field);
     } else {
 
-        my $cfs = $self->CustomFields($self->current_user);
+        my $cfs = $self->CustomFields();
         $cfs->limit(column => 'name', value => $field, case_sensitive => 0);
         $cf = $cfs->first || RT::Model::CustomField->new;
     }
@@ -1691,9 +1691,6 @@
     return RT->Config->Get('WebPath'). "/index.html?q=";
 }
 
-sub DESTROY {}
 sub Table { warn(" deprecated Table call discarded")}
-use vars qw/$AUTOLOAD/;
-sub AUTOLOAD { Carp::cluck $AUTOLOAD . " not found"}
 
 1;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Report/Tickets.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Report/Tickets.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Report/Tickets.pm	Mon Dec 24 00:28:10 2007
@@ -116,12 +116,12 @@
     my $field = shift;
     if ( $field =~ /^(?:CF|CustomField)\.{(.*)}$/ ) {
         my $cf = $1;
-        return $self->current_user->loc( "Custom field '%1'", $cf ) if $cf =~ /\D/;
+        return _( "Custom field '%1'", $cf ) if $cf =~ /\D/;
         my $obj = RT::Model::CustomField->new;
         $obj->load( $cf );
-        return $self->current_user->loc( "Custom field '%1'", $obj->name );
+        return _( "Custom field '%1'", $obj->name );
     }
-    return $self->current_user->loc($field);
+    return _($field);
 }
 
 sub GroupBy {

Modified: rt/branches/3.999-DANGEROUS/lib/RT/SavedSearch.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/SavedSearch.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/SavedSearch.pm	Mon Dec 24 00:28:10 2007
@@ -79,7 +79,7 @@
     my $self  = {};
     $self->{'id'} = 0;
     bless ($self, $class);
-    $self->_get_current_user();
+    $self->_get_current_user(@_);
     return $self;
 }
 
@@ -283,7 +283,7 @@
 
 sub _load_privacy_object {
     my ($self, $obj_type, $obj_id) = @_;
-    if ( $obj_type eq 'RT::Model::User' && $obj_id == $self->current_user->id)  {
+    if ( $obj_type eq 'RT::Model::User' && $obj_id == $self->current_user->id )  {
         return $self->current_user->user_object;
     }
     elsif ($obj_type eq 'RT::Model::Group') {
@@ -295,7 +295,7 @@
         return RT::System->new;
     }
 
-    $RT::Logger->error("Tried to load a search belonging to an $obj_type, which is neither a user nor a group");
+    $RT::Logger->error("Tried to load a search belonging to an $obj_type ($obj_id), which is neither a user nor a group");
     return undef;
 }
 
@@ -303,39 +303,34 @@
 #  have been passed.
 
 sub _GetObject {
-    my $self = shift;
+    my $self    = shift;
     my $privacy = shift;
 
-    my ($obj_type, $obj_id) = split(/\-/, $privacy);
+    warn "Checking on privacy for $privacy";
+
+    my ( $obj_type, $obj_id ) = split( /\-/, $privacy );
 
-    my $object = $self->_load_privacy_object($obj_type, $obj_id);
+    my $object = $self->_load_privacy_object( $obj_type, $obj_id );
 
-    unless (ref($object) eq $obj_type) {
-	$RT::Logger->error("Could not load object of type $obj_type with ID $obj_id");
-	return undef;
+    unless ( ref($object) eq $obj_type ) {
+        $RT::Logger->error( "Could not load object of type $obj_type with ID $obj_id I AM ".$self->current_user->id);
+        return undef;
     }
 
     # Do not allow the loading of a user object other than the current
     # user, or of a group object of which the current user is not a member.
 
-    if ($obj_type eq 'RT::Model::User' 
-	&& $object->id != $self->current_user->user_object->id()) {
-	$RT::Logger->debug("Permission denied for user other than self");
-	return undef;
-    }
-    if ($obj_type eq 'RT::Model::Group' &&
-	!$object->has_member_recursively($self->current_user->principal_object)) {
-	$RT::Logger->debug("Permission denied, ".$self->current_user->name.
-			   " is not a member of group");
-	return undef;
+    if (   $obj_type eq 'RT::Model::User' && $object->id != $self->current_user->user_object->id() ) {
+        $RT::Logger->debug("Permission denied for user other than self");
+        return undef;
+    }
+    if ($obj_type eq 'RT::Model::Group'
+        && !$object->has_member_recursively( $self->current_user->principal_object)) {
+        $RT::Logger->debug( "Permission denied, " . $self->current_user->name . " is not a member of group" );
+        return undef;
     }
 
     return $object;
 }
 
-eval "require RT::SavedSearch_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/SavedSearch_Vendor.pm});
-eval "require RT::SavedSearch_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/SavedSearch_Local.pm});
-
 1;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/SavedSearches.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/SavedSearches.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/SavedSearches.pm	Mon Dec 24 00:28:10 2007
@@ -76,7 +76,7 @@
     my $class = ref($proto) || $proto;
     my $self  = {};
     bless ($self, $class);
-    $self->_get_current_user();
+    $self->_get_current_user(@_);
     $self->{'idx'} = 0;
     $self->{'objects'} = [];
     return $self;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/CreateTickets.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/CreateTickets.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/CreateTickets.pm	Mon Dec 24 00:28:10 2007
@@ -45,13 +45,15 @@
 # those contributions and any derivatives thereof.
 # 
 # END BPS TAGGED BLOCK }}}
-package RT::ScripAction::CreateTickets;
-require RT::ScripAction::Generic;
+
 
 use strict;
 use warnings;
-use vars qw/@ISA/;
- at ISA = qw(RT::ScripAction::Generic);
+
+package RT::ScripAction::CreateTickets;
+require RT::ScripAction::Generic;
+
+use base qw(RT::ScripAction::Generic);
 
 use MIME::Entity;
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordComment.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordComment.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordComment.pm	Mon Dec 24 00:28:10 2007
@@ -45,7 +45,7 @@
 # those contributions and any derivatives thereof.
 # 
 # END BPS TAGGED BLOCK }}}
-package RT::ScripAction::Recordcomment;
+package RT::ScripAction::RecordComment;
 require RT::ScripAction::Generic;
 use strict;
 use vars qw/@ISA/;
@@ -53,13 +53,13 @@
 
 =head1 name
 
-RT::ScripAction::Recordcomment - An Action which can be used from an
+RT::ScripAction::RecordComment - An Action which can be used from an
 external tool, or in any situation where a ticket transaction has not
 been started, to make a comment on the ticket.
 
 =head1 SYNOPSIS
 
-my $action_obj = RT::ScripAction::Recordcomment->new('TicketObj'   => $ticket_obj,
+my $action_obj = RT::ScripAction::RecordComment->new('TicketObj'   => $ticket_obj,
 						'TemplateObj' => $template_obj,
 						);
 my $result = $action_obj->prepare();

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Search/Googleish.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Search/Googleish.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Search/Googleish.pm	Mon Dec 24 00:28:10 2007
@@ -99,7 +99,7 @@
 
         # Is there a status with this name?
         elsif (
-            $Queue = RT::Model::Queue->new( $self->TicketsObj->current_user )
+            $Queue = RT::Model::Queue->new( current_user => $self->TicketsObj->current_user )
             and $Queue->IsValidStatus($key)
           )
         {
@@ -108,14 +108,14 @@
 
         # Is there a owner named $key?
         # Is there a queue named $key?
-        elsif ( $Queue = RT::Model::Queue->new( $self->TicketsObj->current_user )
+        elsif ( $Queue = RT::Model::Queue->new( current_user => $self->TicketsObj->current_user )
             and $Queue->load($key) )
         {
             push @queue_clauses, "Queue = '" . $Queue->name . "'";
         }
 
         # Is there a owner named $key?
-        elsif ( $User = RT::Model::User->new( $self->TicketsObj->current_user )
+        elsif ( $User = RT::Model::User->new( current_user => $self->TicketsObj->current_user )
             and $User->load($key)
             and $User->privileged )
         {
@@ -158,9 +158,4 @@
 }
 # }}}
 
-eval "require RT::Search::Googleish_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Search/Googleish_Vendor.pm});
-eval "require RT::Search::Googleish_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Search/Googleish_Local.pm});
-
 1;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Users.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Users.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Users.pm	Mon Dec 24 00:28:10 2007
@@ -134,7 +134,7 @@
     my $objs = RT::Model::UserCollection->new(current_user => RT->system_user );
     # XXX: we want preload only things we need, but later while
     # logging we need all data, TODO envestigate this
-    # $objs->columns(qw(id name email Lang Timezone
+    # $objs->columns(qw(id name email lang Timezone
     #                   Creator Created LastUpdated LastUpdatedBy));
     if( my $s = $self->{'opt'}{'status'} ) {
         if( $s eq 'any' ) {

Modified: rt/branches/3.999-DANGEROUS/lib/RT/StyleGuide.pod
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/StyleGuide.pod	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/StyleGuide.pod	Mon Dec 24 00:28:10 2007
@@ -76,7 +76,7 @@
 can be translated to many formats with the various pod2* translators. 
 Read the perlpod manpage before writing any POD, because although POD is
 not difficult, it is not what most people are used to.  It is not a
-regular markup language; it is just a way to make easy documentation
+regular markup Language; it is just a way to make easy documentation
 for translating to other formats.  Read, and understand, the perlpod
 manpage, and ask us or someone else who knows if you have any questions.
 
@@ -348,7 +348,7 @@
 =item function vs. sub(routine) vs. method
 
 Just because it is the Perl Way (not necessarily right for all
-languages, but the documented terminology in the perl documentation),
+Languages, but the documented terminology in the perl documentation),
 "method" should be used only to refer to a subroutine that are object
 methods or class methods; that is, these are functions that are used
 with OOP that always take either an object or a class as the first

Modified: rt/branches/3.999-DANGEROUS/sbin/extract-message-catalog
==============================================================================
--- rt/branches/3.999-DANGEROUS/sbin/extract-message-catalog	(original)
+++ rt/branches/3.999-DANGEROUS/sbin/extract-message-catalog	Mon Dec 24 00:28:10 2007
@@ -81,7 +81,7 @@
     $FILECAT->{$str} = $entry;
 }
 
-# update all language dictionaries
+# update all Language dictionaries
 foreach my $dict (@ARGV) {
     $dict = "lib/RT/I18N/$dict.po" unless -f $dict or $dict =~ m!/!;
 

Modified: rt/branches/3.999-DANGEROUS/t/api/ace.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/api/ace.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/api/ace.t	Mon Dec 24 00:28:10 2007
@@ -5,29 +5,15 @@
 use RT::Test; 
 use Test::More tests => 76;
 
-
-{
-    undef $main::_STDOUT_;
-    undef $main::_STDERR_;
-
 ok(require RT::Model::ACE);
 
-
-    undef $main::_STDOUT_;
-    undef $main::_STDERR_;
-}
-
 {
-    undef $main::_STDOUT_;
-    undef $main::_STDERR_;
 
 my $Queue = RT::Model::Queue->new(current_user => RT->system_user);
 
 is ($Queue->AvailableRights->{'DeleteTicket'} , 'Delete tickets', "Found the delete ticket right");
 is (RT::System->AvailableRights->{'SuperUser'},  'Do anything and everything', "Found the superuser right");
 
-
-
 }
 
 {
@@ -56,7 +42,7 @@
 
 ok($user_a->has_right( Object => RT->system, Right => 'AdminOwnPersonalGroups')    ,"user a has the right 'AdminOwnPersonalGroups' directly");
 
-my $a_delegates = RT::Model::Group->new( $user_a);
+my $a_delegates = RT::Model::Group->new( current_user => $user_a);
 $a_delegates->createPersonalGroup(name => 'Delegates');
 ok( $a_delegates->id   ,"user a creates a personal group 'Delegates'");
 ok( $a_delegates->add_member($user_b->principal_id)   ,"user a adds user b to personal group 'delegates'");
@@ -66,11 +52,11 @@
 ok(!$user_a->has_right( Object => RT->system, Right => 'DelegateRights')    ,"user a does not have the right 'delegate rights'");
 
 
-my $own_ticket_ace = RT::Model::ACE->new($user_a);
-my $user_a_equiv_group = RT::Model::Group->new($user_a);
+my $own_ticket_ace = RT::Model::ACE->new(current_user => $user_a);
+my $user_a_equiv_group = RT::Model::Group->new(current_user => $user_a);
 $user_a_equiv_group->load_acl_equivalence_group($user_a->principal_object);
 ok ($user_a_equiv_group->id, "Loaded the user A acl equivalence group");
-my $user_b_equiv_group = RT::Model::Group->new($user_b);
+my $user_b_equiv_group = RT::Model::Group->new(current_user => $user_b);
 $user_b_equiv_group->load_acl_equivalence_group($user_b->principal_object);
 ok ($user_b_equiv_group->id, "Loaded the user B acl equivalence group");
 $own_ticket_ace->load_by_values( principal_type => 'Group', principal_id => $user_a_equiv_group->principal_id, Object=>$q, right_name => 'OwnTicket');
@@ -91,7 +77,7 @@
 
 ok( $val    ,"user a tries and succeeds to delegate the right 'ownticket' in queue 'DelegationTest' to personal group 'delegates' - $msg");
 ok(  $user_b->has_right(Right => 'OwnTicket', Object => $q)  ,"user b has the right to own tickets in queue 'DelegationTest'");
-my $delegated_ace = RT::Model::ACE->new($user_a);
+my $delegated_ace = RT::Model::ACE->new(current_user => $user_a);
 $delegated_ace->load_by_values ( Object => $q, right_name => 'OwnTicket', principal_type => 'Group',
 principal_id => $a_delegates->principal_id, DelegatedBy => $user_a->principal_id, DelegatedFrom => $own_ticket_ace->id);
 ok ($delegated_ace->id, "Found the delegated ACE");
@@ -167,7 +153,7 @@
 
 ok(  $user_a->has_right(Right => 'OwnTicket', Object => $q)  ,"make sure that user a can own tickets in queue 'DelegationTest'");
 
-my $group_ace= RT::Model::ACE->new($user_a);
+my $group_ace= RT::Model::ACE->new(current_user => $user_a);
 $group_ace->load_by_values( principal_type => 'Group', principal_id => $del1->principal_id, Object => $q, right_name => 'OwnTicket');
 
 ok ($group_ace->id, "Found the ACE we want to test with for now");
@@ -198,7 +184,7 @@
 ($val, $msg) = $del2->principal_object->GrantRight(Object=>$q, Right => 'OwnTicket');
 ok($val, "grant the right 'own tickets' in queue 'DelegationTest' to group del2 - $msg");
 
-my $del2_right = RT::Model::ACE->new($user_a);
+my $del2_right = RT::Model::ACE->new(current_user => $user_a);
 $del2_right->load_by_values( principal_id => $del2->principal_id, principal_type => 'Group', Object => $q, right_name => 'OwnTicket');
 ok ($del2_right->id, "Found the right");
 
@@ -218,7 +204,7 @@
 ok($val, "grant the right 'own tickets' in queue 'DelegationTest' to group del2 - $msg");
 
 
-$group_ace= RT::Model::ACE->new($user_a);
+$group_ace= RT::Model::ACE->new(current_user => $user_a);
 $group_ace->load_by_values( principal_type => 'Group', principal_id => $del1->principal_id, Object=>$q, right_name => 'OwnTicket');
 
 ok ($group_ace->id, "Found the ACE we want to test with for now");

Modified: rt/branches/3.999-DANGEROUS/t/api/cf_combo_casacade.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/api/cf_combo_casacade.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/api/cf_combo_casacade.t	Mon Dec 24 00:28:10 2007
@@ -8,22 +8,22 @@
 sub fails { ok(!$_[0], "This should fail: $_[1]") }
 sub works { ok($_[0], $_[1] || 'This works') }
 
-sub new (*) {
+sub new {
     my $class = shift;
     return $class->new(current_user => RT->system_user);
 }
 
-my $q = new(current_user => RT::Model::Queue);
+my $q = new( RT::Model::Queue);
 works($q->create(name => "CF-Pattern-".$$));
 
-my $cf = new(current_user => RT::Model::CustomField);
+my $cf = new(RT::Model::CustomField);
 my @cf_args = (name => $q->name, Type => 'Combobox', Queue => $q->id);
 
 works($cf->create(@cf_args));
 
 # Set some CFVs with Category markers
 
-my $t = new(current_user => RT::Model::Ticket);
+my $t = new( RT::Model::Ticket);
 my ($id,undef,$msg) = $t->create(Queue => $q->id, Subject => 'CF Test');
 works($id,$msg);
 

Modified: rt/branches/3.999-DANGEROUS/t/api/cf_pattern.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/api/cf_pattern.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/api/cf_pattern.t	Mon Dec 24 00:28:10 2007
@@ -10,21 +10,21 @@
 sub fails { ok(!$_[0], "This should fail: $_[1]") }
 sub works { ok($_[0], $_[1] || 'This works') }
 
-sub new (*) {
+sub new {
     my $class = shift;
     return $class->new(current_user => RT->system_user);
 }
 
-my $q = new(current_user => RT::Model::Queue);
+my $q = new(RT::Model::Queue);
 works($q->create(name => "CF-Pattern-".$$));
 
-my $cf = new(current_user => RT::Model::CustomField);
+my $cf = new(RT::Model::CustomField);
 my @cf_args = (name => $q->name, Type => 'Freeform', Queue => $q->id, MaxValues => 1);
 
 fails($cf->create(@cf_args, Pattern => ')))bad!regex((('));
 works($cf->create(@cf_args, Pattern => 'good regex'));
 
-my $t = new(current_user => RT::Model::Ticket);
+my $t = new(RT::Model::Ticket);
 my ($id,undef,$msg) = $t->create(Queue => $q->id, Subject => 'CF Test');
 works($id,$msg);
 

Modified: rt/branches/3.999-DANGEROUS/t/api/date.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/api/date.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/api/date.t	Mon Dec 24 00:28:10 2007
@@ -25,15 +25,15 @@
     my $user = RT::Model::User->new(current_user => RT->system_user);
     my($uid, $msg) = $user->create(
         name       => "date_api". rand(200),
-        Lang       => 'en',
+        lang       => 'en',
         privileged => 1,
     );
     ok($uid, "user was Created") or diag("error: $msg");
-    $current_user = RT::CurrentUser->new($user);
+    $current_user = RT::CurrentUser->new(id => $user->id);
 }
 
 {
-    my $date = RT::Date->new( $current_user );
+    my $date = RT::Date->new(current_user => $current_user );
     is($date->Timezone, 'UTC', "dropped all timzones to UTC");
     is($date->Timezone('user'), 'UTC', "dropped all timzones to UTC");
     is($date->Timezone('server'), 'UTC', "dropped all timzones to UTC");
@@ -184,14 +184,14 @@
 
 { # positive timezone
     $current_user->user_object->__set( column => 'Timezone', value => 'Europe/Moscow');
-    my $date = RT::Date->new( $current_user );
+    my $date = RT::Date->new( current_user => $current_user );
     $date->set( Format => 'ISO', Timezone => 'utc', value => '2005-01-01 15:10:00' );
     is($date->ISO( Timezone => 'user' ), '2005-01-01 18:10:00', "ISO");
     is($date->W3CDTF( Timezone => 'user' ), '2005-01-01T18:10:00+03:00', "W3C DTF");
     is($date->RFC2822( Timezone => 'user' ), 'Sat, 1 Jan 2005 18:10:00 +0300', "RFC2822");
 
     # DST
-    $date = RT::Date->new( $current_user );
+    $date = RT::Date->new(current_user =>  $current_user );
     $date->set( Format => 'ISO', Timezone => 'utc', value => '2005-07-01 15:10:00' );
     is($date->ISO( Timezone => 'user' ), '2005-07-01 19:10:00', "ISO");
     is($date->W3CDTF( Timezone => 'user' ), '2005-07-01T19:10:00+04:00', "W3C DTF");
@@ -200,14 +200,14 @@
 
 { # negative timezone
     $current_user->user_object->__set( column => 'Timezone', value => 'America/New_York');
-    my $date = RT::Date->new( $current_user );
+    my $date = RT::Date->new( current_user => $current_user );
     $date->set( Format => 'ISO', Timezone => 'utc', value => '2005-01-01 15:10:00' );
     is($date->ISO( Timezone => 'user' ), '2005-01-01 10:10:00', "ISO");
     is($date->W3CDTF( Timezone => 'user' ), '2005-01-01T10:10:00-05:00', "W3C DTF");
     is($date->RFC2822( Timezone => 'user' ), 'Sat, 1 Jan 2005 10:10:00 -0500', "RFC2822");
 
     # DST
-    $date = RT::Date->new( $current_user );
+    $date = RT::Date->new( current_user =>  $current_user );
     $date->set( Format => 'ISO', Timezone => 'utc', value => '2005-07-01 15:10:00' );
     is($date->ISO( Timezone => 'user' ), '2005-07-01 11:10:00', "ISO");
     is($date->W3CDTF( Timezone => 'user' ), '2005-07-01T11:10:00-04:00', "W3C DTF");
@@ -293,7 +293,7 @@
     is($date->ISO, '2005-11-28 15:10:00', "YYYY-DD-MM hh:mm:ss");
 
     $current_user->user_object->__set( column => 'Timezone', value => 'Europe/Moscow');
-    $date = RT::Date->new( $current_user );
+    $date = RT::Date->new( current_user => $current_user );
     $date->set(Format => 'datemanip', value => '2005-11-28 15:10:00');
     is($date->ISO, '2005-11-28 12:10:00', "YYYY-DD-MM hh:mm:ss");
 }
@@ -315,7 +315,7 @@
     is($date->ISO, '2005-11-28 15:10:00', "YYYY-DD-MM hh:mm:ss");
 
     $current_user->user_object->__set( column => 'Timezone', value => 'Europe/Moscow');
-    $date = RT::Date->new( $current_user );
+    $date = RT::Date->new( current_user => $current_user );
     $date->set(Format => 'unknown', value => '2005-11-28 15:10:00');
     is($date->ISO, '2005-11-28 12:10:00', "YYYY-DD-MM hh:mm:ss");
     $date->set(Format => 'unknown', value => '2005-11-28 15:10:00', Timezone => 'server' );
@@ -342,7 +342,7 @@
     is($date->ISO, '2005-11-27 21:00:00', "server context");
 
     $current_user->user_object->__set( column => 'Timezone', value => 'Europe/Moscow');
-    $date = RT::Date->new( $current_user );
+    $date = RT::Date->new(current_user =>  $current_user );
     $date->set(Format => 'ISO', value => '2005-11-28 15:10:00');
     $date->set_ToMidnight;
     is($date->ISO, '2005-11-28 00:00:00', "default is utc");
@@ -407,7 +407,7 @@
 
 {
     $current_user->user_object->__set( column => 'Timezone', value => '');
-    my $date = RT::Date->new( $current_user );
+    my $date = RT::Date->new(current_user =>  $current_user );
     is($date->AsString, "Not set", "AsString returns 'Not set'");
 
     RT->Config->set( DateTimeFormat => '');

Modified: rt/branches/3.999-DANGEROUS/t/cron.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/cron.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/cron.t	Mon Dec 24 00:28:10 2007
@@ -17,7 +17,7 @@
 ok($ret,$msg);
 ($ret,$msg) =$user_obj->principal_object->GrantRight(Right => 'SuperUser');
 ok($ret,$msg);
-my $CurrentUser = RT::CurrentUser->new('tara');
+my $CurrentUser = RT::CurrentUser->new(name => 'tara');
 is($user_obj->name,'tara');
 is ($user_obj->id, $CurrentUser->id);
 
@@ -60,11 +60,13 @@
 
 # First test the search.
 
-ok(require RT::Search::FromSQL, "Search::FromSQL loaded");
-my $ticketsqlstr = "Requestor.email = '" . $CurrentUser->email .
-    "' AND Priority > '20'";
-my $search = RT::Search::FromSQL->new(Argument => $ticketsqlstr, TicketsObj => RT::Model::TicketCollection->new(current_user => RT->system_user),
-				      );
+ok( require RT::Search::FromSQL, "Search::FromSQL loaded" );
+my $ticketsqlstr
+    = "Requestor.email = '" . $CurrentUser->email . "' AND Priority > '20'";
+my $search = RT::Search::FromSQL->new(
+    Argument => $ticketsqlstr,
+    TicketsObj => RT::Model::TicketCollection->new( current_user => RT->system_user ),
+);
 is(ref($search), 'RT::Search::FromSQL', "search Created");
 ok($search->prepare(), "from_sql search run");
 my $counter = 0;
@@ -76,11 +78,11 @@
 
 # Right.  Now test the actions.
 
-ok(require RT::ScripAction::Recordcomment);
+ok(require RT::ScripAction::RecordComment);
 ok(require RT::ScripAction::RecordCorrespondence);
 
 my ($comment_act, $correspond_act);
-ok($comment_act = RT::ScripAction::Recordcomment->new(TicketObj => $ticket1, TemplateObj => $template_obj, CurrentUser => $CurrentUser), "Recordcomment Created");
+ok($comment_act = RT::ScripAction::RecordComment->new(TicketObj => $ticket1, TemplateObj => $template_obj, CurrentUser => $CurrentUser), "RecordComment Created");
 ok($correspond_act = RT::ScripAction::RecordCorrespondence->new(TicketObj => $ticket2, TemplateObj => $template_obj, CurrentUser => $CurrentUser), "RecordCorrespondence Created");
 ok($comment_act->prepare(), "comment prepared");
 ok($correspond_act->prepare(), "Correspond prepared");
@@ -89,7 +91,7 @@
 
 # Now test for loop suppression.
 my ($trans, $desc, $transaction) = $ticket2->comment(MIMEObj => $template_obj->MIMEObj);
-my $bogus_action = RT::ScripAction::Recordcomment->new(TicketObj => $ticket1, TemplateObj => $template_obj, TransactionObj => $transaction, CurrentUser => $CurrentUser);
+my $bogus_action = RT::ScripAction::RecordComment->new(TicketObj => $ticket1, TemplateObj => $template_obj, TransactionObj => $transaction, CurrentUser => $CurrentUser);
 ok(!$bogus_action->prepare(), "comment aborted to prevent loop");
 
 1;

Modified: rt/branches/3.999-DANGEROUS/t/savedsearch.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/savedsearch.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/savedsearch.t	Mon Dec 24 00:28:10 2007
@@ -26,10 +26,8 @@
 my $ingroup = RT::Model::Group->new(current_user => RT->system_user);
 $ingroup->create_userDefinedGroup(name => 'searchgroup1'.$$);
 $ingroup->add_member($searchuser->id);
-$searchuser->principal_object->GrantRight(Right => 'EditSavedSearches',
-				      Object => $ingroup);
-$searchuser->principal_object->GrantRight(Right => 'ShowSavedSearches',
-				      Object => $ingroup);
+$searchuser->principal_object->GrantRight(Right => 'EditSavedSearches', Object => $ingroup);
+$searchuser->principal_object->GrantRight(Right => 'ShowSavedSearches', Object => $ingroup);
 
 # This is the group whose searches searchuser should not be able to see.
 my $outgroup = RT::Model::Group->new(current_user => RT->system_user);
@@ -51,7 +49,6 @@
 
 
 # Now start the search madness.
-my $curruser = RT::CurrentUser->new($searchuser);
 my $format = '\'   <b><a href="/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#\',
 \'<b><a href="/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject\',
 \'__Status__\',
@@ -66,18 +63,24 @@
 \'<small>__LastUpdatedRelative__</small>\',
 \'<small>__time_left__</small>\'';
 
-my $mysearch = RT::SavedSearch->new($curruser);
-($ret, $msg) = $mysearch->Save(Privacy => 'RT::Model::User-' . $searchuser->id,
-			       Type => 'Ticket',
-			       name => 'owned by me',
-			       SearchParams => {'Format' => $format,
-						'Query' => "Owner = '" 
-						    . $searchuser->name 
-						    . "'"});
+my $curruser = RT::CurrentUser->new(id => $searchuser->id);
+warn "My search user = ".$searchuser->id;
+my $mysearch = RT::SavedSearch->new( current_user => $curruser );
+( $ret, $msg ) = $mysearch->Save(
+    Privacy      => 'RT::Model::User-' . $searchuser->id,
+    Type         => 'Ticket',
+    name         => 'owned by me',
+    SearchParams => {
+        'Format' => $format,
+        'Query'  => "Owner = '" . $searchuser->name . "'"
+    }
+);
+
+
 ok($ret, "mysearch was Created");
 
 
-my $groupsearch = RT::SavedSearch->new($curruser);
+my $groupsearch = RT::SavedSearch->new(current_user => $curruser);
 ($ret, $msg) = $groupsearch->Save(Privacy => 'RT::Model::Group-' . $ingroup->id,
 				  Type => 'Ticket',
 				  name => 'search queue',
@@ -86,7 +89,7 @@
 						       . $queue->name . "'"});
 ok($ret, "groupsearch was Created");
 
-my $othersearch = RT::SavedSearch->new($curruser);
+my $othersearch = RT::SavedSearch->new(current_user => $curruser);
 ($ret, $msg) = $othersearch->Save(Privacy => 'RT::Model::Group-' . $outgroup->id,
 				  Type => 'Ticket',
 				  name => 'searchuser requested',
@@ -108,7 +111,7 @@
 # Now try to load some searches.
 
 # This should work.
-my $loadedsearch1 = RT::SavedSearch->new($curruser);
+my $loadedsearch1 = RT::SavedSearch->new(current_user => $curruser);
 $loadedsearch1->load('RT::Model::User-'.$curruser->id, $mysearch->id);
 is($loadedsearch1->id, $mysearch->id, "Loaded mysearch");
 like($loadedsearch1->GetParameter('Query'), qr/Owner/, 
@@ -120,7 +123,7 @@
 is($loadedsearch1->Type, 'Ticket', "Type of mysearch correct");
 
 # See if it can be used to search for tickets.
-my $tickets = RT::Model::TicketCollection->new($curruser);
+my $tickets = RT::Model::TicketCollection->new(current_user => $curruser);
 $tickets->from_sql($loadedsearch1->GetParameter('Query'));
 is($tickets->count, 1, "Found a ticket");
 
@@ -129,18 +132,18 @@
 # $loadedsearch2->load('RT::Model::User-'.$curruser->id, $groupsearch->id);
 # isnt($loadedsearch2->id, $othersearch->id, "Didn't load groupsearch as mine");
 # ...but this should succeed.
-my $loadedsearch3 = RT::SavedSearch->new($curruser);
+my $loadedsearch3 = RT::SavedSearch->new(current_user => $curruser);
 $loadedsearch3->load('RT::Model::Group-'.$ingroup->id, $groupsearch->id);
 is($loadedsearch3->id, $groupsearch->id, "Loaded groupsearch");
 like($loadedsearch3->GetParameter('Query'), qr/Queue/,
      "Retrieved query of groupsearch");
 # Can it get tickets?
-$tickets = RT::Model::TicketCollection->new($curruser);
+$tickets = RT::Model::TicketCollection->new(current_user => $curruser);
 $tickets->from_sql($loadedsearch3->GetParameter('Query'));
 is($tickets->count, 1, "Found a ticket");
 
 # This should fail -- no permission.
-my $loadedsearch4 = RT::SavedSearch->new($curruser);
+my $loadedsearch4 = RT::SavedSearch->new(current_user => $curruser);
 $loadedsearch4->load($othersearch->Privacy, $othersearch->id);
 isnt($loadedsearch4->id, $othersearch->id, "Did not load othersearch");
 
@@ -157,16 +160,16 @@
 
 ## Right ho.  Test the pseudo-collection object.
 
-my $genericsearch = RT::SavedSearch->new($curruser);
+my $genericsearch = RT::SavedSearch->new(current_user => $curruser);
 $genericsearch->Save(name => 'generic search',
 		     Type => 'all',
 		     SearchParams => {'Query' => "Queue = 'General'"});
 
-my $ticketsearches = RT::SavedSearches->new($curruser);
+my $ticketsearches = RT::SavedSearches->new(current_user => $curruser);
 $ticketsearches->LimitToPrivacy('RT::Model::User-'.$curruser->id, 'Ticket');
 is($ticketsearches->count, 1, "Found searchuser's ticket searches");
 
-my $allsearches = RT::SavedSearches->new($curruser);
+my $allsearches = RT::SavedSearches->new(current_user => $curruser);
 $allsearches->LimitToPrivacy('RT::Model::User-'.$curruser->id);
 is($allsearches->count, 2, "Found all searchuser's searches");
 

Modified: rt/branches/3.999-DANGEROUS/t/shredder/utils.pl
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/shredder/utils.pl	(original)
+++ rt/branches/3.999-DANGEROUS/t/shredder/utils.pl	Mon Dec 24 00:28:10 2007
@@ -297,7 +297,7 @@
     $dbh->{'FetchHashKeyname'} = 'name_lc';
 
     my $sth = $dbh->table_info( '', '', '%', 'TABLE' ) || die $DBI::err;
-    my @tables = keys %{$sth->fetchall_hashref( 'table_name' )};
+    my @tables = keys %{$sth->fetchall_hashref( 'TABLE_NAME' )};
 
     my $res = {};
     foreach my $t( @tables ) {

Modified: rt/branches/3.999-DANGEROUS/t/ticket/link_search.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/link_search.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/link_search.t	Mon Dec 24 00:28:10 2007
@@ -13,17 +13,17 @@
 #Get the current user all loaded
 my $CurrentUser = RT->system_user;
 
-my $queue = RT::Model::Queue->new($CurrentUser);
+my $queue = RT::Model::Queue->new(current_user => $CurrentUser);
 $queue->load('General') || Abort(loc("Queue could not be loaded."));
 
-my $child_ticket = RT::Model::Ticket->new( $CurrentUser );
+my $child_ticket = RT::Model::Ticket->new(current_user =>  $CurrentUser );
 my ($childid) = $child_ticket->create(
     Subject => 'test child',
     Queue => $queue->id,
 );
 ok($childid, "We Created a child ticket");
 
-my $parent_ticket = RT::Model::Ticket->new( $CurrentUser );
+my $parent_ticket = RT::Model::Ticket->new(current_user =>  $CurrentUser );
 my ($parentid) = $parent_ticket->create(
     Subject => 'test parent',
     Children => [ $childid ],
@@ -156,7 +156,7 @@
 ok( $has{$parentid}, "The collection has our parent - $parentid");
 ok( !$has{$childid}, "The collection doesn't have our child - $childid");
 
-my $grand_child_ticket = RT::Model::Ticket->new( $CurrentUser );
+my $grand_child_ticket = RT::Model::Ticket->new(current_user =>  $CurrentUser );
 my ($grand_childid) = $child_ticket->create(
     Subject => 'test child',
     Queue   => $queue->id,
@@ -164,7 +164,7 @@
 );
 ok($childid, "We Created a grand child ticket");
 
-my $unlinked_ticket = RT::Model::Ticket->new( $CurrentUser );
+my $unlinked_ticket = RT::Model::Ticket->new( current_user => $CurrentUser );
 my ($unlinked_id) = $child_ticket->create(
     Subject => 'test unlinked',
     Queue   => $queue->id,

Modified: rt/branches/3.999-DANGEROUS/t/web/compilation_errors.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/compilation_errors.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/web/compilation_errors.t	Mon Dec 24 00:28:10 2007
@@ -2,7 +2,7 @@
 
 use strict;
 use RT::Test; use Test::More;
-plan tests => 387;
+plan tests => 382;
 use HTTP::Request::Common;
 use HTTP::Cookies;
 use LWP;
@@ -21,21 +21,8 @@
 diag "Base URL is '$url'" if $ENV{TEST_VERBOSE};
 $agent->get($url);
 
-is ($agent->{'status'}, 200, "Loaded a page");
-
 # {{{ test a login
-
-# follow the link marked "Login"
-
-ok($agent->{form}->find_input('user'));
-
-ok($agent->{form}->find_input('pass'));
-like ($agent->{'content'} , qr/username:/i);
-$agent->field( 'user' => 'root' );
-$agent->field( 'pass' => 'password' );
-# the field isn't named, so we have to click link 0
-$agent->click(0);
-is($agent->{'status'}, 200, "Fetched the page ok");
+$agent->login(root => 'password');
 like( $agent->{'content'} , qr/Logout/i, "Found a logout link");
 
 
@@ -43,7 +30,7 @@
 find ( \&wanted , 'html/');
 
 sub wanted {
-        -f  && /\.html$/ && $_ !~ /Logout.html$/ && test_get($File::Find::name);
+        -f  && /\.html$/ && test_get($File::Find::name);
 }       
 
 sub test_get {

Modified: rt/branches/3.999-DANGEROUS/t/web/rights1.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/rights1.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/web/rights1.t	Mon Dec 24 00:28:10 2007
@@ -2,7 +2,7 @@
 use strict;
 use HTTP::Cookies;
 
-use RT::Test; use Test::More tests => 37;
+use RT::Test; use Test::More tests => 31;
 
 my ($baseurl, $agent) = RT::Test->started_ok;
 
@@ -29,7 +29,7 @@
 
 no warnings 'once';
 # get the top page
-login($agent, $user_obj);
+$agent->login($user_obj->name => 'customer');
 
 # Test for absence of Configure and Preferences tabs.
 ok(!$agent->find_link( url => "$RT::WebPath/Admin/",
@@ -110,28 +110,4 @@
 my $input = $agent->current_form->find_input('ValueOfActor');
 ok(grep(/customer-$$/, $input->value_names()), "Found self in the actor listing");
 
-sub login {
-    my $agent = shift;
-
-    my $url = $baseurl;
-    $agent->get($url);
-    is( $agent->{'status'}, 200,
-        "Loaded a page - ".$baseurl);
-
-    # {{{ test a login
-
-    # follow the link marked "Login"
-
-    ok( $agent->{form}->find_input('user') );
-
-    ok( $agent->{form}->find_input('pass') );
-    like( $agent->{'content'} , qr/username:/i );
-    $agent->field( 'user' => $user_obj->name );
-    $agent->field( 'pass' => 'customer' );
-
-    # the field isn't named, so we have to click link 0
-    $agent->click(0);
-    is( $agent->{'status'}, 200, "Fetched the page ok" );
-    like( $agent->{'content'} , qr/Logout/i, "Found a logout link" );
-}
 1;

Modified: rt/branches/3.999-DANGEROUS/t/web/ticket_owner.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/ticket_owner.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/web/ticket_owner.t	Mon Dec 24 00:28:10 2007
@@ -83,7 +83,7 @@
 
 diag "user A can not change owner after create";
 {
-    my $ticket = RT::Model::Ticket->new( $user_a );
+    my $ticket = RT::Model::Ticket->new( current_user => RT::CurrentUser->new(id => $user_a->id ));
     my ($id, $txn, $msg) = $ticket->create(
         Queue => $queue->id,
         Owner => $user_b->id,
@@ -121,7 +121,7 @@
 
 diag "on reply correct owner is selected";
 {
-    my $ticket = RT::Model::Ticket->new( $user_a );
+    my $ticket = RT::Model::Ticket->new(current_user => RT::CurrentUser->new(id => $user_a->id ));
     my ($id, $txn, $msg) = $ticket->create(
         Queue => $queue->id,
         Owner => $user_b->id,
@@ -150,7 +150,7 @@
 
 diag "Couldn't take without coresponding right";
 {
-    my $ticket = RT::Model::Ticket->new( $user_a );
+    my $ticket = RT::Model::Ticket->new(current_user => RT::CurrentUser->new(id => $user_a->id ));
     my ($id, $txn, $msg) = $ticket->create(
         Queue => $queue->id,
         Subject => 'test',
@@ -167,7 +167,7 @@
 
 diag "Couldn't steal without coresponding right";
 {
-    my $ticket = RT::Model::Ticket->new( $user_a );
+    my $ticket = RT::Model::Ticket->new(current_user => RT::CurrentUser->new(id => $user_a->id ));
     my ($id, $txn, $msg) = $ticket->create(
         Queue => $queue->id,
         Owner => $user_b->id,
@@ -189,7 +189,7 @@
 
 diag "TakeTicket require OwnTicket to work";
 {
-    my $ticket = RT::Model::Ticket->new( $user_a );
+    my $ticket = RT::Model::Ticket->new(current_user => RT::CurrentUser->new(id => $user_a->id ));
     my ($id, $txn, $msg) = $ticket->create(
         Queue => $queue->id,
         Subject => 'test',
@@ -211,7 +211,7 @@
 
 diag "TakeTicket+OwnTicket work";
 {
-    my $ticket = RT::Model::Ticket->new( $user_a );
+    my $ticket = RT::Model::Ticket->new(current_user => RT::CurrentUser->new(id => $user_a->id ));
     my ($id, $txn, $msg) = $ticket->create(
         Queue => $queue->id,
         Subject => 'test',
@@ -232,7 +232,7 @@
 
 diag "TakeTicket+OwnTicket don't work when owner is not nobody";
 {
-    my $ticket = RT::Model::Ticket->new( $user_a );
+    my $ticket = RT::Model::Ticket->new( current_user => RT::CurrentUser->new(id => $user_a->id ));
     my ($id, $txn, $msg) = $ticket->create(
         Queue => $queue->id,
         Owner => $user_b->id,
@@ -255,7 +255,7 @@
 
 diag "StealTicket require OwnTicket to work";
 {
-    my $ticket = RT::Model::Ticket->new( $user_a );
+    my $ticket = RT::Model::Ticket->new(current_user => RT::CurrentUser->new(id => $user_a->id ));
     my ($id, $txn, $msg) = $ticket->create(
         Queue => $queue->id,
         Owner => $user_b->id,
@@ -278,7 +278,7 @@
 
 diag "StealTicket+OwnTicket work";
 {
-    my $ticket = RT::Model::Ticket->new( $user_a );
+    my $ticket = RT::Model::Ticket->new(current_user => RT::CurrentUser->new(id => $user_a->id ));
     my ($id, $txn, $msg) = $ticket->create(
         Queue => $queue->id,
         Owner => $user_b->id,
@@ -300,7 +300,7 @@
 
 diag "StealTicket+OwnTicket don't work when owner is nobody";
 {
-    my $ticket = RT::Model::Ticket->new( $user_a );
+    my $ticket = RT::Model::Ticket->new(current_user => RT::CurrentUser->new(id => $user_a->id ));
     my ($id, $txn, $msg) = $ticket->create(
         Queue => $queue->id,
         Subject => 'test',
@@ -322,7 +322,7 @@
 
 diag "no Steal link when owner nobody";
 {
-    my $ticket = RT::Model::Ticket->new( $user_a );
+    my $ticket = RT::Model::Ticket->new(current_user => RT::CurrentUser->new(id => $user_a->id ));
     my ($id, $txn, $msg) = $ticket->create(
         Queue => $queue->id,
         Subject => 'test',
@@ -339,7 +339,7 @@
 
 diag "no Take link when owner is not nobody";
 {
-    my $ticket = RT::Model::Ticket->new( $user_a );
+    my $ticket = RT::Model::Ticket->new(current_user => RT::CurrentUser->new(id => $user_a->id ));
     my ($id, $txn, $msg) = $ticket->create(
         Queue => $queue->id,
         Owner => $user_b->id,

Modified: rt/branches/3.999-DANGEROUS/t/web/ticket_seen.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/ticket_seen.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/web/ticket_seen.t	Mon Dec 24 00:28:10 2007
@@ -34,7 +34,7 @@
 diag "create a ticket for testing";
 my $tid;
 {
-    my $ticket = RT::Model::Ticket->new( $user_a );
+    my $ticket = RT::Model::Ticket->new(current_user => RT::CurrentUser->new(id =>$user_a->id) );
     my ($txn, $msg);
     ($tid, $txn, $msg) = $ticket->create(
         Queue => $queue->id,
@@ -47,7 +47,7 @@
 
 diag "user B adds a message, we check that user A see notification and can clear it";
 {
-    my $ticket = RT::Model::Ticket->new( $user_b );
+    my $ticket = RT::Model::Ticket->new( current_user => RT::CurrentUser->new(id =>$user_b) );
     $ticket->load( $tid );
     ok $ticket->id, 'loaded the ticket';
 


More information about the Rt-commit mailing list