[Rt-commit] rt branch, update-action, updated. 34b79c37a3d1c439d75299e03294030eef8cce4d

sartak at bestpractical.com sartak at bestpractical.com
Wed Dec 9 07:48:33 EST 2009


The branch, update-action has been updated
       via  34b79c37a3d1c439d75299e03294030eef8cce4d (commit)
      from  8138576516900396175dc008cf304dd1630dcd82 (commit)

Summary of changes:
 lib/RT/Action/TicketAction.pm |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 34b79c37a3d1c439d75299e03294030eef8cce4d
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Dec 9 07:48:17 2009 -0500

    _canonicalize_duration in TicketAction

diff --git a/lib/RT/Action/TicketAction.pm b/lib/RT/Action/TicketAction.pm
index 3e0f7a0..9c580ad 100644
--- a/lib/RT/Action/TicketAction.pm
+++ b/lib/RT/Action/TicketAction.pm
@@ -6,6 +6,8 @@ use base 'RT::Action::QueueBased', 'RT::Action::WithCustomFields';
 use constant record_class => 'RT::Model::Ticket';
 use constant report_detailed_messages => 1;
 
+use Time::Duration::Parse;
+
 # We can't use SUPER here because TicketAction does not inherit from
 # Jifty::Action::Record, and SUPER is statically determined. Maybe time to
 # switch to roles.
@@ -162,6 +164,17 @@ sub _add_parameter_type {
     };
 }
 
+sub _canonicalize_duration {
+    my $self  = shift;
+    my $value = shift;
+
+    if (defined $value) {
+        $value = parse_duration($value);
+    }
+
+    return $value;
+}
+
 __PACKAGE__->_add_parameter_type(
     name => 'ticket_custom_field',
 );

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


More information about the Rt-commit mailing list