X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FTicket.pm;h=ff75f450ddfbea130bf749ed287018fec62cbe42;hp=e7478ada42e889fc5659db240c786ce8bfdb8bf2;hb=7322f2afedcc2f427e997d1535a503613a83f088;hpb=ae14e320388fa5e7f400bff1c251ef885b7952e6 diff --git a/rt/lib/RT/Ticket.pm b/rt/lib/RT/Ticket.pm index e7478ada4..ff75f450d 100755 --- a/rt/lib/RT/Ticket.pm +++ b/rt/lib/RT/Ticket.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -316,6 +316,10 @@ sub Create { unless defined $args{'Priority'}; # Dates + + my $Now = RT::Date->new( $self->CurrentUser ); + $Now->SetToNow(); + #TODO we should see what sort of due date we're getting, rather + # than assuming it's in ISO format. @@ -325,7 +329,7 @@ sub Create { $Due->Set( Format => 'ISO', Value => $args{'Due'} ); } elsif ( my $due_in = $QueueObj->DefaultDueIn ) { - $Due->SetToNow; + $Due->Set( Format => 'ISO', Value => $Now->ISO ); $Due->AddDays( $due_in ); } @@ -346,7 +350,7 @@ sub Create { # If the status is not an initial status, set the started date elsif ( !$cycle->IsInitial($args{'Status'}) ) { - $Started->SetToNow; + $Started->Set( Format => 'ISO', Value => $Now->ISO ); } my $Resolved = RT::Date->new( $self->CurrentUser ); @@ -360,7 +364,7 @@ sub Create { $RT::Logger->debug( "Got a ". $args{'Status'} ."(inactive) ticket with undefined resolved date. Setting to now." ); - $Resolved->SetToNow; + $Resolved->Set( Format => 'ISO', Value => $Now->ISO ); } # Dealing with time fields @@ -390,6 +394,7 @@ sub Create { TimeEstimated => $args{'TimeEstimated'}, TimeLeft => $args{'TimeLeft'}, Type => $args{'Type'}, + Created => $Now->ISO, Starts => $Starts->ISO, Started => $Started->ISO, Resolved => $Resolved->ISO,