[Rt-commit] [svn] r1573 - in rtir/branches/1.1-TESTING: . etc etc/upgrade/1.1.3 lib/RT/Action

leira at pallas.eruditorum.org leira at pallas.eruditorum.org
Mon Sep 27 23:53:56 EDT 2004


Author: leira
Date: Mon Sep 27 23:53:55 2004
New Revision: 1573

Added:
   rtir/branches/1.1-TESTING/lib/RT/Action/RTIR_SetDueReopen.pm
Modified:
   rtir/branches/1.1-TESTING/UPGRADING
   rtir/branches/1.1-TESTING/etc/RTIR_Config.pm
   rtir/branches/1.1-TESTING/etc/initialdata
   rtir/branches/1.1-TESTING/etc/upgrade/1.1.3/content
Log:
RT-Ticket: 6143
RT-Status: resolved
RT-Action: correspond
The due date of re-opened tickets is now reconfigurable.


Modified: rtir/branches/1.1-TESTING/UPGRADING
==============================================================================
--- rtir/branches/1.1-TESTING/UPGRADING	(original)
+++ rtir/branches/1.1-TESTING/UPGRADING	Mon Sep 27 23:53:55 2004
@@ -76,6 +76,12 @@
 
 Then, type "make upgrade" and follow the instructions.
 
+Upgrading from RTIR 1.1.2:
+--------------------------
+
+Delete the "SetDueReopen" scrip from the Incident Reports,
+Investigations, and Blocks queues.
+
 Upgrading from RTIR 1.0.0:
 --------------------------
 

Modified: rtir/branches/1.1-TESTING/etc/RTIR_Config.pm
==============================================================================
--- rtir/branches/1.1-TESTING/etc/RTIR_Config.pm	(original)
+++ rtir/branches/1.1-TESTING/etc/RTIR_Config.pm	Mon Sep 27 23:53:55 2004
@@ -40,6 +40,10 @@
 Set ($SLA_Response_InHours, 'Now (in business hours)');
 Set ($SLA_Response_OutOfHours, 'Now (in business hours)');
 
+# Set the SLA for re-opened tickets
+Set ($SLA_Reopen_InHours, 'Full service');
+Set ($SLA_Reopen_OutOfHours, 'Full service: out of hours');
+
 # Set the defaults for RTIR custom fields
 # default values are case-sensitive
 

Modified: rtir/branches/1.1-TESTING/etc/initialdata
==============================================================================
--- rtir/branches/1.1-TESTING/etc/initialdata	(original)
+++ rtir/branches/1.1-TESTING/etc/initialdata	Mon Sep 27 23:53:55 2004
@@ -283,6 +283,10 @@
        Description => 'Set the due date for correspondence' ,                                            # loc
        ExecModule => 'RTIR_SetDueCorrespond',
     },
+    {  Name        => 'RTIR Set Due Reopen',    # loc
+       Description => 'Set the due date for a reopened ticket' ,                                            # loc
+       ExecModule => 'RTIR_SetDueReopen',
+    },
     {  Name        => 'RTIR Set Incident Due',    # loc
        Description => 'Set the due date of parent Incident' ,                                            # loc
        ExecModule => 'RTIR_SetDueIncident',
@@ -448,17 +452,17 @@
     {  Description => "SetDueReopen",
        Queue            => 'Incident Reports',
        ScripCondition => 'RTIR Reopen Ticket',
-       ScripAction      => 'RTIR Set Due by SLA',
+       ScripAction      => 'RTIR Set Due Reopen',
        Template       => 'Blank' },
     {  Description => "SetDueReopen",
        Queue            => 'Investigations',
        ScripCondition => 'RTIR Reopen Ticket',
-       ScripAction      => 'RTIR Set Due by SLA',
+       ScripAction      => 'RTIR Set Due Reopen',
        Template       => 'Blank' },
     {  Description => "SetDueReopen",
        Queue            => 'Blocks',
        ScripCondition => 'RTIR Reopen Ticket',
-       ScripAction      => 'RTIR Set Due by SLA',
+       ScripAction      => 'RTIR Set Due Reopen',
        Template       => 'Blank' },
     {  Description => "SetHowReported",
        Queue            => 'Incident Reports',

Modified: rtir/branches/1.1-TESTING/etc/upgrade/1.1.3/content
==============================================================================
--- rtir/branches/1.1-TESTING/etc/upgrade/1.1.3/content	(original)
+++ rtir/branches/1.1-TESTING/etc/upgrade/1.1.3/content	Mon Sep 27 23:53:55 2004
@@ -4,6 +4,10 @@
        Description => 'Set the due date of parent Incident' ,                                            # loc
        ExecModule => 'RTIR_SetDueIncident',
     },
+    {  Name        => 'RTIR Set Due Reopen',    # loc
+       Description => 'Set the due date for a reopened ticket' ,                                            # loc
+       ExecModule => 'RTIR_SetDueReopen',
+    },
 
 );
 
