[freeside-commits] branch FREESIDE_3_BRANCH updated. c3596ed941f619f6105aa56ba09da09f3fd631b4

Mark Wells mark at 420.am
Thu Aug 15 15:38:08 PDT 2013


The branch, FREESIDE_3_BRANCH has been updated
       via  c3596ed941f619f6105aa56ba09da09f3fd631b4 (commit)
      from  81fbbbd132ec70b81719399aa07d7a6f2606ba6f (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 c3596ed941f619f6105aa56ba09da09f3fd631b4
Author: Mark Wells <mark at freeside.biz>
Date:   Thu Aug 15 15:37:54 2013 -0700

    set default WillResolve dates on all tickets, #23309

diff --git a/FS/FS/TicketSystem.pm b/FS/FS/TicketSystem.pm
index c1c69fa..3aeadb3 100644
--- a/FS/FS/TicketSystem.pm
+++ b/FS/FS/TicketSystem.pm
@@ -342,6 +342,11 @@ sub _upgrade_data {
     or die $dbh->errstr;
   $cve_2013_3373_sth->execute or die $cve_2013_3373_sth->errstr;
 
+  # fix null WillResolve fields to avoid spurious transactions the 
+  # first time they get updated
+  my $fix_null_sql = "UPDATE Tickets SET WillResolve = '1970-01-01 00:00:00' WHERE WillResolve IS NULL";
+  $dbh->do($fix_null_sql) or die $dbh->errstr;
+
   return;
 }
 
diff --git a/rt/lib/RT/Ticket.pm b/rt/lib/RT/Ticket.pm
index 4da1d48..6165378 100755
--- a/rt/lib/RT/Ticket.pm
+++ b/rt/lib/RT/Ticket.pm
@@ -255,6 +255,7 @@ sub Create {
         Starts             => undef,
         Started            => undef,
         Resolved           => undef,
+        WillResolve        => undef,
         MIMEObj            => undef,
         _RecordTransaction => 1,
         DryRun             => 0,
@@ -357,6 +358,11 @@ sub Create {
         $Started->Set( Format => 'ISO', Value => $args{'Started'} );
     }
 
+    my $WillResolve = RT::Date->new($self->CurrentUser );
+    if ( defined $args{'WillResolve'} ) {
+        $WillResolve->Set( Format => 'ISO', Value => $args{'WillResolve'} );
+    }
+
     # If the status is not an initial status, set the started date
     elsif ( !$cycle->IsInitial($args{'Status'}) ) {
         $Started->SetToNow;
@@ -483,6 +489,7 @@ sub Create {
         Starts          => $Starts->ISO,
         Started         => $Started->ISO,
         Resolved        => $Resolved->ISO,
+        WillResolve     => $WillResolve->ISO,
         Due             => $Due->ISO
     );
 

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/TicketSystem.pm |    5 +++++
 rt/lib/RT/Ticket.pm   |    7 +++++++
 2 files changed, 12 insertions(+), 0 deletions(-)




More information about the freeside-commits mailing list