[Rt-commit] r18958 - in rt/3.999/trunk: lib/RT lib/RT/Interface lib/RT/Model lib/RT/ScripAction lib/RT/Shredder share/html/Elements share/html/Elements/RT__Model__Group share/html/Search share/html/Ticket/Elements t/api t/ticket t/web

ruz at bestpractical.com ruz at bestpractical.com
Fri Mar 27 13:51:06 EDT 2009


Author: ruz
Date: Fri Mar 27 13:51:06 2009
New Revision: 18958

Modified:
   rt/3.999/trunk/lib/RT/Interface/Email.pm
   rt/3.999/trunk/lib/RT/Interface/Web.pm
   rt/3.999/trunk/lib/RT/Model/Attachment.pm
   rt/3.999/trunk/lib/RT/Model/CachedGroupMember.pm
   rt/3.999/trunk/lib/RT/Model/GroupMember.pm
   rt/3.999/trunk/lib/RT/Model/Ticket.pm
   rt/3.999/trunk/lib/RT/Model/Transaction.pm
   rt/3.999/trunk/lib/RT/ScripAction/CreateTickets.pm
   rt/3.999/trunk/lib/RT/ScripAction/Notify.pm
   rt/3.999/trunk/lib/RT/ScripAction/NotifyGroup.pm
   rt/3.999/trunk/lib/RT/ScripAction/SendEmail.pm
   rt/3.999/trunk/lib/RT/SharedSetting.pm
   rt/3.999/trunk/lib/RT/Shredder/CachedGroupMember.pm
   rt/3.999/trunk/lib/RT/Shredder/GroupMember.pm
   rt/3.999/trunk/lib/RT/Shredder/Transaction.pm
   rt/3.999/trunk/share/html/Elements/ColumnMap
   rt/3.999/trunk/share/html/Elements/RT__Model__Group/ColumnMap
   rt/3.999/trunk/share/html/REST/1.0/Forms/ticket/default
   rt/3.999/trunk/share/html/Search/Results.rdf
   rt/3.999/trunk/share/html/Ticket/Elements/ShowAttachments
   rt/3.999/trunk/share/html/Ticket/Elements/ShowTransaction
   rt/3.999/trunk/t/api/group.t
   rt/3.999/trunk/t/api/groups.t
   rt/3.999/trunk/t/api/queue.t
   rt/3.999/trunk/t/api/rights.t
   rt/3.999/trunk/t/api/ticket.t
   rt/3.999/trunk/t/api/user.t
   rt/3.999/trunk/t/ticket/add-watchers.t
   rt/3.999/trunk/t/ticket/search.t
   rt/3.999/trunk/t/web/dashboards-groups.t

Log:
* more on dropping sufixes in principal_id, creator_obj,
  member_obj and group_obj
* more work on replacable principal argument with any
  principal implementation


Modified: rt/3.999/trunk/lib/RT/Interface/Email.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Interface/Email.pm	(original)
+++ rt/3.999/trunk/lib/RT/Interface/Email.pm	Fri Mar 27 13:51:06 2009
@@ -383,7 +383,7 @@
             and my $prefix = RT->config->get('VERPPrefix')
             and my $domain = RT->config->get('VERPDomain') )
         {
-            my $from = $args{'transaction'}->creator_obj->email;
+            my $from = $args{'transaction'}->creator->email;
             $from =~ s/@/=/g;
             $from =~ s/\s//g;
             $args .= " -f $prefix$from\@$domain";

Modified: rt/3.999/trunk/lib/RT/Interface/Web.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Interface/Web.pm	(original)
+++ rt/3.999/trunk/lib/RT/Interface/Web.pm	Fri Mar 27 13:51:06 2009
@@ -1285,8 +1285,8 @@
                 next unless $value =~ /^(?:admin_cc|cc|requestor)$/i;
 
                 my ( $code, $msg ) = $Ticket->add_watcher(
-                    type         => $value,
-                    principal_id => $principal_id
+                    type      => $value,
+                    principal => $principal_id
                 );
                 push @results, $msg;
             }

Modified: rt/3.999/trunk/lib/RT/Model/Attachment.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Attachment.pm	(original)
+++ rt/3.999/trunk/lib/RT/Model/Attachment.pm	Fri Mar 27 13:51:06 2009
@@ -408,7 +408,7 @@
 
         $body =~ s/^/> /gm;
 
-        $body = '[' . $self->transaction->creator_obj->name() . ' - ' . $self->transaction->created . "]:\n\n" . $body . "\n\n";
+        $body = '[' . $self->transaction->creator->name() . ' - ' . $self->transaction->created . "]:\n\n" . $body . "\n\n";
 
     } else {
         $body = "[Non-text message not quoted]\n\n";
@@ -632,7 +632,7 @@
     my $txn = $self->transaction;
     return ( 0, _('Permission Denied') ) unless $txn->current_user_can_see;
     return ( 0, _('Permission Denied') )
-        unless $txn->ticket_obj->current_user_has_right('ModifyTicket');
+        unless $txn->ticket->current_user_has_right('ModifyTicket');
     return ( 0, _('GnuPG integration is disabled') )
         unless RT->config->get('GnuPG')->{'enable'};
     return ( 0, _('Attachments encryption is disabled') )
@@ -649,7 +649,7 @@
         $type = qq{x-application-rt\/gpg-encrypted; original-type="$type"};
     }
 
-    my $queue = $txn->ticket_obj->queue;
+    my $queue = $txn->ticket->queue;
     my $encrypt_for;
     foreach my $address ( grep $_, $queue->correspond_address, $queue->comment_address, RT->config->get('CorrespondAddress'), RT->config->get('CommentAddress'), ) {
         my %res = RT::Crypt::GnuPG::get_keys_info( $address, 'private' );
@@ -689,7 +689,7 @@
     my $txn = $self->transaction;
     return ( 0, _('Permission Denied') ) unless $txn->current_user_can_see;
     return ( 0, _('Permission Denied') )
-        unless $txn->ticket_obj->current_user_has_right('ModifyTicket');
+        unless $txn->ticket->current_user_has_right('ModifyTicket');
     return ( 0, _('GnuPG integration is disabled') )
         unless RT->config->get('GnuPG')->{'enable'};
 

Modified: rt/3.999/trunk/lib/RT/Model/CachedGroupMember.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/CachedGroupMember.pm	(original)
+++ rt/3.999/trunk/lib/RT/Model/CachedGroupMember.pm	Fri Mar 27 13:51:06 2009
@@ -120,6 +120,7 @@
         && $args{'member'}->id )
     {
         Jifty->log->debug("$self->create: bogus Member argument");
+        Carp::confess("boo");
     }
 
     unless ( $args{'group'}
@@ -127,6 +128,7 @@
         && $args{'group'}->id )
     {
         Jifty->log->debug("$self->create: bogus Group argument");
+        Carp::confess("boo");
     }
 
     unless ( $args{'immediate_parent'}

Modified: rt/3.999/trunk/lib/RT/Model/GroupMember.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/GroupMember.pm	(original)
+++ rt/3.999/trunk/lib/RT/Model/GroupMember.pm	Fri Mar 27 13:51:06 2009
@@ -89,6 +89,7 @@
 
 use Scalar::Util qw(blessed);
 
+
 =head2 create { Group => undef, Member => undef }
 
 Add a Principal to the group Group.
@@ -107,25 +108,30 @@
         @_
     );
 
