[Rt-commit] rt branch, 4.0/forbid-linking-deleted-tickets, updated. rt-4.0.0-195-g492bf31
? sunnavy
sunnavy at bestpractical.com
Fri May 13 00:20:08 EDT 2011
The branch, 4.0/forbid-linking-deleted-tickets has been updated
via 492bf317e1cc690e1c87f9d0e1004834e154f233 (commit)
from 6c96238dee5765ed672ad39a63beb4d60a72e4c7 (commit)
Summary of changes:
lib/RT/Links.pm | 37 ++++++++-----------------------------
1 files changed, 8 insertions(+), 29 deletions(-)
- Log -----------------------------------------------------------------
commit 492bf317e1cc690e1c87f9d0e1004834e154f233
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri May 13 11:56:22 2011 +0800
hack AddRecord to make both ->Next and ->ItemsArrayRef work; Count needs Search still though
diff --git a/lib/RT/Links.pm b/lib/RT/Links.pm
index b9617de..37cf8c3 100644
--- a/lib/RT/Links.pm
+++ b/lib/RT/Links.pm
@@ -136,18 +136,6 @@ sub LimitReferredToBy {
$self->Limit(FIELD => 'Base', VALUE => $URI);
}
-
-
-sub Next {
- my $self = shift;
-
- my $Link = $self->SUPER::Next();
- return $Link unless $Link && ref $Link;
-
- return $Link if $self->IsValidLink( $Link );
- return $self->Next;
-}
-
# }}}
=head2 NewItem
@@ -161,28 +149,19 @@ sub NewItem {
return(RT::Link->new($self->CurrentUser));
}
-=head2 ItemsArrayRef
-
-Returns a reference to the set of all valid links found in this search.
-
-=cut
-
-sub ItemsArrayRef {
+sub AddRecord {
my $self = shift;
- return [ grep { $self->IsValidLink($_) } @{ $self->SUPER::ItemsArrayRef } ];
-}
-
-=head2 Count
+ my $record = shift;
+ return unless $self->IsValidLink($record);
-Returns number of all valid links found in this search.
-
-note: use RedoSearch to flush this instead of _DoCount
-
-=cut
+ push @{$self->{'items'}}, $record;
+ $self->{'rows'}++;
+}
sub Count {
my $self = shift;
- return scalar @{ $self->ItemsArrayRef };
+ $self->_DoSearch if $self->{'must_redo_search'};
+ return $self->_RecordCount;
}
=head2 IsValidLink
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list