[Rt-commit] r7116 - in rt/branches/3.7-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Fri Mar 2 14:34:30 EST 2007
Author: ruz
Date: Fri Mar 2 14:34:29 2007
New Revision: 7116
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm
Log:
r4592 at cubic-pc: cubic | 2007-02-17 00:09:19 +0300
* add SeenUpTo method to RT::Ticket
Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm (original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm Fri Mar 2 14:34:29 2007
@@ -3391,6 +3391,31 @@
Value => $now->ISO ) );
}
+=head2 SeenUpTo
+
+
+=cut
+
+sub SeenUpTo {
+ my $self = shift;
+
+ my $uid = $self->CurrentUser->id;
+ my $attr = $self->FirstAttribute( "User-". $uid ."-SeenUpTo" );
+ return if $attr && $attr->Content gt $self->LastUpdated;
+
+ my $txns = $self->Transactions;
+ $txns->Limit( FIELD => 'Type', VALUE => 'Comment' );
+ $txns->Limit( FIELD => 'Type', VALUE => 'Correspond' );
+ $txns->Limit( FIELD => 'Creator', OPERATOR => '!=', VALUE => $uid );
+ $txns->Limit(
+ FIELD => 'Created',
+ OPERATOR => '>',
+ VALUE => $attr->Content
+ ) if $attr;
+ $txns->RowsPerPage(1);
+ return $txns->First;
+}
+
# }}}
=head2 TransactionBatch
More information about the Rt-commit
mailing list