AnyReminderTransaction: Difference between revisions

From Request Tracker Wiki
Jump to navigation Jump to search
m (2 revisions imported)
 
mNo edit summary
 
Line 9: Line 9:
1. Save the following code to /path/to/rt3/local/lib/RT/Condition/[[AnyReminderTransaction]].pm
1. Save the following code to /path/to/rt3/local/lib/RT/Condition/[[AnyReminderTransaction]].pm


  <nowiki># BEGIN BPS TAGGED BLOCK {{{
  <pre># BEGIN BPS TAGGED BLOCK {{{
  #
  #
  # COPYRIGHT:
  # COPYRIGHT:
Line 69: Line 69:
   
   
   
   
  </nowiki>
  </pre>


2. Save the following code in a datafile named AnyReminderTransaction.insert on your server:
2. Save the following code in a datafile named AnyReminderTransaction.insert on your server:


<pre>
  @ScripConditions = (
  @ScripConditions = (
     { Name                =&gt; 'On Reminder Create',                      # loc
     { Name                =&gt; 'On Reminder Create',                      # loc
Line 79: Line 80:
       ExecModule          =&gt; 'AnyReminderTransaction', },
       ExecModule          =&gt; 'AnyReminderTransaction', },
  );
  );
   
  </pre>


3. Run the RT3 Setup Database tool specifying to insert the datafile just saved. This will create the ScripConditions in RT's database.
3. Run the RT3 Setup Database tool specifying to insert the datafile just saved. This will create the ScripConditions in RT's database.


  /path/to/rt3/sbin/rt-setup-database --action insert --datafile /path/to/AnyReminderTransaction.insert
  /path/to/rt3/sbin/rt-setup-database --action insert --datafile /path/to/AnyReminderTransaction.insert

Latest revision as of 13:21, 13 August 2016

Overview

This modification allows to associate scrips to the creation of a reminder.

Tested only on 3.6.3

How to set up AnyReminderTransaction in RT3:

1. Save the following code to /path/to/rt3/local/lib/RT/Condition/AnyReminderTransaction.pm

# BEGIN BPS TAGGED BLOCK {{{
 #
 # COPYRIGHT:
 #
 # Copyright (c) 2007 Revolution Linux, Inc
 # <mjeanson@revolutionlinux.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.
 #
 # END BPS TAGGED BLOCK }}}
 
 package RT::Condition::AnyReminderTransaction;
 require RT::Condition::Generic;
 
 use strict;
 use vars qw/@ISA/;
 @ISA = qw(RT::Condition::Generic);
 
 
 =head2 IsApplicable
 
 If the ticket object type is "reminder" return true, otherwise return false
 
 =cut
 
 sub IsApplicable {
     my $self = shift;
     if ($self->TicketObj->Type eq 'reminder') {
         return(1);
     }
     else {
         return(undef);
     }
 }
 
 eval "require RT::Condition::AnyReminderTransaction_Vendor";
 die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/AnyReminderTransaction_Vendor.pm});
 eval "require RT::Condition::AnyReminderTransaction_Local";
 die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/AnyReminderTransaction_Local.pm});
 
 1;
 
 
 

2. Save the following code in a datafile named AnyReminderTransaction.insert on your server:

 @ScripConditions = (
     { Name                 => 'On Reminder Create',                       # loc
       Description          => 'When a reminder is created',               # loc
       ApplicableTransTypes => 'Create',
       ExecModule           => 'AnyReminderTransaction', },
 );
 

3. Run the RT3 Setup Database tool specifying to insert the datafile just saved. This will create the ScripConditions in RT's database.

/path/to/rt3/sbin/rt-setup-database --action insert --datafile /path/to/AnyReminderTransaction.insert