[Rt-commit] r4238 - in rtir/branches/1.9-EXPERIMENTAL: .
lib/RT/Action
ruz at bestpractical.com
ruz at bestpractical.com
Sun Dec 4 19:07:37 EST 2005
Author: ruz
Date: Sun Dec 4 19:07:37 2005
New Revision: 4238
Modified:
rtir/branches/1.9-EXPERIMENTAL/ (props changed)
rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_ResolveChildren.pm
Log:
r417 at cubic-pc: cubic | 2005-12-05 03:09:08 +0300
r396 at cubic-pc: cubic | 2005-12-04 13:18:33 +0300
* resolve only active tickets
Modified: rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_ResolveChildren.pm
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_ResolveChildren.pm (original)
+++ rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_ResolveChildren.pm Sun Dec 4 19:07:37 2005
@@ -58,12 +58,12 @@
sub Prepare {
my $self = shift;
- if ($self->TransactionObj->NewValue eq 'resolved' or
- $self->TransactionObj->NewValue eq 'rejected') {
- return 1;
- } else {
- return 0;
+ unless ( $self->TransactionObj->NewValue eq 'resolved' ||
+ $self->TransactionObj->NewValue eq 'rejected' )
+ {
+ return 0;
}
+ return 1;
}
# {{{ sub Commit
@@ -77,13 +77,19 @@
sub Commit {
my $self = shift;
- my $query = "(Queue = 'Incident Reports' OR Queue = 'Investigations' OR Queue = 'Blocks') AND MemberOf = " . $self->TicketObj->Id;
-
- my $members = new RT::Tickets($self->TransactionObj->CurrentUser);
- $members->FromSQL($query);
-
- while (my $member = $members->Next) {
- $member->Resolve();
+ my $query = "(Queue = 'Incident Reports'"
+ ." OR Queue = 'Investigations'"
+ ." OR Queue = 'Blocks'"
+ .") AND MemberOf = " . $self->TicketObj->Id
+ ."AND (".
+ . join " AND ", map "Status != '$_'", @RT::InactiveStatus;
+ .")";
+
+ my $members = new RT::Tickets( $self->TransactionObj->CurrentUser );
+ $members->FromSQL( $query );
+ while ( my $member = $members->Next ) {
+ my ($res, $msg) = $member->Resolve;
+ $RT::Logger->info( "Couldn't resolve ticket: $msg" ) unless $res;
}
return 1;
}
More information about the Rt-commit
mailing list