[Rt-commit] r10344 - in rt/branches/3.999-DANGEROUS: .
etc/upgrade/3.7.19 lib/RT lib/RT/Model lib/RT/Report
lib/RT/Shredder/Plugin
jesse at bestpractical.com
jesse at bestpractical.com
Mon Jan 14 15:47:35 EST 2008
Author: jesse
Date: Mon Jan 14 15:47:34 2008
New Revision: 10344
Modified:
rt/branches/3.999-DANGEROUS/ (props changed)
rt/branches/3.999-DANGEROUS/etc/upgrade/3.7.19/content
rt/branches/3.999-DANGEROUS/lib/RT/Model/ACECollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/AttachmentCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomField.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomFieldCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/LinkCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/ObjectCustomFieldValueCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/QueueCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/TemplateCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/TransactionCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/UserCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Report/Tickets.pm
rt/branches/3.999-DANGEROUS/lib/RT/SavedSearches.pm
rt/branches/3.999-DANGEROUS/lib/RT/SearchBuilder.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Base/Search.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Tickets.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Users.pm
Log:
r74989 at pinglin: jesse | 2008-01-13 16:08:54 -0500
* kill unused "LimitToDeleted" routines
* limit_ToEnabled -> limit_to_enabled
* rationalize "next" subs
Modified: rt/branches/3.999-DANGEROUS/etc/upgrade/3.7.19/content
==============================================================================
--- rt/branches/3.999-DANGEROUS/etc/upgrade/3.7.19/content (original)
+++ rt/branches/3.999-DANGEROUS/etc/upgrade/3.7.19/content Mon Jan 14 15:47:34 2008
@@ -7,7 +7,7 @@
my $scrips = RT::Scrips->new( $RT::system_user );
$scrips->Limit( FIELD => 'Description', OPERATOR => 'IS', VALUE => 'NULL' );
$scrips->Limit( FIELD => 'Description', VALUE => '' );
- while ( my $scrip = $scrips->Next ) {
+ while ( my $scrip = $scrips->next ) {
my $desc = $scrip->Description;
next if defined $desc && length $desc;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/ACECollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/ACECollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/ACECollection.pm Mon Jan 14 15:47:34 2008
@@ -69,7 +69,7 @@
use base qw/RT::SearchBuilder/;
-=head2 Next
+=head2 next
Hand out the next ACE that was found
@@ -275,11 +275,11 @@
# }}}
-# {{{ sub Next
-sub Next {
+# {{{ sub next
+sub next {
my $self = shift;
- my $ACE = $self->SUPER::Next();
+ my $ACE = $self->SUPER::next();
if ( ( defined($ACE) ) and ( ref($ACE) ) ) {
if ( $self->current_user->has_right( Right => 'ShowACL',
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/AttachmentCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/AttachmentCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/AttachmentCollection.pm Mon Jan 14 15:47:34 2008
@@ -215,11 +215,11 @@
}
# }}}
-# {{{ sub Next
-sub Next {
+# {{{ sub next
+sub next {
my $self = shift;
- my $Attachment = $self->SUPER::Next;
+ my $Attachment = $self->SUPER::next;
return $Attachment unless $Attachment;
my $txn = $Attachment->TransactionObj;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomField.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomField.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomField.pm Mon Jan 14 15:47:34 2008
@@ -1099,7 +1099,7 @@
$values->limit_to_custom_field($self->id);
- $values->limit_ToEnabled();
+ $values->limit_to_enabled();
$values->limit_to_object($object);
return ($values);
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomFieldCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomFieldCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomFieldCollection.pm Mon Jan 14 15:47:34 2008
@@ -161,7 +161,7 @@
#unless we really want to find disabled rows, make sure we\'re only finding enabled ones.
unless($self->{'find_disabled_rows'}) {
- $self->limit_ToEnabled();
+ $self->limit_to_enabled();
}
return($self->SUPER::_do_search(@_));
@@ -170,19 +170,19 @@
# }}}
-# {{{ sub Next
+# {{{ sub next
-=head2 Next
+=head2 next
Returns the next custom field that this user can see.
=cut
-sub Next {
+sub next {
my $self = shift;
- my $CF = $self->SUPER::Next();
+ my $CF = $self->SUPER::next();
if ((defined($CF)) and (ref($CF))) {
if ($CF->current_user_has_right('SeeCustomField')) {
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupCollection.pm Mon Jan 14 15:47:34 2008
@@ -337,15 +337,15 @@
sub WithGroupRight { return (shift)->RT::Model::UserCollection::WhoHaveGroupRight( @_ ) }
sub WithRoleRight { return (shift)->RT::Model::UserCollection::WhoHaveRoleRight( @_ ) }
-# {{{ sub limit_ToEnabled
+# {{{ sub limit_to_enabled
-=head2 limit_ToEnabled
+=head2 limit_to_enabled
Only find items that haven\'t been disabled
=cut
-sub limit_ToEnabled {
+sub limit_to_enabled {
my $self = shift;
$self->limit( alias => $self->PrincipalsAlias,
@@ -356,34 +356,15 @@
}
# }}}
-# {{{ sub limit_Todisabled
-=head2 limit_ToDeleted
+# {{{ sub next
-Only find items that have been deleted.
-
-=cut
-
-sub limit_ToDeleted {
- my $self = shift;
-
- $self->{'find_disabled_rows'} = 1;
- $self->limit( alias => $self->PrincipalsAlias,
- column => 'disabled',
- operator => '=',
- value => 1,
- );
-}
-# }}}
-
-# {{{ sub Next
-
-sub Next {
+sub next {
my $self = shift;
# Don't show groups which the user isn't allowed to see.
- my $Group = $self->SUPER::Next();
+ my $Group = $self->SUPER::next();
if ((defined($Group)) and (ref($Group))) {
unless ($Group->current_user_has_right('SeeGroup')) {
return $self->next();
@@ -403,7 +384,7 @@
#unless we really want to find disabled rows, make sure we\'re only finding enabled ones.
unless($self->{'find_disabled_rows'}) {
- $self->limit_ToEnabled();
+ $self->limit_to_enabled();
}
return($self->SUPER::_do_search(@_));
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/LinkCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/LinkCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/LinkCollection.pm Mon Jan 14 15:47:34 2008
@@ -148,10 +148,10 @@
# {{{ Next
-sub Next {
+sub next {
my $self = shift;
- my $Link = $self->SUPER::Next();
+ my $Link = $self->SUPER::next();
return $Link unless $Link && ref $Link;
# Skip links to local objects thast are deleted
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/ObjectCustomFieldValueCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/ObjectCustomFieldValueCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/ObjectCustomFieldValueCollection.pm Mon Jan 14 15:47:34 2008
@@ -122,7 +122,7 @@
# unless we really want to find disabled rows,
# make sure we\'re only finding enabled ones.
unless ( $self->{'find_expired_rows'} ) {
- $self->limit_ToEnabled();
+ $self->limit_to_enabled();
}
return $self->SUPER::_do_search(@_);
@@ -134,7 +134,7 @@
# unless we really want to find disabled rows,
# make sure we\'re only finding enabled ones.
unless ( $self->{'find_expired_rows'} ) {
- $self->limit_ToEnabled();
+ $self->limit_to_enabled();
}
return $self->SUPER::_do_count(@_);
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/QueueCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/QueueCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/QueueCollection.pm Mon Jan 14 15:47:34 2008
@@ -97,7 +97,7 @@
#unless we really want to find disabled rows, make sure we\'re only finding enabled ones.
unless($self->{'find_disabled_rows'}) {
- $self->limit_ToEnabled();
+ $self->limit_to_enabled();
}
return($self->SUPER::_do_search(@_));
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/TemplateCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/TemplateCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/TemplateCollection.pm Mon Jan 14 15:47:34 2008
@@ -158,19 +158,19 @@
}
# }}}
-# {{{ sub Next
+# {{{ sub next
-=head2 Next
+=head2 next
Returns the next template that this user can see.
=cut
-sub Next {
+sub next {
my $self = shift;
- my $templ = $self->SUPER::Next();
+ my $templ = $self->SUPER::next();
if ((defined($templ)) and (ref($templ))) {
# If it's part of a queue, and the user can read templates in
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/TransactionCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/TransactionCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/TransactionCollection.pm Mon Jan 14 15:47:34 2008
@@ -126,11 +126,11 @@
}
-# {{{ sub Next
-sub Next {
+# {{{ sub next
+sub next {
my $self = shift;
- my $Transaction = $self->SUPER::Next();
+ my $Transaction = $self->SUPER::next();
if ((defined($Transaction)) and (ref($Transaction))) {
# If the user can see the transaction's type, then they can
# see the transaction and we should hand it back.
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/UserCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/UserCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/UserCollection.pm Mon Jan 14 15:47:34 2008
@@ -123,23 +123,23 @@
#unless we really want to find disabled rows, make sure we\'re only finding enabled ones.
unless ( $self->{'find_disabled_rows'} ) {
- $self->limit_ToEnabled();
+ $self->limit_to_enabled();
}
return ( $self->SUPER::_do_search(@_) );
}
# }}}
-# {{{ sub limit_ToEnabled
+# {{{ sub limit_to_enabled
-=head2 limit_ToEnabled
+=head2 limit_to_enabled
Only find items that haven\'t been disabled
=cut
# XXX: should be generalized
-sub limit_ToEnabled {
+sub limit_to_enabled {
my $self = shift;
$self->limit( alias => $self->PrincipalsAlias,
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 Jan 14 15:47:34 2008
@@ -212,9 +212,9 @@
# Gotta skip over RT::Model::TicketCollection->next, since it does all sorts of crazy magic we
# don't want.
-sub Next {
+sub next {
my $self = shift;
- $self->RT::SearchBuilder::Next(@_);
+ $self->RT::SearchBuilder::next(@_);
}
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 Jan 14 15:47:34 2008
@@ -116,7 +116,7 @@
### Accessor methods
-=head2 Next
+=head2 next
Returns the next object in the collection.
Modified: rt/branches/3.999-DANGEROUS/lib/RT/SearchBuilder.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/SearchBuilder.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/SearchBuilder.pm Mon Jan 14 15:47:34 2008
@@ -74,13 +74,13 @@
return Jifty->handle
}
-=head2 limit_ToEnabled
+=head2 limit_to_enabled
Only find items that haven't been disabled
=cut
-sub limit_ToEnabled {
+sub limit_to_enabled {
my $self = shift;
$self->limit( column => 'disabled',
@@ -88,22 +88,6 @@
operator => '=' );
}
-=head2 limit_ToDeleted
-
-Only find items that have been deleted.
-
-=cut
-
-sub limit_ToDeleted {
- my $self = shift;
-
- $self->{'find_disabled_rows'} = 1;
- $self->limit( column => 'disabled',
- operator => '=',
- value => '1'
- );
-}
-
=head2 limit_Attribute PARAMHASH
Takes name, operator and value to find records that has the
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Base/Search.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Base/Search.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Base/Search.pm Mon Jan 14 15:47:34 2008
@@ -101,7 +101,7 @@
sub set_Resolvers { return 1 }
-=head2 FetchNext $collection [, $init]
+=head2 fetch_next $collection [, $init]
Returns next object in collection as method L<RT::SearchBuilder/Next>, but
doesn't stop on page boundaries.
@@ -115,15 +115,15 @@
Example:
- $plugin->FetchNext( $tickets, 'init' );
- while( my $ticket = $plugin->FetchNext( $tickets ) ) {
+ $plugin->fetch_next( $tickets, 'init' );
+ while( my $ticket = $plugin->fetch_next( $tickets ) ) {
...
}
=cut
use constant PAGE_SIZE => 100;
-sub FetchNext {
+sub fetch_next {
my ($self, $objs, $init) = @_;
if ( $init ) {
$objs->set_page_info(per_page => PAGE_SIZE, current_page => 1);
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Tickets.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Tickets.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Tickets.pm Mon Jan 14 15:47:34 2008
@@ -117,8 +117,8 @@
}
my (@top, @linked, %seen);
- $self->FetchNext($objs, 1);
- while ( my $obj = $self->FetchNext( $objs ) ) {
+ $self->fetch_next($objs, 1);
+ while ( my $obj = $self->fetch_next( $objs ) ) {
next if $seen{ $obj->id }++;
push @linked, $self->GetLinked( Object => $obj, Seen => \%seen );
push @top, $obj;
@@ -140,8 +140,8 @@
my $objs = RT::Model::TicketCollection->new(current_user => RT->system_user );
$objs->{'allow_deleted_search'} = 1;
$objs->from_sql( $query );
- $self->FetchNext( $objs, 1 );
- while ( my $linked_obj = $self->FetchNext( $objs ) ) {
+ $self->fetch_next( $objs, 1 );
+ while ( my $linked_obj = $self->fetch_next( $objs ) ) {
next if $arg{'Seen'}->{ $linked_obj->id }++;
push @res, $self->GetLinked( %arg, Object => $linked_obj );
push @res, $linked_obj;
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 Jan 14 15:47:34 2008
@@ -148,7 +148,7 @@
value => '0',
);
} else {
- $objs->limit_ToEnabled;
+ $objs->limit_to_enabled;
}
}
if( $self->{'opt'}{'email'} ) {
@@ -205,10 +205,10 @@
@_,
);
my $users = $args{Objects};
- $self->FetchNext( $users, 'init' );
+ $self->fetch_next( $users, 'init' );
my @res;
- while ( my $user = $self->FetchNext( $users ) ) {
+ while ( my $user = $self->fetch_next( $users ) ) {
push @res, $user if $self->_WithoutTickets( $user );
return (1, \@res) if $self->{'opt'}{'limit'} && @res >= $self->{'opt'}{'limit'};
}
More information about the Rt-commit
mailing list