[Rt-commit] r4245 - in rtir/branches/1.9-EXPERIMENTAL: . lib/RT/Action

ruz at bestpractical.com ruz at bestpractical.com
Sun Dec 4 19:09:20 EST 2005


Author: ruz
Date: Sun Dec  4 19:09:20 2005
New Revision: 4245

Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)
   rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_SetDueToNow.pm
Log:
 r424 at cubic-pc:  cubic | 2005-12-05 03:09:10 +0300
  r403 at cubic-pc:  cubic | 2005-12-05 02:29:16 +0300
  * minor changes
 


Modified: rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_SetDueToNow.pm
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_SetDueToNow.pm	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_SetDueToNow.pm	Sun Dec  4 19:09:20 2005
@@ -46,9 +46,8 @@
 #
 package RT::Action::RTIR_SetDueToNow;
 
-
 use strict;
-
+use RT::IR;
 use base 'RT::Action::RTIR';
 
 =head2 Prepare
@@ -62,9 +61,9 @@
     my $self = shift;
 
     if ($self->TicketObj->Owner ne $self->TransactionObj->Creator) {
-	return 1;
+        return 1;
     } else {
-	return 0;
+        return 0;
     }
 }
 
@@ -79,22 +78,20 @@
 sub Commit {
     my $self = shift;
 
-    use RT::IR;
-
     # create a new SLA object
     my $SLAObj = RT::IR::SLAInit();
 
-    # set the Business::Hours
-    my $bh = RT::IR::BusinessHours();
-
     # Set the defaults from the RTIR_Config.pm file
     $SLAObj->SetInHoursDefault($RT::SLA_Response_InHours);
     $SLAObj->SetOutOfHoursDefault($RT::SLA_Response_OutOfHours);
 
+    # set the Business::Hours
+    my $bh = RT::IR::BusinessHours();
     $SLAObj->SetBusinessHours($bh);
 
     # get the due date
-    my $due = $SLAObj->Due(time(), $SLAObj->SLA(time()));
+    my $time = time;
+    my $due = $SLAObj->Due( $time, $SLAObj->SLA( $time ) );
 
     my $date = RT::Date->new($RT::SystemUser);
     $date->Set(Format => 'unix', Value => $due);


More information about the Rt-commit mailing list