[Rt-commit] r5363 - in rtir/branches/1.9-EXPERIMENTAL: lib/RT/Action
ruz at bestpractical.com
ruz at bestpractical.com
Wed Jun 14 18:51:48 EDT 2006
Author: ruz
Date: Wed Jun 14 18:51:47 2006
New Revision: 5363
Modified:
rtir/branches/1.9-EXPERIMENTAL/ (props changed)
rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_SetIncidentResolution.pm
Log:
r1462 at cubic-pc: cubic | 2006-06-15 02:31:48 +0400
* drop resolution on re-open
Modified: rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_SetIncidentResolution.pm
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_SetIncidentResolution.pm (original)
+++ rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_SetIncidentResolution.pm Wed Jun 14 18:51:47 2006
@@ -21,17 +21,26 @@
my $self = shift;
my $t = $self->TicketObj;
+ my $cf = RT::CustomField->new( $self->TransactionObj->CurrentUser );
+ $cf->LoadByNameAndQueue( Queue => $t->QueueObj->Id, Name => '_RTIR_Resolution' );
+ return 1 unless $cf->Id;
my $status = $t->Status;
- return 1 unless $t->QueueObj->IsInactiveStatus( $t->Status );
+ if ( $t->QueueObj->IsActiveStatus( $status ) ) {
+ # on re-open, drop resolution
+ my $txn = $self->TransactionObj; my $type = $txn->Type;
+ return 1 unless $type eq "Status" || ( $type eq "Set" && $txn->Field eq "Status" );
+ return 1 unless $t->QueueObj->IsInactiveStatus( $txn->OldValue );
+ return 1 unless my $value = $t->FirstCustomFieldValue( $cf->id );
+ $t->DeleteCustomFieldValue( Field => $cf->id, Value => $value );
+ return 1;
+ }
+
+ return 1 unless $t->QueueObj->IsInactiveStatus( $status );
my $value = RT->Config->Get("_RTIR_Resolution_${status}_default");
return 1 unless $value;
- my $cf = RT::CustomField->new( $self->TransactionObj->CurrentUser );
- $cf->LoadByNameAndQueue( Queue => $t->QueueObj->Id, Name => '_RTIR_Resolution' );
- return 1 unless $cf->Id;
-
return 1 if $t->FirstCustomFieldValue( $cf->id );
my ($res, $msg) = $t->AddCustomFieldValue( Field => $cf->id, Value => $value );
More information about the Rt-commit
mailing list