+sub FilterWithoutTicketTransactions {
+ my $self = shift;
+ my %args = (
+ Shredder => undef,
+ Objects => undef,
+ @_,
+ );
+
+ return sub {
+ my $user = shift;
+ $self->_WithoutTicketTransactions( $user )
+ };
+}
+
+sub _WithoutTicketTransactions {
+ my ($self, $user) = @_;
+ return unless $user and $user->Id;
+ my $txns = RT::Transactions->new( RT->SystemUser );
+ $txns->Limit(FIELD => 'ObjectType', VALUE => 'RT::Ticket');
+ $txns->Limit(FIELD => 'Creator', VALUE => $user->Id);
+
+ # we could use the Count method which counts all records
+ # that match, but we really want to know only that
+ # at least one record exists, so this is faster
+ $txns->RowsPerPage(1);
+ return !$txns->First;
+}
+