X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FSearch%2FUnrepliedTickets.pm;h=7870d424379589b2a2ef1c351bc3a5e272d436e6;hb=919943a3c5af718afa2eb47e9b4d9d3405f0bb73;hp=a99690156ff377e8d92250a8b1227ee45f1ccd9c;hpb=d22baa4e71bfa9e153c1fe1152ff4c748f1d935c;p=freeside.git diff --git a/rt/lib/RT/Search/UnrepliedTickets.pm b/rt/lib/RT/Search/UnrepliedTickets.pm index a99690156..7870d4243 100644 --- a/rt/lib/RT/Search/UnrepliedTickets.pm +++ b/rt/lib/RT/Search/UnrepliedTickets.pm @@ -6,9 +6,9 @@ =head1 DESCRIPTION -Find all unresolved tickets owned by the current user where the last correspondence -from a requestor (or ticket creation) is more recent than the last -correspondence from a non-requestor (if there is any). +Find all unresolved tickets owned by the current user where the last +correspondence from a requestor (or ticket creation) is more recent than the +last correspondence from a non-requestor (if there is any). =head1 METHODS @@ -30,14 +30,25 @@ sub Prepare { my $self = shift; my $TicketsObj = $self->TicketsObj; + # if SystemUser does this search (as in QueueSummaryByLifecycle), they + # should get all tickets regardless of ownership + if ($TicketsObj->CurrentUser->id != RT->SystemUser->id) { + $TicketsObj->Limit( + FIELD => 'Owner', + VALUE => $TicketsObj->CurrentUser->id + ); + } $TicketsObj->Limit( - FIELD => 'Owner', - VALUE => $TicketsObj->CurrentUser->id + FIELD => 'Status', + OPERATOR => '!=', + ENTRYAGGREGATOR => 'AND', + VALUE => 'resolved' ); $TicketsObj->Limit( FIELD => 'Status', OPERATOR => '!=', - VALUE => 'resolved' + ENTRYAGGREGATOR => 'AND', + VALUE => 'rejected', ); my $txn_alias = $TicketsObj->JoinTransactions; $TicketsObj->Limit(