diff options
author | Mark Wells <mark@freeside.biz> | 2013-08-27 02:44:53 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2013-08-27 02:44:53 -0700 |
commit | 199c1be96793535a390acac0c4116a2e111fa380 (patch) | |
tree | 15adb607a95056536fe3744c37ea1146a53824e7 /rt/lib | |
parent | 034089cb2e60fc44ca895984a3a20c66ff50ce77 (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() ) ) |