[freeside-commits] freeside/rt/lib/RT/Action SetWillResolve.pm, 1.1.2.2, 1.1.2.3
Mark Wells
mark at wavetail.420.am
Wed Sep 7 16:46:12 PDT 2011
Update of /home/cvs/cvsroot/freeside/rt/lib/RT/Action
In directory wavetail.420.am:/tmp/cvs-serv1952/rt/lib/RT/Action
Modified Files:
Tag: FREESIDE_2_3_BRANCH
SetWillResolve.pm
Log Message:
future ticket resolve fixes, #13583
Index: SetWillResolve.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/lib/RT/Action/SetWillResolve.pm,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -w -d -r1.1.2.2 -r1.1.2.3
--- SetWillResolve.pm 23 Aug 2011 21:46:34 -0000 1.1.2.2
+++ SetWillResolve.pm 7 Sep 2011 23:46:10 -0000 1.1.2.3
@@ -9,17 +9,25 @@
}
sub Prepare {
- return 1;
-}
-
-sub Commit {
my $self = shift;
my $DateObj = RT::Date->new( $self->CurrentUser );
+ if ( length($self->Argument) ) {
$DateObj->Set(
Format => 'unknown',
- Value => $self->Argument,
- );
- $self->TicketObj->SetWillResolve( $DateObj->ISO );
+ Value => $self->Argument
+ )
+ }
+ else { # special case: treat Argument => '' as "never"
+ $DateObj->Unix(-1);
+ }
+ $self->{new_value} = $DateObj->ISO;
+ # if the before and after values are string-equivalent, don't bother
+ return ($DateObj->AsString ne $self->TicketObj->WillResolveAsString);
+}
+
+sub Commit {
+ my $self = shift;
+ $self->TicketObj->SetWillResolve( $self->{new_value} );
}
RT::Base->_ImportOverlays();
More information about the freeside-commits
mailing list