diff options
author | Mark Wells <mark@freeside.biz> | 2013-08-27 02:43:38 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2013-08-27 02:43:38 -0700 |
commit | 2bc824c74bc16dc4cf22a4b9b296249e94c9be74 (patch) | |
tree | 58ed92d9eb4d2406bd098eff184bd399c0433b4d /rt/lib | |
parent | 2e3fbe5f06250cd034308ec12c77fc68b0a79f96 (diff) |
refuse to set future resolve dates in the past, #24729
Diffstat (limited to 'rt/lib')
-rw-r--r-- | rt/lib/RT/Interface/Web_Vendor.pm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/rt/lib/RT/Interface/Web_Vendor.pm b/rt/lib/RT/Interface/Web_Vendor.pm index 0c061e2de..3aad3fee2 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() ) ) |