[Rt-commit] r14826 - in rt/branches/3.6-EXPERIMENTAL-PAGING: lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Tue Aug 5 19:49:44 EDT 2008


Author: ruz
Date: Tue Aug  5 19:49:43 2008
New Revision: 14826

Modified:
   rt/branches/3.6-EXPERIMENTAL-PAGING/   (props changed)
   rt/branches/3.6-EXPERIMENTAL-PAGING/lib/RT/Tickets_Overlay.pm

Log:
 r14819 at cubic-pc:  cubic | 2008-08-05 04:52:01 +0400
 * use new FilterRecord API


Modified: rt/branches/3.6-EXPERIMENTAL-PAGING/lib/RT/Tickets_Overlay.pm
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-PAGING/lib/RT/Tickets_Overlay.pm	(original)
+++ rt/branches/3.6-EXPERIMENTAL-PAGING/lib/RT/Tickets_Overlay.pm	Tue Aug  5 19:49:43 2008
@@ -2756,41 +2756,24 @@
 }
 
 # {{{ sub Next
+
 sub Next {
     my $self = shift;
 
     $self->_ProcessRestrictions() if ( $self->{'RecalcTicketLimits'} == 1 );
 
     my $Ticket = $self->SUPER::Next();
-    if ( ( defined($Ticket) ) and ( ref($Ticket) ) ) {
-
-        if ( $Ticket->__Value('Status') eq 'deleted'
-            && !$self->{'allow_deleted_search'} )
-        {
-            return ( $self->Next() );
-        }
+    # if there never was any ticket
+    return $Ticket unless $Ticket;
+    # filtered out
+    return $self->Next if $self->FilterRecord( $Ticket );
+    # fine
+    return $Ticket;
+}
 
-        # Since Ticket could be granted with more rights instead
-        # of being revoked, it's ok if queue rights allow
-        # ShowTicket.  It seems need another query, but we have
-        # rights cache in Principal::HasRight.
-        elsif ( $Ticket->CurrentUserHasRight('ShowTicket') )
-        {
-            return ($Ticket);
-        }
 
-        #If the user doesn't have the right to show this ticket
-        else {
-            return ( $self->Next() );
-        }
-    }
 
-    #if there never was any ticket
-    else {
-        return (undef);
-    }
 
-}
 
 # }}}
 


More information about the Rt-commit mailing list