@@ -33,4 +37,19 @@
       ScripCondition   => 'RTIR Require Due Change',
       ScripAction      => 'RTIR Set Incident Due',
       Template          => 'Blank', },
+    {  Description => "SetDueReopen",
+       Queue            => 'Incident Reports',
+       ScripCondition => 'RTIR Reopen Ticket',
+       ScripAction      => 'RTIR Set Due Reopen',
+       Template       => 'Blank' },
+    {  Description => "SetDueReopen",
+       Queue            => 'Investigations',
+       ScripCondition => 'RTIR Reopen Ticket',
+       ScripAction      => 'RTIR Set Due Reopen',
+       Template       => 'Blank' },
+    {  Description => "SetDueReopen",
+       Queue            => 'Blocks',
+       ScripCondition => 'RTIR Reopen Ticket',
+       ScripAction      => 'RTIR Set Due Reopen',
+       Template       => 'Blank' },
 );

Added: rtir/branches/1.1-TESTING/lib/RT/Action/RTIR_SetDueReopen.pm
==============================================================================
--- (empty file)
+++ rtir/branches/1.1-TESTING/lib/RT/Action/RTIR_SetDueReopen.pm	Mon Sep 27 23:53:55 2004
@@ -0,0 +1,107 @@
+# {{{ BEGIN BPS TAGGED BLOCK
+# 
+# COPYRIGHT:
+#  
+# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
+#                                          <jesse at bestpractical.com>
+# 
+# (Except where explicitly superseded by other copyright notices)
+# 
+# 
+# LICENSE:
+# 
+# This work is made available to you under the terms of Version 2 of
+# the GNU General Public License. A copy of that license should have
+# been provided with this software, but in any event can be snarfed
+# from www.gnu.org.
+# 
+# This work is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# 
+# 
+# CONTRIBUTION SUBMISSION POLICY:
+# 
+# (The following paragraph is not intended to limit the rights granted
+# to you to modify and distribute this software under the terms of
+# the GNU General Public License and is only of importance to you if
+# you choose to contribute your changes and enhancements to the
+# community by submitting them to Best Practical Solutions, LLC.)
+# 
+# By intentionally submitting any modifications, corrections or
+# derivatives to this work, or any other work intended for use with
+# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+# you are the copyright holder for those contributions and you grant
+# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+# royalty-free, perpetual, license to use, copy, create derivative
+# works based on those contributions, and sublicense and distribute
+# those contributions and any derivatives thereof.
+# 
+# }}} END BPS TAGGED BLOCK
+#
+package RT::Action::RTIR_SetDueReopen;
+require RT::Action::Generic;
+
+use strict;
+use vars qw/@ISA/;
+ at ISA = qw(RT::Action::Generic);
+
+=head2 Prepare
+
+Always run this.
+
+=cut
+
+
+sub Prepare {
+    return 1;
+}
+
+# {{{ sub Commit
+
+=head2 Commit
+
+Set the Due date to a configured value.
+
+=cut
+
+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_Reopen_InHours);
+    $SLAObj->SetOutOfHoursDefault($RT::SLA_Reopen_OutOfHours);
+
+    $SLAObj->SetBusinessHours($bh);
+
+    # get the due date
+    my $due = $SLAObj->Due(time(), $SLAObj->SLA(time()));
+
+    my $date = RT::Date->new($RT::SystemUser);
+    $date->Set(Format => 'unix', Value => $due);
+    $self->TicketObj->SetDue($date->ISO);
+
+    return 1;
+}
+
+# }}}
+
+eval "require RT::Action::RTIR_SetDueReopen_Vendor";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RTIR_SetDueReopen_Vendor.pm});
+eval "require RT::Action::RTIR_SetDueReopen_Local";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RTIR_SetDueReopen_Local.pm});
+
+1;


More information about the Rt-commit mailing list