[Rt-commit] r4237 - in rtir/branches/1.9-EXPERIMENTAL: .
lib/RT/Action
ruz at bestpractical.com
ruz at bestpractical.com
Sun Dec 4 19:07:24 EST 2005
Author: ruz
Date: Sun Dec 4 19:07:24 2005
New Revision: 4237
Modified:
rtir/branches/1.9-EXPERIMENTAL/ (props changed)
rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_OpenParent.pm
Log:
r416 at cubic-pc: cubic | 2005-12-05 03:09:08 +0300
r395 at cubic-pc: cubic | 2005-12-04 13:05:43 +0300
* move condition into SQL
* log errors
Modified: rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_OpenParent.pm
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_OpenParent.pm (original)
+++ rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_OpenParent.pm Sun Dec 4 19:07:24 2005
@@ -75,17 +75,18 @@
# If the child becomes not-closed, make sure the Incident is re-opened
if ($self->TransactionObj->NewValue ne 'rejected' &&
- $self->TransactionObj->NewValue ne 'resolved') {
- my $query = "Queue = 'Incidents' AND HasMember = " . $self->TicketObj->Id;
+ $self->TransactionObj->NewValue ne 'resolved')
+ {
+ my $query = "Queue = 'Incidents'"
+ ." AND HasMember = " . $self->TicketObj->Id
+ ." AND (Status = 'rejected' OR Status = 'resolved')";
- my $parents = new RT::Tickets($self->TransactionObj->CurrentUser);
- $parents->FromSQL($query);
- while (my $member = $parents->Next) {
- if ($member->Status eq 'rejected' ||
- $member->Status eq 'resolved') {
- $member->Open();
- }
- }
+ my $parents = new RT::Tickets($self->TransactionObj->CurrentUser);
+ $parents->FromSQL($query);
+ while (my $member = $parents->Next) {
+ my ($res, $msg) = $member->Open;
+ $RT::Logger->info("Couldn't open ticket: $msg") unless $res;
+ }
}
return 1;
}
More information about the Rt-commit
mailing list