projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
034089c
)
refuse to set future resolve dates in the past, #24729
author
Mark Wells
<mark@freeside.biz>
Tue, 27 Aug 2013 09:44:53 +0000
(
02:44
-0700)
committer
Mark Wells
<mark@freeside.biz>
Tue, 27 Aug 2013 09:44:53 +0000
(
02:44
-0700)
rt/lib/RT/Interface/Web_Vendor.pm
patch
|
blob
|
history
diff --git
a/rt/lib/RT/Interface/Web_Vendor.pm
b/rt/lib/RT/Interface/Web_Vendor.pm
index
0c061e2
..
3aad3fe
100644
(file)
--- 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);
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;
} 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' }
);
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() ) )
my $obj = $field . "Obj";
if ( ( defined $DateObj->Unix )
and ( $DateObj->Unix != $Ticket->$obj()->Unix() ) )