[freeside-commits] branch master updated. 199c1be96793535a390acac0c4116a2e111fa380

Mark Wells mark at 420.am
Tue Aug 27 02:52:46 PDT 2013


The branch, master has been updated
       via  199c1be96793535a390acac0c4116a2e111fa380 (commit)
      from  034089cb2e60fc44ca895984a3a20c66ff50ce77 (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 199c1be96793535a390acac0c4116a2e111fa380
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Aug 27 02:44:53 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