[Rt-commit] [svn] r1102 - in rt/branches/rt-3.1: etc etc/upgrade/3.1.17 lib/RT/Condition

leira at pallas.eruditorum.org leira at pallas.eruditorum.org
Thu Jun 17 14:10:42 EDT 2004


Author: leira
Date: Thu Jun 17 14:10:41 2004
New Revision: 1102

Added:
   rt/branches/rt-3.1/etc/upgrade/3.1.17/
   rt/branches/rt-3.1/etc/upgrade/3.1.17/content
   rt/branches/rt-3.1/lib/RT/Condition/PriorityChange.pm
Modified:
   rt/branches/rt-3.1/etc/initialdata
Log:
RT-Ticket: 4355
RT-Status: resolved
RT-Action: comment

Added new "On Priority Change" condition and "Notify Ccs" and "NotifyCcs as Comment" action.


Modified: rt/branches/rt-3.1/etc/initialdata
==============================================================================
--- rt/branches/rt-3.1/etc/initialdata	(original)
+++ rt/branches/rt-3.1/etc/initialdata	Thu Jun 17 14:10:41 2004
@@ -86,6 +86,14 @@
       Description => 'Sends mail to the owner',              # loc
       ExecModule  => 'Notify',
       Argument    => 'Owner' },
+    { Name        => 'Notify Ccs as Comment',              # loc
+      Description => 'Sends mail to the Ccs as a comment', # loc
+      ExecModule  => 'NotifyAsComment',
+      Argument    => 'Cc' },
+    { Name        => 'Notify Ccs',                                   # loc
+      Description => 'Sends mail to the Ccs',                        # loc
+      ExecModule  => 'Notify',
+      Argument    => 'Cc' },
     { Name        => 'Notify AdminCcs as Comment',                        # loc
       Description => 'Sends mail to the administrative Ccs as a comment', # loc
       ExecModule  => 'NotifyAsComment',
@@ -166,6 +174,13 @@
     },
     {
 
+      Name                 => 'On Priority Change',                       # loc
+      Description          => 'Whenever a ticket\'s priority changes',    # loc
+      ApplicableTransTypes => 'Set',
+      ExecModule           => 'PriorityChange',
+    },
+    {
+
       Name                 => 'On Owner Change',                           # loc
       Description          => 'Whenever a ticket\'s owner changes',        # loc
       ApplicableTransTypes => 'Any',

Added: rt/branches/rt-3.1/etc/upgrade/3.1.17/content
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.1/etc/upgrade/3.1.17/content	Thu Jun 17 14:10:41 2004
@@ -0,0 +1,21 @@
+ at ScripActions = (
+    { Name        => 'Notify Ccs as Comment',              # loc
+      Description => 'Sends mail to the Ccs as a comment', # loc
+      ExecModule  => 'NotifyAsComment',
+      Argument    => 'Cc' },
+    { Name        => 'Notify Ccs',                                   # loc
+      Description => 'Sends mail to the Ccs',                        # loc
+      ExecModule  => 'Notify',
+      Argument    => 'Cc' },
+);
+
+
+ at ScripConditions = (
+    {
+      Name                 => 'On Priority Change',                       # loc
+      Description          => 'Whenever a ticket\'s priority changes',    # loc
+      ApplicableTransTypes => 'Set',
+      ExecModule           => 'PriorityChange',
+    },
+
+1;

Added: rt/branches/rt-3.1/lib/RT/Condition/PriorityChange.pm
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.1/lib/RT/Condition/PriorityChange.pm	Thu Jun 17 14:10:41 2004
@@ -0,0 +1,58 @@
+# BEGIN LICENSE BLOCK
+# 
+# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+# 
+# (Except where explictly superceded by other copyright notices)
+# 
+# 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.
+# 
+# Unless otherwise specified, all modifications, corrections or
+# extensions to this work which alter its source code become the
+# property of Best Practical Solutions, LLC when submitted for
+# inclusion in the work.
+# 
+# 
+# END LICENSE BLOCK
+ 
+
+
+package RT::Condition::PriorityChange;
+require RT::Condition::Generic;
+
+use strict;
+use vars qw/@ISA/;
+ at ISA = qw(RT::Condition::Generic);
+
+
+=head2 IsApplicable
+
+If the argument passed in is equivalent to the new value of
+the Priority Obj
+
+=cut
+
+sub IsApplicable {
+    my $self = shift;
+    if ($self->TransactionObj->Field eq 'Priority') {
+	return(1);
+    } 
+    else {
+	return(undef);
+    }
+}
+
+eval "require RT::Condition::PriorityChange_Vendor";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/PriorityChange_Vendor.pm});
+eval "require RT::Condition::PriorityChange_Local";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/PriorityChange_Local.pm});
+
+1;
+


More information about the Rt-commit mailing list