-    unless ( $args{'group'}
-        && UNIVERSAL::isa( $args{'group'}, 'RT::Model::Principal' )
-        && $args{'group'}->id )
-    {
-        Carp::cluck();
-        Jifty->log->warn( "GroupMember::Create called with a bogus group arg: " . $args{'group'} );
-        return (undef);
-    }
-
-    unless ( $args{'group'}->is_group ) {
-        Jifty->log->warn("Someone tried to add a member to a user instead of a group");
-        return (undef);
+    foreach my $type (qw(group member)) {
+        if ( blessed $args{$type} ) {
+            unless ( $args{$type}->id ) {
+                Jifty->log->error( "GroupMember::Create called with a not loaded $type argument");
+                return (undef);
+            }
+            if ( $args{$type}->isa('RT::Model::Principal') ) {
+                $args{$type} = $args{$type}->object;
+            } elsif ( !$args{$type}->isa('RT::IsPrincipal') ) {
+                Jifty->log->warn( "GroupMember::Create called with a bogus $type arg: " . $args{$type} );
+                return (undef);
+            }
+        } else {
+            my $p = RT::Model::Principal->new( $self->current_user );
+            $p->load( $args{$type} );
+            unless ( $p->id ) {
+                $RT::Logger->error("Couldn't find principal '$args{$type}'");
+                return (undef);
+            }
+        }
     }
 
-    unless ( $args{'member'}
-        && UNIVERSAL::isa( $args{'member'}, 'RT::Model::Principal' )
-        && $args{'member'}->id )
-    {
-        Jifty->log->warn("GroupMember::Create called with a bogus Principal arg");
+    unless ( $args{'group'}->isa('RT::IsPrincipal::HasMembers') ) {
+        Jifty->log->warn("Someone tried to add a member to a principal that can not has members");
         return (undef);
     }
 
@@ -136,22 +142,20 @@
     my $inside_transaction = Jifty->handle->transaction_depth;
     Jifty->handle->begin_transaction() unless $inside_transaction;
 
+    if ( $args{'member'}->id == $args{'group'}->id ) {
+        Jifty->log->debug("Can't add a group to itself");
+        Jifty->handle->rollback() unless $inside_transaction;
+        return (undef);
+    }
+
     # We really need to make sure we don't add any members to this group
     # that contain the group itself. that would, um, suck.
     # (and recurse infinitely)  Later, we can add code to check this in the
     # cache and bail so we can support cycling directed graphs
-
-    if ( $args{'member'}->is_group ) {
-        my $member_object = $args{'member'}->object;
-        if ( $member_object->has_member( $args{'group'}, recursively => 1 ) ) {
-            Jifty->log->debug("Adding that group would create a loop");
-            Jifty->handle->rollback() unless $inside_transaction;
-            return (undef);
-        } elsif ( $args{'member'}->id == $args{'group'}->id ) {
-            Jifty->log->debug("Can't add a group to itself");
-            Jifty->handle->rollback() unless $inside_transaction;
-            return (undef);
-        }
+    if ( $args{'member'}->has_member( principal => $args{'group'}, recursively => 1 ) ) {
+        Jifty->log->debug("Adding that group would create a loop");
+        Jifty->handle->rollback() unless $inside_transaction;
+        return (undef);
     }
 
     my $id = $self->SUPER::create(
@@ -166,9 +170,9 @@
 
     my $cached_member = RT::Model::CachedGroupMember->new( current_user => $self->current_user );
     my $cached_id     = $cached_member->create(
-        member           => $args{'member'},
-        group            => $args{'group'},
-        immediate_parent => $args{'group'},
+        member           => $args{'member'}->principal,
+        group            => $args{'group'}->principal,
+        immediate_parent => $args{'group'}->principal,
         via              => '0'
     );
 
@@ -182,15 +186,11 @@
     $cgm->limit_to_groups_with_member( $args{'group'}->id );
 
     while ( my $parent_member = $cgm->next ) {
-        my $parent_id = $parent_member->member_id;
-        my $via       = $parent_member->id;
-        my $group_id  = $parent_member->group_id;
-
         my $other_cached_member = RT::Model::CachedGroupMember->new( current_user => $self->current_user );
         my $other_cached_id     = $other_cached_member->create(
-            member           => $args{'member'},
-            group            => $parent_member->group_obj,
-            immediate_parent => $parent_member->member_obj,
+            member           => $args{'member'}->principal,
+            group            => $parent_member->group,
+            immediate_parent => $parent_member->member,
             via              => $parent_member->id
         );
         unless ($other_cached_id) {

Modified: rt/3.999/trunk/lib/RT/Model/Ticket.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Ticket.pm	(original)
+++ rt/3.999/trunk/lib/RT/Model/Ticket.pm	Fri Mar 27 13:51:06 2009
@@ -79,6 +79,8 @@
 use RT::URI;
 use MIME::Entity;
 
+use Scalar::Util qw(blessed);
+
 sub table {'Tickets'}
 
 use Jifty::DBI::Schema;
@@ -597,7 +599,7 @@
     # We denormalize it into the Ticket table too because doing otherwise would
     # kill performance, bigtime. It gets kept in lockstep thanks to the magic of transactionalization
     ( $val, $msg ) = $owner_group->_add_member(
-        principal_id => $owner->principal_id,
+        principal => $owner,
     ) unless $defer_owner;
 
     # {{{ Deal with setting up watchers
@@ -615,7 +617,7 @@
 
             my ( $val, $msg ) = $self->$method(
                 type         => $type,
-                principal_id => $watcher,
+                principal => $watcher,
                 silent       => 1,
             );
             push @non_fatal_errors, _( "Couldn't set %1 watcher: %2", $type, $msg )
@@ -719,7 +721,7 @@
 
         }
         $owner_group->_add_member(
-            principal_id       => $owner->principal_id,
+            principal => $owner,
         );
     }
 
@@ -1131,7 +1133,7 @@
     $self->set_told
       unless $self->is_watcher(
               type         => 'requestor',
-              principal_id => $self->current_user->id,
+              principal => $self->current_user->id,
       );
 
     if ( $args{'dry_run'} ) {
@@ -1649,7 +1651,7 @@
                 my ( $val, $msg ) = $MergeInto->_add_watcher(
                     type         => $watcher_type,
                     silent       => 1,
-                    principal_id => $watcher->member_id
+                    principal => $watcher->member_id
                 );
                 Jifty->log->warn($msg) unless ($val);
             }
@@ -1838,7 +1840,7 @@
         return ( 0, _("Could not change owner. %1", $del_msg ));
     }
     my ( $add_id, $add_msg ) = $self->role_group("owner")->_add_member(
-        principal_id       => $new_owner_obj->principal_id,
+        principal => $new_owner_obj,
     );
     unless ($add_id) {
         Jifty->handle->rollback();
@@ -2333,10 +2335,10 @@
 sub current_user_can_modify_watchers {
     my $self = shift;
     my %args = (
-        action       => 'add',
-        type         => undef,
-        principal_id => undef,
-        email        => undef,
+        action    => 'add',
+        type      => undef,
+        principal => undef,
+        email     => undef,
         @_
     );
 
@@ -2344,9 +2346,9 @@
     return 1 if $self->current_user_has_right('ModifyTicket');
 
     # if it's a new user in the system then user must have ModifyTicket
-    return 0 unless $args{'principal_id'};
+    return 0 unless $args{'principal'};
     # If the watcher isn't the current user then the current user has no right
-    return 0 unless $self->current_user->id == $args{'principal_id'};
+    return 0 unless $self->current_user->id == (blessed $args{'principal'}? $args{'principal'}->id : $args{'principal'});
 
     #  If it's an admin_cc and they don't have 'WatchAsadmin_cc', bail
     if ( $args{'type'} eq 'admin_cc' ) {

Modified: rt/3.999/trunk/lib/RT/Model/Transaction.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Transaction.pm	(original)
+++ rt/3.999/trunk/lib/RT/Model/Transaction.pm	Fri Mar 27 13:51:06 2009
@@ -560,7 +560,7 @@
         }
 
         $content =~ s/^/> /gm;
-        $content = _( "On %1, %2 wrote:", $self->created, $self->creator_obj->name ) . "\n$content\n\n";
+        $content = _( "On %1, %2 wrote:", $self->created, $self->creator->name ) . "\n$content\n\n";
     }
 
     return ($content);
@@ -732,7 +732,7 @@
         return ( _("No transaction type specified") );
     }
 
-    return _( "%1 by %2", $self->brief_description, $self->creator_obj->name );
+    return _( "%1 by %2", $self->brief_description, $self->creator->name );
 }
 
 
@@ -1000,9 +1000,9 @@
 sub is_inbound {
     my $self = shift;
     $self->object_type eq 'RT::Model::Ticket' or return undef;
-    return $self->ticket_obj->is_watcher(
-        type         => 'requestor',
-        principal_id => $self->creator_obj->principal_id,
+    return $self->ticket->is_watcher(
+        type      => 'requestor',
+        principal => $self->creator,
     );
 }
 
@@ -1098,7 +1098,7 @@
 
 }
 
-sub ticket_obj {
+sub ticket {
     # XXX: too early for deprecation, a lot of usage
     #require Carp; Carp::confess("use object method instead and check type");
     my $self = shift;

Modified: rt/3.999/trunk/lib/RT/ScripAction/CreateTickets.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/ScripAction/CreateTickets.pm	(original)
+++ rt/3.999/trunk/lib/RT/ScripAction/CreateTickets.pm	Fri Mar 27 13:51:06 2009
@@ -130,7 +130,7 @@
     my $groups = RT::Model::GroupCollection->new(current_user => RT->system_user);
     $groups->limit_to_user_defined_groups();
     $groups->limit(column => "name", operator => "=", value => "$name");
-    $groups->with_member($transaction_obj->creator_obj->id);
+    $groups->with_member($transaction_obj->creator->id);
  
     my $groupid = $groups->first->id;
  

Modified: rt/3.999/trunk/lib/RT/ScripAction/Notify.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/ScripAction/Notify.pm	(original)
+++ rt/3.999/trunk/lib/RT/ScripAction/Notify.pm	Fri Mar 27 13:51:06 2009
@@ -155,7 +155,7 @@
 
     my $skip = '';
     unless ( RT->config->get('NotifyActor') ) {
-        if ( my $creator = $self->transaction->creator_obj->email ) {
+        if ( my $creator = $self->transaction->creator->email ) {
             $skip = lc $creator;
         }
     }

Modified: rt/3.999/trunk/lib/RT/ScripAction/NotifyGroup.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/ScripAction/NotifyGroup.pm	(original)
+++ rt/3.999/trunk/lib/RT/ScripAction/NotifyGroup.pm	Fri Mar 27 13:51:06 2009
@@ -90,7 +90,7 @@
         $self->_handle_argument($_);
     }
 
-    my $creator = $self->transaction->creator_obj->email();
+    my $creator = $self->transaction->creator->email();
     unless ($RT::NotifyActor) {
         @{ $self->{'To'} } = grep ( !/^\Q$creator\E$/, @{ $self->{'To'} } );
     }

Modified: rt/3.999/trunk/lib/RT/ScripAction/SendEmail.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/ScripAction/SendEmail.pm	(original)
+++ rt/3.999/trunk/lib/RT/ScripAction/SendEmail.pm	Fri Mar 27 13:51:06 2009
@@ -612,7 +612,7 @@
 
     # XXX, TODO: use /ShowUser/ShowUserEntry(or something like that) when it would be
     #            refactored into user's method.
-    if ( my $email = $self->transaction->creator_obj->email ) {
+    if ( my $email = $self->transaction->creator->email ) {
         $self->set_header( 'RT-Originator', $email );
     }
 
@@ -882,7 +882,7 @@
 
             unless ($friendly_name) {
                 $friendly_name =
-                  $self->transaction->creator_obj->friendly_name;
+                  $self->transaction->creator->friendly_name;
                 if ( $friendly_name =~ /^"(.*)"$/ ) {    # a quoted string
                     $friendly_name = $1;
                 }

Modified: rt/3.999/trunk/lib/RT/SharedSetting.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/SharedSetting.pm	(original)
+++ rt/3.999/trunk/lib/RT/SharedSetting.pm	Fri Mar 27 13:51:06 2009
@@ -382,7 +382,7 @@
 
             # then any principal that is a member of the setting's group can see
             # the setting
-            return $setting_group->has_member( $to_id, recursively => 1 );
+            return $setting_group->has_member( principal =>  $to_id, recursively => 1 );
         }
     }
 
@@ -431,7 +431,7 @@
     }
 
     if ( $obj_type eq 'RT::Model::Group'
-        && !$object->has_member(
+        && !$object->has_member( principal => 
             $self->current_user->principal, recursively => 1 ) )
     {
         Jifty->log->debug( "Permission denied, "

Modified: rt/3.999/trunk/lib/RT/Shredder/CachedGroupMember.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Shredder/CachedGroupMember.pm	(original)
+++ rt/3.999/trunk/lib/RT/Shredder/CachedGroupMember.pm	Fri Mar 27 13:51:06 2009
@@ -106,7 +106,7 @@
         $rec->{'description'} = "Have no related Principal #" . $self->member_id . " object.";
     }
 
-    $obj = $self->group_obj;
+    $obj = $self->group;
     if ( $obj && $obj->id ) {
         push( @$list, $obj );
     } else {

Modified: rt/3.999/trunk/lib/RT/Shredder/GroupMember.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Shredder/GroupMember.pm	(original)
+++ rt/3.999/trunk/lib/RT/Shredder/GroupMember.pm	Fri Mar 27 13:51:06 2009
@@ -82,7 +82,7 @@
         shredder       => $args{'shredder'}
     );
 
-    my $group = $self->group_obj->object;
+    my $group = $self->group->object;
 
     # XXX: If we delete member of the ticket owner role group then we should also
     # fix ticket object, but only if we don't plan to delete group itself!
@@ -115,7 +115,7 @@
 
             my $group_member = $args{'base_object'};
 
-            if ( $group_member->member_obj->id == RT->nobody->id ) {
+            if ( $group_member->member->id == RT->nobody->id ) {
                 RT::Shredder::Exception->throw("Couldn't delete Nobody from owners role group");
             }
 
@@ -153,7 +153,7 @@
     my $deps = $args{'dependencies'};
     my $list = [];
 
-    my $obj = $self->member_obj;
+    my $obj = $self->member;
     if ( $obj && $obj->id ) {
         push( @$list, $obj );
     } else {
@@ -163,7 +163,7 @@
         $rec->{'description'} = "Have no related Principal #" . $self->member_id . " object.";
     }
 
-    $obj = $self->group_obj;
+    $obj = $self->group;
     if ( $obj && $obj->id ) {
         push( @$list, $obj );
     } else {

Modified: rt/3.999/trunk/lib/RT/Shredder/Transaction.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Shredder/Transaction.pm	(original)
+++ rt/3.999/trunk/lib/RT/Shredder/Transaction.pm	Fri Mar 27 13:51:06 2009
@@ -89,7 +89,7 @@
     my $list = [];
 
     # Ticket
-    my $obj = $self->ticket_obj;
+    my $obj = $self->ticket;
     if ( $obj && defined $obj->id ) {
         push( @$list, $obj );
     } else {

Modified: rt/3.999/trunk/share/html/Elements/ColumnMap
==============================================================================
--- rt/3.999/trunk/share/html/Elements/ColumnMap	(original)
+++ rt/3.999/trunk/share/html/Elements/ColumnMap	Fri Mar 27 13:51:06 2009
@@ -75,7 +75,7 @@
     created_by => {
         attribute => 'CreatedBy',
         title => 'Created By', # loc
-        value     => sub  { return $_[0]->creator_obj->name }
+        value     => sub  { return $_[0]->creator->name }
     },
     last_updated => {
         attribute => 'last_updated',

Modified: rt/3.999/trunk/share/html/Elements/RT__Model__Group/ColumnMap
==============================================================================
--- rt/3.999/trunk/share/html/Elements/RT__Model__Group/ColumnMap	(original)
+++ rt/3.999/trunk/share/html/Elements/RT__Model__Group/ColumnMap	Fri Mar 27 13:51:06 2009
@@ -62,7 +62,7 @@
         value     => sub  {
             my $group = $_[0];
             my $uid   = $_[2] || return '';
-            return $group->has_member( $uid )? $_[0]->_('yes'): $_[0]->_('no');
+            return $group->has_member( principal =>  $uid )? $_[0]->_('yes'): $_[0]->_('no');
         },
     },
     has_member_recursively => {
@@ -70,7 +70,7 @@
         value     => sub  {
             my $group = $_[0];
             my $uid   = $_[2] || return '';
-            return $group->has_member( $uid, recursively => 1 )? $_[0]->_('yes'): $_[0]->_('no');
+            return $group->has_member( principal =>  $uid, recursively => 1 )? $_[0]->_('yes'): $_[0]->_('no');
         },
     },
     name => {

Modified: rt/3.999/trunk/share/html/REST/1.0/Forms/ticket/default
==============================================================================
--- rt/3.999/trunk/share/html/REST/1.0/Forms/ticket/default	(original)
+++ rt/3.999/trunk/share/html/REST/1.0/Forms/ticket/default	Fri Mar 27 13:51:06 2009
@@ -193,7 +193,7 @@
 	if (!%$fields || exists $fields->{lc 'Queue'});
     push @data, [ owner => $ticket->owner_obj->name ]
 	if (!%$fields || exists $fields->{lc 'Owner'});
-    push @data, [ creator => $ticket->creator_obj->name ]
+    push @data, [ creator => $ticket->creator->name ]
 	if (!%$fields || exists $fields->{lc 'Creator'});
 
     foreach (qw(subject status priority initial_priority final_priority)) {

Modified: rt/3.999/trunk/share/html/Search/Results.rdf
==============================================================================
--- rt/3.999/trunk/share/html/Search/Results.rdf	(original)
+++ rt/3.999/trunk/share/html/Search/Results.rdf	Fri Mar 27 13:51:06 2009
@@ -82,7 +82,7 @@
 
 
     while ( my $Ticket = $Tickets->next()) {
-        my $creator_str = $m->scomp('/Elements/ShowUser', user => $Ticket->creator_obj);
+        my $creator_str = $m->scomp('/Elements/ShowUser', user => $Ticket->creator);
         $creator_str =~ s/[\r\n]//g;
         $rss->add_item(
           title       =>  $Ticket->subject || _('No Subject'),

Modified: rt/3.999/trunk/share/html/Ticket/Elements/ShowAttachments
==============================================================================
--- rt/3.999/trunk/share/html/Ticket/Elements/ShowAttachments	(original)
+++ rt/3.999/trunk/share/html/Ticket/Elements/ShowAttachments	Fri Mar 27 13:51:06 2009
@@ -72,7 +72,7 @@
 
 <li><font size="-2">
 <a href="<%RT->config->get('WebPath')%>/Ticket/Attachment/<%$rev->transaction_id%>/<%$rev->id%>/<%$rev->filename | u%>">
-<&|/l, $rev->created, $size, $rev->creator_obj->name &>%1 (%2) by %3</&>
+<&|/l, $rev->created, $size, $rev->creator->name &>%1 (%2) by %3</&>
 </a>
 </font></li>
 % }

Modified: rt/3.999/trunk/share/html/Ticket/Elements/ShowTransaction
==============================================================================
--- rt/3.999/trunk/share/html/Ticket/Elements/ShowTransaction	(original)
+++ rt/3.999/trunk/share/html/Ticket/Elements/ShowTransaction	Fri Mar 27 13:51:06 2009
@@ -58,7 +58,7 @@
 % my $desc = $transaction->brief_description;
 % $m->callback( text => \$desc, transaction => $transaction, %ARGS, callback_name => 'ModifyDisplay' );
     <span class="description">
-      <% $transaction->creator_obj->name %> - <% $TicketString %> <% $desc %>
+      <% $transaction->creator->name %> - <% $TicketString %> <% $desc %>
     </span>
     <span class="time-taken"><% $time_taken %></span>
     <span class="actions<% $titlebar_commands ? '': ' hidden'%>"><% $titlebar_commands |n %></span>

Modified: rt/3.999/trunk/t/api/group.t
==============================================================================
--- rt/3.999/trunk/t/api/group.t	(original)
+++ rt/3.999/trunk/t/api/group.t	Fri Mar 27 13:51:06 2009
@@ -61,9 +61,9 @@
 
 # g3 now has 1, g2->{1, g1->{1,2,3}}
 
-is($group_3->has_member($principal_2), undef, "group 3 doesn't have member 2");
-ok($group_3->has_member($principal_2, recursively => 1), "group 3 has member 2 recursively");
-ok($ng->has_member($principal_2) , "group ".$ng->id." has member 2");
+is($group_3->has_member( principal => $principal_2), undef, "group 3 doesn't have member 2");
+ok($group_3->has_member( principal => $principal_2, recursively => 1), "group 3 has member 2 recursively");
+ok($ng->has_member( principal => $principal_2) , "group ".$ng->id." has member 2");
 my ($delid , $delmsg) =$ng->delete_member($principal_2->id);
 isnt ($delid ,0, "Sucessfully deleted it-".$delid."-".$delmsg);
 
@@ -77,11 +77,11 @@
 # Group 2 how has 1, g1->{1, 3}
 # g3 now has  1, g2->{1, g1->{1, 3}}
 
-ok(!$ng->has_member($principal_2)  , "group ".$ng->id." no longer has member 2");
-is($group_3->has_member($principal_2, recursively => 1), undef, "group 3 doesn't have member 2");
-is($group_2->has_member($principal_2, recursively => 1), undef, "group 2 doesn't have member 2");
-is($ng->has_member($principal_2), undef, "group 1 doesn't have member 2");;
-is($group_3->has_member($principal_2, recursively => 1), undef, "group 3 has member 2 recursively");
+ok(!$ng->has_member( principal => $principal_2)  , "group ".$ng->id." no longer has member 2");
+is($group_3->has_member( principal => $principal_2, recursively => 1), undef, "group 3 doesn't have member 2");
+is($group_2->has_member( principal => $principal_2, recursively => 1), undef, "group 2 doesn't have member 2");
+is($ng->has_member( principal => $principal_2), undef, "group 1 doesn't have member 2");;
+is($group_3->has_member( principal => $principal_2, recursively => 1), undef, "group 3 has member 2 recursively");
 
 # }}}
 

Modified: rt/3.999/trunk/t/api/groups.t
==============================================================================
--- rt/3.999/trunk/t/api/groups.t	(original)
+++ rt/3.999/trunk/t/api/groups.t	Fri Mar 27 13:51:06 2009
@@ -39,7 +39,7 @@
 
 my ($aid, $amsg) =$g->add_member($u->id);
 ok ($aid, $amsg);
-ok($g->has_member($u->principal),"G has member u");
+ok($g->has_member( principal => $u->principal),"G has member u");
 
 my $groups = RT::Model::GroupCollection->new(current_user => RT->system_user);
 $groups->limit_to_user_defined_groups();
@@ -70,7 +70,7 @@
 ($id, $msg) = $global_admin_cc->principal->grant_right(right =>'OwnTicket', object=> RT->system);
 ok ($id,$msg);
 ok (!$testuser->has_right(object => $q, right => 'OwnTicket') , "The test user does not have the right to own tickets in the test queue");
-($id, $msg) = $q->add_watcher(type => 'admin_cc', principal_id => $testuser->id);
+($id, $msg) = $q->add_watcher(type => 'admin_cc', principal => $testuser);
 ok($id,$msg);
 ok ($testuser->has_right(object => $q, right => 'OwnTicket') , "The test user does have the right to own tickets now. thank god.");
 

Modified: rt/3.999/trunk/t/api/queue.t
==============================================================================
--- rt/3.999/trunk/t/api/queue.t	(original)
+++ rt/3.999/trunk/t/api/queue.t	Fri Mar 27 13:51:06 2009
@@ -51,12 +51,12 @@
     $bob->load_by_email('bob at fsck.com');
     ok ($bob->id,  "Found the bob rt user");
 
-    ok ($Queue->is_watcher(type => 'cc', principal_id => $bob->principal_id),
+    ok ($Queue->is_watcher(type => 'cc', principal => $bob->principal_id),
         "The queue actually has bob at fsck.com as a requestor");
     ok ($Queue->is_watcher(type => 'cc', email => $bob->email),
         "The queue actually has bob at fsck.com as a requestor");
 
-    ok (!$Queue->is_watcher(type => 'admin_cc', principal_id => $bob->principal_id),
+    ok (!$Queue->is_watcher(type => 'admin_cc', principal=> $bob->principal_id),
         "bob is not an admin cc");
     ok (!$Queue->is_watcher(type => 'admin_cc', email => $bob->email),
         "bob is not an admin cc");
@@ -64,7 +64,7 @@
     ($status, $msg) = $Queue->delete_watcher(type =>'cc', email => 'bob at fsck.com');
     ok ($status, "Deleted bob from Ccs") or diag "error: $msg";
 
-    ok (!$Queue->is_watcher(type => 'cc', principal_id => $bob->principal_id),
+    ok (!$Queue->is_watcher(type => 'cc', principal => $bob->principal_id),
         "The queue no longer has bob at fsck.com as a requestor");
     ok (!$Queue->is_watcher(type => 'cc', email => $bob->email),
         "The queue no longer has bob at fsck.com as a requestor");

Modified: rt/3.999/trunk/t/api/rights.t
==============================================================================
--- rt/3.999/trunk/t/api/rights.t	(original)
+++ rt/3.999/trunk/t/api/rights.t	Fri Mar 27 13:51:06 2009
@@ -119,7 +119,7 @@
 ok( $ace_id, "Granted queue admin_cc role group with ModifyTicket right: $msg" );
 ok( $group->principal->has_right( right => 'ModifyTicket', object => $queue ), "role group can modify ticket" );
 ok( !$user->has_right( right => 'ModifyTicket', object => $ticket ), "user is not admin_cc and can't modify ticket" );
-($status, $msg) = $ticket->add_watcher(type => 'admin_cc', principal_id => $user->principal_id);
+($status, $msg) = $ticket->add_watcher(type => 'admin_cc', principal => $user);
 ok( $status, "successfuly added user as admin_cc");
 ok( $user->has_right( right => 'ModifyTicket', object => $ticket ), "user is admin_cc and can modify ticket" );
 

Modified: rt/3.999/trunk/t/api/ticket.t
==============================================================================
--- rt/3.999/trunk/t/api/ticket.t	(original)
+++ rt/3.999/trunk/t/api/ticket.t	Fri Mar 27 13:51:06 2009
@@ -112,15 +112,15 @@
 ok($jesse->id,  "Found the jesse rt user");
 
 
-ok ($ticket->is_watcher(type => 'requestor', principal_id => $jesse->principal_id), "The ticket actually has jesse at fsck.com as a requestor");
+ok ($ticket->is_watcher(type => 'requestor', principal => $jesse->principal_id), "The ticket actually has jesse at fsck.com as a requestor");
 ok (my ($add_id, $add_msg) = $ticket->add_watcher(type => 'requestor', email => 'bob at fsck.com'), "Added bob at fsck.com as a requestor");
 ok ($add_id, "Add succeeded: ($add_msg)");
 ok(my $bob = RT::Model::User->new(current_user => RT->system_user), "Creating a bob rt::user");
 $bob->load_by_email('bob at fsck.com');
 ok($bob->id,  "Found the bob rt user");
-ok ($ticket->is_watcher(type => 'requestor', principal_id => $bob->principal_id), "The ticket actually has bob at fsck.com as a requestor");;
+ok ($ticket->is_watcher(type => 'requestor', principal => $bob->principal_id), "The ticket actually has bob at fsck.com as a requestor");;
 ok ( ($add_id, $add_msg) = $ticket->delete_watcher(type =>'requestor', email => 'bob at fsck.com'), "Added bob at fsck.com as a requestor");
-ok (!$ticket->is_watcher(type => 'requestor', principal_id => $bob->principal_id), "The ticket no longer has bob at fsck.com as a requestor");;
+ok (!$ticket->is_watcher(type => 'requestor', principal => $bob->principal_id), "The ticket no longer has bob at fsck.com as a requestor");;
 
 
 $group = RT::Model::Group->new(current_user => RT->system_user);
@@ -134,7 +134,7 @@
 $group = RT::Model::Group->new(current_user => RT->system_user);
 ok($group->load_role(object => $ticket, type=> 'owner'));
 ok ($group->id, "Found the owner object for this ticket");
-ok($group->has_member(RT->nobody->user_object->principal), "the owner group has the member 'RT_System'");
+ok($group->has_member( principal => RT->nobody->user_object->principal), "the owner group has the member 'RT_System'");
 
 
 $t = RT::Model::Ticket->new(current_user => RT->system_user);

Modified: rt/3.999/trunk/t/api/user.t
==============================================================================
--- rt/3.999/trunk/t/api/user.t	(original)
+++ rt/3.999/trunk/t/api/user.t	Fri Mar 27 13:51:06 2009
@@ -221,13 +221,13 @@
 ok($qv, "Granted the right successfully - $qm");
 
 # Add the user as a queue admincc
-ok (my ($add_id, $add_msg) = $q_as_system->add_watcher(type => 'admin_cc', principal_id => $new_user->principal_id)  , "Added the new user as a queue admincc");
+ok (my ($add_id, $add_msg) = $q_as_system->add_watcher(type => 'admin_cc', principal => $new_user->principal_id)  , "Added the new user as a queue admincc");
 ok ($add_id, "the user is now a queue admincc - $add_msg");
 
 # Make sure the user does have the right to modify tickets in the queue
 ok ($new_user->has_right( object => $new_tick2, right => 'ModifyTicket'), "User can modify the ticket as an admincc");
 # Remove the user from the role  group
-ok (my ($del_id, $del_msg) = $q_as_system->delete_watcher(type => 'admin_cc', principal_id => $new_user->principal_id)  , "Deleted the new user as a queue admincc");
+ok (my ($del_id, $del_msg) = $q_as_system->delete_watcher(type => 'admin_cc', principal => $new_user->principal_id)  , "Deleted the new user as a queue admincc");
 
 # Make sure the user doesn't have the right to modify tickets in the queue
 ok (!$new_user->has_right( object => $new_tick2, right => 'ModifyTicket'), "User can't modify the ticket without group membership");
@@ -237,14 +237,14 @@
 # {{{ Test the user's right to modify a ticket as a _ticket_ admincc with the Right granted at the _queue_ level
 
 # Add the user as a ticket admincc
-ok (my( $uadd_id, $uadd_msg) = $new_tick2->add_watcher(type => 'admin_cc', principal_id => $new_user->principal_id)  , "Added the new user as a queue admincc");
+ok (my( $uadd_id, $uadd_msg) = $new_tick2->add_watcher(type => 'admin_cc', principal => $new_user->principal_id)  , "Added the new user as a queue admincc");
 ok ($add_id, "the user is now a queue admincc - $add_msg");
 
 # Make sure the user does have the right to modify tickets in the queue
 ok ($new_user->has_right( object => $new_tick2, right => 'ModifyTicket'), "User can modify the ticket as an admincc");
 
 # Remove the user from the role  group
-ok (( $del_id, $del_msg) = $new_tick2->delete_watcher(type => 'admin_cc', principal_id => $new_user->principal_id)  , "Deleted the new user as a queue admincc");
+ok (( $del_id, $del_msg) = $new_tick2->delete_watcher(type => 'admin_cc', principal => $new_user->principal_id)  , "Deleted the new user as a queue admincc");
 
 # Make sure the user doesn't have the right to modify tickets in the queue
 ok (!$new_user->has_right( object => $new_tick2, right => 'ModifyTicket'), "User can't modify the ticket without group membership");
@@ -273,14 +273,14 @@
 ok (!$new_user->has_right( object => $new_tick2->queue, right => 'ModifyTicket'), "User can not modify tickets in the queue without being an admincc");
 
 # Add the user as a queue admincc
-ok (($add_id, $add_msg) = $q_as_system->add_watcher(type => 'admin_cc', principal_id => $new_user->principal_id)  , "Added the new user as a queue admincc");
+ok (($add_id, $add_msg) = $q_as_system->add_watcher(type => 'admin_cc', principal => $new_user->principal_id)  , "Added the new user as a queue admincc");
 ok ($add_id, "the user is now a queue admincc - $add_msg");
 
 # Make sure the user does have the right to modify tickets in the queue
 ok ($new_user->has_right( object => $new_tick2, right => 'ModifyTicket'), "User can modify the ticket as an admincc");
 ok ($new_user->has_right( object => $new_tick2->queue, right => 'ModifyTicket'), "User can modify tickets in the queue as an admincc");
 # Remove the user from the role  group
-ok (($del_id, $del_msg) = $q_as_system->delete_watcher(type => 'admin_cc', principal_id => $new_user->principal_id)  , "Deleted the new user as a queue admincc");
+ok (($del_id, $del_msg) = $q_as_system->delete_watcher(type => 'admin_cc', principal => $new_user->principal_id)  , "Deleted the new user as a queue admincc");
 
 # Make sure the user doesn't have the right to modify tickets in the queue
 ok (!$new_user->has_right( object => $new_tick2, right => 'ModifyTicket'), "User can't modify the ticket without group membership");
@@ -295,7 +295,7 @@
 
 
 # Add the user as a ticket admincc
-ok ( ($uadd_id, $uadd_msg) = $new_tick2->add_watcher(type => 'admin_cc', principal_id => $new_user->principal_id)  , "Added the new user as a queue admincc");
+ok ( ($uadd_id, $uadd_msg) = $new_tick2->add_watcher(type => 'admin_cc', principal => $new_user->principal_id)  , "Added the new user as a queue admincc");
 ok ($add_id, "the user is now a queue admincc - $add_msg");
 
 # Make sure the user does have the right to modify tickets in the queue
@@ -303,7 +303,7 @@
 ok (!$new_user->has_right( object => $new_tick2->queue, right => 'ModifyTicket'), "User can not modify tickets in the queue obj being only a ticket admincc");
 
 # Remove the user from the role  group
-ok ( ($del_id, $del_msg) = $new_tick2->delete_watcher(type => 'admin_cc', principal_id => $new_user->principal_id)  , "Deleted the new user as a queue admincc");
+ok ( ($del_id, $del_msg) = $new_tick2->delete_watcher(type => 'admin_cc', principal => $new_user->principal_id)  , "Deleted the new user as a queue admincc");
 
 # Make sure the user doesn't have the right to modify tickets in the queue
 ok (!$new_user->has_right( object => $new_tick2, right => 'ModifyTicket'), "User can't modify the ticket without being an admincc");

Modified: rt/3.999/trunk/t/ticket/add-watchers.t
==============================================================================
--- rt/3.999/trunk/t/ticket/add-watchers.t	(original)
+++ rt/3.999/trunk/t/ticket/add-watchers.t	Fri Mar 27 13:51:06 2009
@@ -102,20 +102,20 @@
 ok( $ticket2->subject, "ticket load by user" );
 
 # user can add self to ticket only after getting Watch right
-($rv, $msg) = $ticket2->add_watcher( type => 'cc', principal_id => $user->principal_id );
+($rv, $msg) = $ticket2->add_watcher( type => 'cc', principal => $user );
 ok( !$rv, "user can't add self as Cc" );
-($rv, $msg) = $ticket2->add_watcher( type => 'requestor', principal_id => $user->principal_id );
+($rv, $msg) = $ticket2->add_watcher( type => 'requestor', principal => $user );
 ok( !$rv, "user can't add self as Requestor" );
 $principal->grant_right( right => 'Watch'  , object => $queue );
 ok(  $user->has_right( right => 'Watch',        object => $queue ), "user can watch queue tickets" );
-($rv, $msg) = $ticket2->add_watcher( type => 'cc', principal_id => $user->principal_id );
-ok(  $rv, "user can add self as Cc by principal_id" );
-($rv, $msg) = $ticket2->add_watcher( type => 'requestor', principal_id => $user->principal_id );
-ok(  $rv, "user can add self as Requestor by principal_id" );
+($rv, $msg) = $ticket2->add_watcher( type => 'cc', principal => $user );
+ok(  $rv, "user can add self as Cc by principal" );
+($rv, $msg) = $ticket2->add_watcher( type => 'requestor', principal => $user );
+ok(  $rv, "user can add self as Requestor by principal" );
 
 # remove user and try adding with Email address
-($rv, $msg) = $ticket->delete_watcher( type => 'cc',        principal_id => $user->principal_id );
-ok( $rv, "watcher removed by principal_id" );
+($rv, $msg) = $ticket->delete_watcher( type => 'cc',        principal => $user );
+ok( $rv, "watcher removed by principal" );
 ($rv, $msg) = $ticket->delete_watcher( type => 'requestor', email => $user->email );
 ok( $rv, "watcher removed by Email" );
 
@@ -145,20 +145,20 @@
 ok( $rv, "user loaded queue" );
 
 # user can add self to queue only after getting Watch right
-($rv, $msg) = $queue2->add_watcher( type => 'cc', principal_id => $user->principal_id );
+($rv, $msg) = $queue2->add_watcher( type => 'cc', principal => $user );
 ok( !$rv, "user can't add self as Cc" );
-($rv, $msg) = $queue2->add_watcher( type => 'requestor', principal_id => $user->principal_id );
+($rv, $msg) = $queue2->add_watcher( type => 'requestor', principal => $user );
 ok( !$rv, "user can't add self as Requestor" );
 $principal->grant_right( right => 'Watch'  , object => $queue );
 ok(  $user->has_right( right => 'Watch',        object => $queue ), "user can watch queue queues" );
-($rv, $msg) = $queue2->add_watcher( type => 'cc', principal_id => $user->principal_id );
-ok(  $rv, "user can add self as Cc by principal_id" );
-($rv, $msg) = $queue2->add_watcher( type => 'requestor', principal_id => $user->principal_id );
-ok(  $rv, "user can add self as Requestor by principal_id" );
+($rv, $msg) = $queue2->add_watcher( type => 'cc', principal => $user );
+ok(  $rv, "user can add self as Cc by principal" );
+($rv, $msg) = $queue2->add_watcher( type => 'requestor', principal => $user );
+ok(  $rv, "user can add self as Requestor by principal" );
 
 # remove user and try adding with Email address
-($rv, $msg) = $queue->delete_watcher( type => 'cc',        principal_id => $user->principal_id );
-ok( $rv, "watcher removed by principal_id" );
+($rv, $msg) = $queue->delete_watcher( type => 'cc', principal => $user );
+ok( $rv, "watcher removed by principal" );
 ($rv, $msg) = $queue->delete_watcher( type => 'requestor', email => $user->email );
 ok( $rv, "watcher removed by Email" );
 

Modified: rt/3.999/trunk/t/ticket/search.t
==============================================================================
--- rt/3.999/trunk/t/ticket/search.t	(original)
+++ rt/3.999/trunk/t/ticket/search.t	Fri Mar 27 13:51:06 2009
@@ -141,7 +141,7 @@
 my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue'");
 is($tix->count, 7, "found all the tickets")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 
 # very simple searches. both CF and normal
@@ -149,73 +149,73 @@
 $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue' AND CF.SearchTest = 'foo1'");
 is($tix->count, 1, "matched identical subject")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue' AND CF.SearchTest LIKE 'foo1'");
 is($tix->count, 1, "matched LIKE subject")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue' AND CF.SearchTest = 'foo'");
 is($tix->count, 0, "IS a regexp match")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue' AND CF.SearchTest LIKE 'foo'");
 is($tix->count, 5, "matched LIKE subject")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 
 $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue' AND CF.SearchTest IS NULL");
 is($tix->count, 2, "IS null CF")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue' AND Requestors LIKE 'search1'");
 is($tix->count, 1, "LIKE requestor")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue' AND Requestors = 'search1\@example.com'");
 is($tix->count, 1, "IS requestor")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue' AND Requestors LIKE 'search'");
 is($tix->count, 6, "LIKE requestor")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue' AND Requestors IS NULL");
 is($tix->count, 1, "Search for no requestor")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue' AND subject = 'SearchTest1'");
 is($tix->count, 1, "IS subject")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue' AND subject LIKE 'SearchTest1'");
 is($tix->count, 1, "LIKE subject")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue' AND subject = ''");
 is($tix->count, 1, "found one ticket")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue' AND subject LIKE 'SearchTest'");
 is($tix->count, 6, "found two ticket")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
 $tix->from_sql("Queue = '$queue' AND subject LIKE 'qwerty'");
 is($tix->count, 0, "found zero ticket")
-    or diag "wrong results from SQL:\n". $tix->build_selectcount_query;
+    or diag "wrong results from SQL:\n". $tix->build_select_count_query;
 
 
 

Modified: rt/3.999/trunk/t/web/dashboards-groups.t
==============================================================================
--- rt/3.999/trunk/t/web/dashboards-groups.t	(original)
+++ rt/3.999/trunk/t/web/dashboards-groups.t	Fri Mar 27 13:51:06 2009
@@ -44,15 +44,15 @@
 ($ok, $msg) = $inner_group->add_member($user_obj->principal_id);
 ok($ok, "added user as a member of inner $msg");
 
-ok($outer_group->has_member($inner_group->principal_id), "outer has inner");
-ok(!$outer_group->has_member($user_obj->principal_id), "outer doesn't have user directly");
-ok($outer_group->has_member($inner_group->principal_id, recursively => 1), "outer has inner recursively");
-ok($outer_group->has_member($user_obj->principal_id, recursively => 1), "outer has user recursively");
-
-ok(!$inner_group->has_member($outer_group->principal_id), "inner doesn't have outer");
-ok($inner_group->has_member($user_obj->principal_id), "inner has user");
-ok(!$inner_group->has_member($outer_group->principal_id, recursively => 1), "inner doesn't have outer, even recursively");
-ok($inner_group->has_member($user_obj->principal_id, recursively =>1), "inner has user recursively");
+ok($outer_group->has_member( principal => $inner_group->principal_id), "outer has inner");
+ok(!$outer_group->has_member( principal => $user_obj->principal_id), "outer doesn't have user directly");
+ok($outer_group->has_member( principal => $inner_group->principal_id, recursively => 1), "outer has inner recursively");
+ok($outer_group->has_member( principal => $user_obj->principal_id, recursively => 1), "outer has user recursively");
+
+ok(!$inner_group->has_member( principal => $outer_group->principal_id), "inner doesn't have outer");
+ok($inner_group->has_member( principal => $user_obj->principal_id), "inner has user");
+ok(!$inner_group->has_member( principal => $outer_group->principal_id, recursively => 1), "inner doesn't have outer, even recursively");
+ok($inner_group->has_member( principal => $user_obj->principal_id, recursively =>1), "inner has user recursively");
 # }}}
 
 ok $m->login(customer => 'customer'), "logged in";


More information about the Rt-commit mailing list