[Rt-commit] rt branch, 3.999-trunk, updated. c105ecae8e339ae15ba7ea9921edaefe89702929

sartak at bestpractical.com sartak at bestpractical.com
Tue Dec 1 06:13:43 EST 2009


The branch, 3.999-trunk has been updated
       via  c105ecae8e339ae15ba7ea9921edaefe89702929 (commit)
      from  691b8754a28d8f6c38e930b16dcbbb67d72c9b83 (commit)

Summary of changes:
 lib/RT/Model/Ticket.pm |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

- Log -----------------------------------------------------------------
commit c105ecae8e339ae15ba7ea9921edaefe89702929
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Dec 1 06:13:33 2009 -0500

    Move "starts" canonicalization into a method

diff --git a/lib/RT/Model/Ticket.pm b/lib/RT/Model/Ticket.pm
index 9b67dbe..a3fbea5 100755
--- a/lib/RT/Model/Ticket.pm
+++ b/lib/RT/Model/Ticket.pm
@@ -474,13 +474,6 @@ sub create {
 # }}}
 
     # {{{ Dates
-    my $starts;
-    if ( defined $args{'starts'} ) {
-        $starts = RT::DateTime->new_from_string($args{'starts'});
-    } else {
-        $starts = RT::DateTime->new_unset;
-    }
-
     my $started;
     if ( defined $args{'started'} ) {
         $started = RT::DateTime->new_from_string($args{'started'});
@@ -604,7 +597,7 @@ sub create {
         time_estimated   => $args{'time_estimated'},
         time_left        => $args{'time_left'},
         type             => $args{'type'},
-        starts           => $starts,
+        starts           => $args{'starts'},
         started          => $started,
         resolved         => $resolved,
         told             => $told,
@@ -875,6 +868,24 @@ sub canonicalize_due {
     return RT::DateTime->new_unset;
 }
 
+=head2 canonicalize_starts
+
+Try to parse the starts date as a string.
+
+=cut
+
+sub canonicalize_starts {
+    my $self   = shift;
+    my $starts = shift;
+
+    if (defined $starts) {
+        return RT::DateTime->new_from_string($starts);
+    }
+
+    return RT::DateTime->new_unset;
+
+}
+
 
 sub roles { return ( "cc", "admin_cc", "requestor" ); }
 

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


More information about the Rt-commit mailing list