[freeside-commits] branch FREESIDE_3_BRANCH updated. 2bc824c74bc16dc4cf22a4b9b296249e94c9be74
Mark Wells
mark at 420.am
Tue Aug 27 02:52:36 PDT 2013
The branch, FREESIDE_3_BRANCH has been updated
via 2bc824c74bc16dc4cf22a4b9b296249e94c9be74 (commit)
from 2e3fbe5f06250cd034308ec12c77fc68b0a79f96 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2bc824c74bc16dc4cf22a4b9b296249e94c9be74
Author: Mark Wells <mark at freeside.biz>
Date: Tue Aug 27 02:43:38 2013 -0700
refuse to set future resolve dates in the past, #24729
diff --git a/rt/lib/RT/Interface/Web_Vendor.pm b/rt/lib/RT/Interface/Web_Vendor.pm
index 0c061e2..3aad3fe 100644
--- a/rt/lib/RT/Interface/Web_Vendor.pm
+++ b/rt/lib/RT/Interface/Web_Vendor.pm
@@ -264,7 +264,12 @@ sub ProcessTicketBasics {
my $DateObj = RT::Date->new($session{'CurrentUser'});
if ( $to_date ) {
$DateObj->Set(Format => 'unknown', Value => $to_date);
- $ARGSRef->{'WillResolve'} = $DateObj->ISO;
+ if ( $DateObj->Unix > time ) {
+ $ARGSRef->{'WillResolve'} = $DateObj->ISO;
+ } else {
+ warn "Ticket ".$TicketObj->Id.": WillResolve date '$to_date' not accepted.\n";
+ # and then don't set it in ARGSRef
+ }
} elsif ( $TicketObj and $TicketObj->WillResolveObj->Unix > 0 ) {
$DateObj->Set(Value => 0);
$ARGSRef->{'WillResolve'} = $DateObj->ISO;
@@ -343,6 +348,13 @@ sub ProcessTicketDates {
Value => $ARGSRef->{ $field . '_Date' }
);
+ if ( $field eq 'WillResolve'
+ and $DateObj->Unix > 0
+ and $DateObj->Unix <= time ) {
+ push @results, "Can't set WillResolve date in the past.";
+ next;
+ }
+
my $obj = $field . "Obj";
if ( ( defined $DateObj->Unix )
and ( $DateObj->Unix != $Ticket->$obj()->Unix() ) )
-----------------------------------------------------------------------
Summary of changes:
rt/lib/RT/Interface/Web_Vendor.pm | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
More information about the freeside-commits
mailing list