[Rt-commit] [svn] r1502 - in rtir/branches/1.1: . etc lib/RT/Action lib/RT/Condition

leira at pallas.eruditorum.org leira at pallas.eruditorum.org
Fri Sep 17 02:13:36 EDT 2004


Author: leira
Date: Fri Sep 17 02:13:35 2004
New Revision: 1502

Added:
   rtir/branches/1.1/lib/RT/Action/RTIR_SetBlockState.pm
   rtir/branches/1.1/lib/RT/Action/RTIR_SetIncidentReportState.pm
   rtir/branches/1.1/lib/RT/Action/RTIR_SetIncidentState.pm
   rtir/branches/1.1/lib/RT/Action/RTIR_SetInvestigationState.pm
   rtir/branches/1.1/lib/RT/Condition/
   rtir/branches/1.1/lib/RT/Condition/CustomerResponse.pm
   rtir/branches/1.1/lib/RT/Condition/RTIR_CloseTicket.pm
   rtir/branches/1.1/lib/RT/Condition/RTIR_CustomerResponse.pm
   rtir/branches/1.1/lib/RT/Condition/RTIR_ReopenTicket
   rtir/branches/1.1/lib/RT/Condition/RTIR_ReopenTicket.pm
   rtir/branches/1.1/lib/RT/Condition/RTIR_RequireStateChange.pm
Modified:
   rtir/branches/1.1/Makefile
   rtir/branches/1.1/etc/initialdata
Log:
Put 'RTIR' in the names of Scrip Actions.

Put remaining Scrip actions and conditions into .pm files.


Modified: rtir/branches/1.1/Makefile
==============================================================================
--- rtir/branches/1.1/Makefile	(original)
+++ rtir/branches/1.1/Makefile	Fri Sep 17 02:13:35 2004
@@ -33,6 +33,9 @@
 	find $(RT_HTML_PATH)/RTIR -type f |xargs chmod 644
 	find $(RT_HTML_PATH)/Callbacks/RTIR -type d |xargs chmod 755
 	find $(RT_HTML_PATH)/Callbacks/RTIR -type f |xargs chmod 644
+	cp -R lib/RT/Condition/* $(RT_ROOT)/lib/RT/Condition/
+	find $(RT_ROOT)/lib/RT/Condition -type d |xargs chmod 755
+	find $(RT_ROOT)/lib/RT/Condition -type f |xargs chmod 644
 	cp -R lib/RT/Action/* $(RT_ROOT)/lib/RT/Action/
 	find $(RT_ROOT)/lib/RT/Action -type d |xargs chmod 755
 	find $(RT_ROOT)/lib/RT/Action -type f |xargs chmod 644

Modified: rtir/branches/1.1/etc/initialdata
==============================================================================
--- rtir/branches/1.1/etc/initialdata	(original)
+++ rtir/branches/1.1/etc/initialdata	Fri Sep 17 02:13:35 2004
@@ -267,50 +267,91 @@
 
 @ScripActions = (
 
-    {  Name        => 'Set Due to Now',    # loc
+    {  Name        => 'RTIR Set Due to Now',    # loc
        Description => 'Set the due date to the current time' ,                                            # loc
        ExecModule => 'RTIR_SetDueToNow',
     },
-    {  Name        => 'Set Starts to Now',    # loc
+    {  Name        => 'RTIR Set Starts to Now',    # loc
        Description => 'Set the starts date to the current time' ,                                            # loc
        ExecModule => 'RTIR_SetStartsToNow',
     },
-    {  Name        => 'Set Due by SLA',    # loc
+    {  Name        => 'RTIR Set Due by SLA',    # loc
        Description => 'Set the due date according to SLA' ,                                            # loc
        ExecModule => 'RTIR_SetDueBySLA',
     },
-    {  Name        => 'Set Due Correspond',    # loc
+    {  Name        => 'RTIR Set Due Correspond',    # loc
        Description => 'Set the due date for correspondence' ,                                            # loc
        ExecModule => 'RTIR_SetDueCorrespond',
     },
-    {  Name        => 'Unset Due',    # loc
+    {  Name        => 'RTIR Unset Due',    # loc
        Description => 'Unset the due date' ,                                            # loc
        ExecModule => 'RTIR_UnsetDue',
     },
-    {  Name        => 'Set Starts by Business Hours',    # loc
+    {  Name        => 'RTIR Set Starts by Business Hours',    # loc
        Description => 'Set the starts date according to Business Hours' ,                                            # loc
        ExecModule => 'RTIR_SetStartsByBizHours',
     },
-    {  Name        => 'Set How Reported',    # loc
+    {  Name        => 'RTIR Set How Reported',    # loc
        Description => 'Set how the Incident Report was reported' ,                                            # loc
        ExecModule => 'RTIR_SetHowReported',
     },
-    {  Name        => 'Resolve Children',    # loc
+    {  Name        => 'RTIR Resolve Children',    # loc
        Description => "Resolve an Incident's children",                                            # loc
        ExecModule => 'RTIR_ResolveChildren',
     },
-    {  Name        => 'Change Child Ownership',    # loc
+    {  Name        => 'RTIR Change Child Ownership',    # loc
        Description => "Change the ownership of Incident's children",                                            # loc
        ExecModule => 'RTIR_ChangeChildOwnership',
     },
-    {  Name        => 'Change Parent Ownership',    # loc
+    {  Name        => 'RTIR Change Parent Ownership',    # loc
        Description => 'Change the ownership of the parent Incident' ,                                            # loc
        ExecModule => 'RTIR_ChangeParentOwnership',
     },
-    {  Name        => 'Open Parent',    # loc
+    {  Name        => 'RTIR Open Parent',    # loc
        Description => 'Open the parent Incident when a child reopens' ,                                            # loc
        ExecModule => 'RTIR_OpenParent',
     },
+    {  Name        => 'RTIR Set Incident Report State',    # loc
+       Description => 'Set the state of an Incident Report' ,                                            # loc
+       ExecModule => 'RTIR_SetIncidentReportState',
+    },
+    {  Name        => 'RTIR Set Investigation State',    # loc
+       Description => 'Set the state of an Investigation' ,                                            # loc
+       ExecModule => 'RTIR_SetInvestigationState',
+    },
+    {  Name        => 'RTIR Set Block State',    # loc
+       Description => 'Set the state of a Block' ,                                            # loc
+       ExecModule => 'RTIR_SetBlockState',
+    },
+    {  Name        => 'RTIR Set Incident State',    # loc
+       Description => 'Set the state of an Incident' ,                                            # loc
+       ExecModule => 'RTIR_SetIncidentState',
+    },
+);
+
+ at ScripConditions = (
+
+    {  Name        => 'RTIR Customer Response',    # loc
+       Description => 'Detect an external response' ,                                            # loc
+       ApplicableTransTypes => 'Correspond',
+       ExecModule => 'RTIR_CustomerResponse',
+    },
+    {  Name        => 'RTIR Close Ticket',    # loc
+       Description => 'A ticket is rejected or resolved' ,                                            # loc
+       ApplicableTransTypes => 'Any',
+       ExecModule => 'RTIR_CloseTicket',
+    },
+    {  Name        => 'RTIR Reopen Ticket',    # loc
+       Description => 'A closed ticket is reopened' ,                                            # loc
+       ApplicableTransTypes => 'Any',
+       ExecModule => 'RTIR_ReopenTicket',
+    },
+    {  Name        => 'RTIR Require State Change',    # loc
+       Description => 'A ticket requires a state change' ,                                            # loc
+       ApplicableTransTypes => 'Any',
+       ExecModule => 'RTIR_RequireStateChange',
+    },
+
 );
 
 @Scrips = (
@@ -326,433 +367,156 @@
        Template       => 'NewMessage' },
     {  Description => "DetectUserResponse",
        Queue          => 'Incident Reports',
-       ScripCondition => 'User Defined',
-       CustomIsApplicableCode => q[
-# ------------------------------------------------------------------- #
-if ($self->TransactionObj->Type eq 'Correspond' && 
-    $self->TicketObj->Owner ne $self->TransactionObj->Creator) {
-    return 1;
-} else {
-    return 0;
-}
-# ------------------------------------------------------------------- #	],
-       ScripAction      => 'Set Due to Now',
+       ScripCondition => 'RTIR Customer Response',
+       ScripAction      => 'RTIR Set Due to Now',
        Template       => 'Blank' },
     {  Description => "DetectUserResponse",
        Queue            => 'Investigations',
-       ScripCondition => 'User Defined',
-       CustomIsApplicableCode => q[
-# ------------------------------------------------------------------- #
-if ($self->TransactionObj->Type eq 'Correspond' && 
-    $self->TicketObj->Owner ne $self->TransactionObj->Creator) {
-    return 1;
-} else {
-    return 0;
-}
-# ------------------------------------------------------------------- #	],
-       ScripAction      => 'Set Due to Now',
+       ScripCondition => 'RTIR Customer Response',
+       ScripAction      => 'RTIR Set Due to Now',
        Template       => 'Blank' },
     {  Description => "DetectUserResponse",
        Queue            => 'Blocks',
-       ScripCondition => 'User Defined',
-       CustomIsApplicableCode => q[
-# ------------------------------------------------------------------- #
-if ($self->TransactionObj->Type eq 'Correspond' && 
-    $self->TicketObj->Owner ne $self->TransactionObj->Creator) {
-    return 1;
-} else {
-    return 0;
-}
-# ------------------------------------------------------------------- #	],
-       ScripAction      => 'Set Due to Now',
+       ScripCondition => 'RTIR Customer Response',
+       ScripAction      => 'RTIR Set Due to Now',
        Template       => 'Blank' },
     {  Description => "SetStartsDate",
        Queue            => 'Incidents',
        ScripCondition => 'On Create',
-       ScripAction      => 'Set Starts to Now',
+       ScripAction      => 'RTIR Set Starts to Now',
        CustomPrepareCode => '1',
        Template       => 'Blank' },
     {  Description => "SetDue",
        Queue            => 'Incident Reports',
        ScripCondition => 'On Create',
-       ScripAction      => 'Set Due by SLA',
+       ScripAction      => 'RTIR Set Due by SLA',
        Template       => 'Blank' },
     {  Description => "SetStarts",
        Queue            => 'Incident Reports',
        ScripCondition => 'On Create',
-       ScripAction      => 'Set Starts by Business Hours',
+       ScripAction      => 'RTIR Set Starts by Business Hours',
        Template       => 'Blank' },
     {  Description => "SetStarts",
        Queue            => 'Investigations',
        ScripCondition => 'On Create',
-       ScripAction      => 'Set Starts by Business Hours',
+       ScripAction      => 'RTIR Set Starts by Business Hours',
        Template       => 'Blank' },
     {  Description => "SetStarts",
        Queue            => 'Blocks',
        ScripCondition => 'On Create',
-       ScripAction      => 'Set Starts by Business Hours',
+       ScripAction      => 'RTIR Set Starts by Business Hours',
        Template       => 'Blank' },
     {  Description => "SetDue",
        Queue            => 'Investigations',
        ScripCondition => 'On Create',
-       ScripAction      => 'Set Due Correspond',
+       ScripAction      => 'RTIR Set Due Correspond',
        Template       => 'Blank' },
     {  Description => "SetDue",
        Queue            => 'Blocks',
        ScripCondition => 'On Create',
-       ScripAction      => 'Set Due Correspond',
+       ScripAction      => 'RTIR Set Due Correspond',
        Template       => 'Blank' },
     {  Description => "UnsetDue",
        Queue            => 'Incident Reports',
-       ScripCondition => 'User Defined',
-       CustomIsApplicableCode => q[
-# ------------------------------------------------------------------- #
-if (($self->TransactionObj->Type eq "Status" or
-    ($self->TransactionObj->Type eq "Set" and 
-     $self->TransactionObj->Field eq "Status")) and
-     ($self->TransactionObj->NewValue eq 'rejected' ||
-      $self->TransactionObj->NewValue eq 'resolved')) {
-  return 1;
-} else {
-  return 0;
-}
-# ------------------------------------------------------------------- # ],
-       ScripAction      => 'Unset Due',
+       ScripCondition => 'RTIR Close Ticket',
+       ScripAction      => 'RTIR Unset Due',
        Template       => 'Blank' },
     {  Description => "UnsetDue",
        Queue            => 'Investigations',
-       ScripCondition => 'User Defined',
-       CustomIsApplicableCode => q[
-# ------------------------------------------------------------------- #
-if (($self->TransactionObj->Type eq "Status" or
-    ($self->TransactionObj->Type eq "Set" and 
-     $self->TransactionObj->Field eq "Status")) and
-     ($self->TransactionObj->NewValue eq 'rejected' ||
-      $self->TransactionObj->NewValue eq 'resolved')) {
-  return 1;
-} else {
-  return 0;
-}
-# ------------------------------------------------------------------- # ],
-       ScripAction      => 'Unset Due',
+       ScripCondition => 'RTIR Close Ticket',
+       ScripAction      => 'RTIR Unset Due',
        Template       => 'Blank' },
     {  Description => "UnsetDue",
        Queue            => 'Blocks',
-       ScripCondition => 'User Defined',
-       CustomIsApplicableCode => q[
-# ------------------------------------------------------------------- #
-if ($self->TransactionObj->Type eq "Status" or
-   ($self->TransactionObj->Type eq "Set" and 
-    $self->TransactionObj->Field eq "Status")) and
-    ($self->TransactionObj->NewValue eq 'open' ||
-     $self->TransactionObj->NewValue eq 'rejected' ||
-     $self->TransactionObj->NewValue eq 'resolved') {
-  return 1;
-} else {
-  return 0;
-}
-# ------------------------------------------------------------------- # ],
-       ScripAction      => 'Unset Due',
+       ScripCondition => 'RTIR Close Ticket',
+       ScripAction      => 'RTIR Unset Due',
        Template       => 'Blank' },
     {  Description => "UnsetDue",
        Queue            => 'Blocks',
-       ScripCondition => 'User Defined',
-       CustomIsApplicableCode => q[
-# ------------------------------------------------------------------- #
-if ($self->TransactionObj->Type eq "Status" or
-   ($self->TransactionObj->Type eq "Set" and 
-    $self->TransactionObj->Field eq "Status")) and
-    ($self->TransactionObj->NewValue eq 'stalled') {
-  return 1;
-} else {
-  return 0;
-}
-# ------------------------------------------------------------------- # ],
-       ScripAction      => 'Set Due Correspond',
+       ScripCondition => 'RTIR Close Ticket',
+       ScripAction      => 'RTIR Unset Due',
        Template       => 'Blank' },
     {  Description => "SetDueReopen",
        Queue            => 'Incident Reports',
-       ScripCondition => 'User Defined',
-       CustomIsApplicableCode => q[
-# ------------------------------------------------------------------- #
-if (($self->TransactionObj->Type eq "Status" or
-    ($self->TransactionObj->Type eq "Set" and 
-     $self->TransactionObj->Field eq "Status")) and
-     (( $self->TransactionObj->OldValue eq 'rejected' ||
-        $self->TransactionObj->OldValue eq 'resolved') &&
-      $self->TransactionObj->NewValue eq 'open')) {
-  return 1;
-} else {
-  return 0;
-}
-# ------------------------------------------------------------------- # ],
-       ScripAction      => 'Set Due by SLA',
+       ScripCondition => 'RTIR Reopen Ticket',
+       ScripAction      => 'RTIR Set Due by SLA',
        Template       => 'Blank' },
     {  Description => "SetDueReopen",
        Queue            => 'Investigations',
-       ScripCondition => 'User Defined',
-       CustomIsApplicableCode => q[
-# ------------------------------------------------------------------- #
-if (($self->TransactionObj->Type eq "Status" or
-    ($self->TransactionObj->Type eq "Set" and 
-     $self->TransactionObj->Field eq "Status")) and
-     (( $self->TransactionObj->OldValue eq 'rejected' ||
-        $self->TransactionObj->OldValue eq 'resolved') &&
-      $self->TransactionObj->NewValue eq 'open')) {
-  return 1;
-} else {
-  return 0;
-}
-# ------------------------------------------------------------------- # ],
-       ScripAction      => 'Set Due by SLA',
+       ScripCondition => 'RTIR Reopen Ticket',
+       ScripAction      => 'RTIR Set Due by SLA',
        Template       => 'Blank' },
     {  Description => "SetDueReopen",
        Queue            => 'Blocks',
-       ScripCondition => 'User Defined',
-       CustomIsApplicableCode => q[
-# ------------------------------------------------------------------- #
-if (($self->TransactionObj->Type eq "Status" or
-    ($self->TransactionObj->Type eq "Set" and 
-     $self->TransactionObj->Field eq "Status")) and
-     (( $self->TransactionObj->OldValue eq 'rejected' ||
-        $self->TransactionObj->OldValue eq 'resolved') &&
-      $self->TransactionObj->NewValue eq 'open')) {
-  return 1;
-} else {
-  return 0;
-}
-# ------------------------------------------------------------------- # ],
-       ScripAction      => 'Set Due by SLA',
+       ScripCondition => 'RTIR Reopen Ticket',
+       ScripAction      => 'RTIR Set Due by SLA',
        Template       => 'Blank' },
     {  Description => "SetHowReported",
        Queue            => 'Incident Reports',
        ScripCondition => 'On Create',
-       ScripAction      => 'Set How Reported',
+       ScripAction      => 'RTIR Set How Reported',
        Template       => 'Blank' },
     {  Description => "SetRTIRState",
        Queue            => 'Blocks',
-       ScripCondition   => 'User Defined',
-       CustomIsApplicableCode => q[
-# ------------------------------------------------------------------- #
-  if ($self->TransactionObj->Type eq "Status" or
-      ($self->TransactionObj->Type eq "Set" and 
-       $self->TransactionObj->Field eq "Status") or
-      $self->TransactionObj->Type eq "Create" or
-      $self->TransactionObj->Type eq "CustomField" or
-      ($self->TransactionObj->Type eq "Set" and
-       $self->TransactionObj->Field eq "Queue")) {
-    return 1;
-  } else {
-    return 0;
-  }
-# ------------------------------------------------------------------- #
-	],
-
-       ScripAction      => 'User Defined',
-       CustomCommitCode => q[
-# ------------------------------------------------------------------- #
-my $State;
-my $cf = RT::CustomField->new($self->TransactionObj->CurrentUser);
-$cf->LoadByNameAndQueue(Queue => $self->TicketObj->QueueObj->Id, Name => '_RTIR_State');
-unless ($cf->Id) { 
-    return(1);
-}
-
-if ($self->TicketObj->Status eq 'new') {
-  $State = 'pending activation';
-} elsif ($self->TicketObj->Status eq 'open') {
-  $State = 'active';
-} elsif ($self->TicketObj->Status eq 'stalled') {
-  $State = 'pending removal';
-} elsif ($self->TicketObj->Status eq 'resolved') {
-  $State = 'removed';
-} else {
-  return 0;
-}
-$self->TicketObj->AddCustomFieldValue(Field => $cf->id, Value => $State);
-return 1;
-# ------------------------------------------------------------------- #
-	],
-       CustomPrepareCode => '1',
+       ScripCondition   => 'RTIR Require State Change',
+       ScripAction      => 'RTIR Set Block State',
        Template          => 'Blank', },
     {  Description => "SetRTIRState",
        Queue            => 'Incident Reports',
-       ScripCondition   => 'User Defined',
-       CustomIsApplicableCode => q[
-# ------------------------------------------------------------------- #
-  if ($self->TransactionObj->Type eq "Status" or
-      $self->TransactionObj->Type eq "Create" or
-      ($self->TransactionObj->Type eq "AddLink" and 
-       $self->TransactionObj->Field eq "MemberOf") or
-      ($self->TransactionObj->Type eq "Set" and 
-       $self->TransactionObj->Field eq "Status") or
-      $self->TransactionObj->Type eq "CustomField" or
-      ($self->TransactionObj->Type eq "Set" and
-       $self->TransactionObj->Field eq "Queue")) {
-    return 1;
-  } else {
-    return 0;
-  }
-# ------------------------------------------------------------------- #
-	],
-
-       ScripAction      => 'User Defined',
-       CustomCommitCode => q[
-# ------------------------------------------------------------------- #
-    my $State;
-    my $cf = RT::CustomField->new($self->TransactionObj->CurrentUser);
-    $cf->LoadByNameAndQueue(Queue => $self->TicketObj->QueueObj->Id, Name => '_RTIR_State');
-    unless ($cf->Id) { 
-        return(1);
-    }
-    if ($self->TicketObj->Status eq 'new' or $self->TicketObj->Status eq 'open' or $self->TicketObj->Status eq 'stalled') {
-      $State = 'new';
-        my $parents = RT::Tickets->new($self->TransactionObj->CurrentUser);
-        $parents->LimitHasMember($self->TicketObj->id);
-        $parents->LimitQueue(VALUE => 'Incidents');
-      if ($parents->First) {
-        $State = 'open';
-        }
-    } elsif ($self->TicketObj->Status eq 'resolved') {
-      $State = 'resolved';
-    } elsif ($self->TicketObj->Status eq 'rejected') {
-      $State = 'rejected';
-    } else {
-      return 0;
-    }
-    $self->TicketObj->AddCustomFieldValue(Field => $cf->id, Value => $State);
-  return 1;
-# ------------------------------------------------------------------- #
-	],
-       CustomPrepareCode => '1',
+       ScripCondition   => 'RTIR Require State Change',
+       ScripAction      => 'RTIR Set Incident Report State',
        Template          => 'Blank', },
 
     {  Description => "SetRTIRState",
        Queue            => 'Investigations',
-       ScripCondition   => 'User Defined',
-       CustomIsApplicableCode => q[
-# ------------------------------------------------------------------- #
-  if ($self->TransactionObj->Type eq "Status" or
-      ($self->TransactionObj->Type eq "Set" and 
-       $self->TransactionObj->Field eq "Status") or
-      $self->TransactionObj->Type eq "Create" or
-      $self->TransactionObj->Type eq "CustomField" or
-      ($self->TransactionObj->Type eq "Set" and
-       $self->TransactionObj->Field eq "Queue")) {
-    return 1;
-  } else {
-    return 0;
-  }
-# ------------------------------------------------------------------- #
-	],
-
-       ScripAction      => 'User Defined',
-       CustomCommitCode => q[
-# ------------------------------------------------------------------- #
-  my $State;
-  my $cf = RT::CustomField->new($self->TransactionObj->CurrentUser);
-  $cf->LoadByNameAndQueue(Queue => $self->TicketObj->QueueObj->Id, Name => '_RTIR_State');
-  unless ($cf->Id) { 
-      return(1);
-  }
-  if ($self->TicketObj->Status eq 'open' or $self->TicketObj->Status eq 'new') {
-      $State = 'open';
-  } elsif ($self->TicketObj->Status eq 'resolved') {
-      $State = 'resolved';
-  } else {
-      return 0;
-  }
-  $self->TicketObj->AddCustomFieldValue(Field => $cf->id, Value => $State);
-  return 1;
-# ------------------------------------------------------------------- #
-	],
-       CustomPrepareCode => '1',
+       ScripCondition   => 'RTIR Require State Change',
+       ScripAction      => 'RTIR Set Investigation State',
        Template          => 'Blank', },
 
     {  Description => "SetRTIRState",
        Queue            => 'Incidents',
-       ScripCondition   => 'User Defined',
-       CustomIsApplicableCode => q[
-# ------------------------------------------------------------------- #
-  if ($self->TransactionObj->Type eq "Status" or
-      ($self->TransactionObj->Type eq "Set" and 
-       $self->TransactionObj->Field eq "Status") or
-      $self->TransactionObj->Type eq "Create" or
-      $self->TransactionObj->Type eq "CustomField" or
-      ($self->TransactionObj->Type eq "Set" and
-       $self->TransactionObj->Field eq "Queue")) {
-    return 1;
-  } else {
-    return 0;
-  }
-# ------------------------------------------------------------------- #
-	],
-
-       ScripAction      => 'User Defined',
-       CustomCommitCode => q[
-# ------------------------------------------------------------------- #
-    my $State;
-    my $cf = RT::CustomField->new($self->TransactionObj->CurrentUser);
-    $cf->LoadByNameAndQueue(Queue => $self->TicketObj->QueueObj->Id, Name => '_RTIR_State');
-    unless ($cf->Id) { 
-        return(1);
-    }
-    if ($self->TicketObj->Status eq 'new' ||
-      $self->TicketObj->Status eq 'open' ||
-      $self->TicketObj->Status eq 'stalled') {
-      $State = 'open';
-    } elsif ($self->TicketObj->Status eq 'resolved') {
-      $State = 'resolved';
-    } elsif ($self->TicketObj->Status eq 'rejected') {
-      $State = 'abandoned';
-    } else {
-      return 0;
-    }
-    $self->TicketObj->AddCustomFieldValue(Field => $cf->id, Value => $State);
-  return 1;
-# ------------------------------------------------------------------- #
-	],
-       CustomPrepareCode => '1',
+       ScripCondition   => 'RTIR Require State Change',
+       ScripAction      => 'RTIR Set Incident State',
        Template          => 'Blank', },
     {  Description => "ResolveAllChildren",
        Queue            => 'Incidents',
        ScripCondition   => 'On Status Change',
-       ScripAction      => 'Resolve Children',
+       ScripAction      => 'RTIR Resolve Children',
        Template          => 'Blank', },
     {  Description => "FixOwnership",
        Queue            => 'Incidents',
        ScripCondition   => 'On Owner Change',
-       ScripAction      => 'Change Child Ownership',
+       ScripAction      => 'RTIR Change Child Ownership',
        Template          => 'Blank', },
     {  Description => "FixOwnership",
        Queue            => 'Incident Reports',
        ScripCondition   => 'On Owner Change',
-       ScripAction      => 'Change Parent Ownership',
+       ScripAction      => 'RTIR Change Parent Ownership',
        Template          => 'Blank', },
     {  Description => "FixOwnership",
        Queue            => 'Investigations',
        ScripCondition   => 'On Owner Change',
-       ScripAction      => 'Change Parent Ownership',
+       ScripAction      => 'RTIR Change Parent Ownership',
        Template          => 'Blank', },
     {  Description => "FixOwnership",
        Queue            => 'Blocks',
        ScripCondition   => 'On Owner Change',
-       ScripAction      => 'Change Parent Ownership',
+       ScripAction      => 'RTIR Change Parent Ownership',
        Template          => 'Blank', },
     {  Description => "ReopenIncident",
        Queue            => 'Incident Reports',
        ScripCondition   => 'On Status Change',
-       ScripAction      => 'Open Parent',
+       ScripAction      => 'RTIR Open Parent',
        Template          => 'Blank', },
     {  Description => "ReopenIncident",
        Queue            => 'Investigations',
        ScripCondition   => 'On Status Change',
-       ScripAction      => 'Open Parent',
+       ScripAction      => 'RTIR Open Parent',
        Template          => 'Blank', },
     {  Description => "ReopenIncident",
        Queue            => 'Blocks',
        ScripCondition   => 'On Status Change',
-       ScripAction      => 'Open Parent',
+       ScripAction      => 'RTIR Open Parent',
        Template          => 'Blank', },
 );
 

Added: rtir/branches/1.1/lib/RT/Action/RTIR_SetBlockState.pm
==============================================================================
--- (empty file)
+++ rtir/branches/1.1/lib/RT/Action/RTIR_SetBlockState.pm	Fri Sep 17 02:13:35 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_SetBlockState;
+require RT::Action::Generic;
+
+use strict;
+use vars qw/@ISA/;
+ at ISA = qw(RT::Action::Generic);
+
+=head2 Prepare
+
+Always run this.
+
+=cut
+
+
+sub Prepare {
+    my $self = shift;
+
+    return 1;
+}
+
+# {{{ sub Commit
+
+=head2 Commit
+
+Set the Block state.
+
+=cut
+
+sub Commit {
+    my $self = shift;
+
+    my $State;
+    my $cf = RT::CustomField->new($self->TransactionObj->CurrentUser);
+    $cf->LoadByNameAndQueue(Queue => $self->TicketObj->QueueObj->Id, Name => '_RTIR_State');
+    unless ($cf->Id) { 
+	return(1);
+    }
+
+    if ($self->TicketObj->Status eq 'new') {
+	$State = 'pending activation';
+    } elsif ($self->TicketObj->Status eq 'open') {
+	$State = 'active';
+    } elsif ($self->TicketObj->Status eq 'stalled') {
+	$State = 'pending removal';
+    } elsif ($self->TicketObj->Status eq 'resolved') {
+	$State = 'removed';
+    } else {
+	return 0;
+    }
+    $self->TicketObj->AddCustomFieldValue(Field => $cf->id, Value => $State);
+    return 1;
+}
+
+# }}}
+
+eval "require RT::Action::RTIR_SetBlockState_Vendor";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RTIR_SetBlockState_Vendor.pm});
+eval "require RT::Action::RTIR_SetBlockState_Local";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RTIR_SetBlockState_Local.pm});
+
+1;

Added: rtir/branches/1.1/lib/RT/Action/RTIR_SetIncidentReportState.pm
==============================================================================
--- (empty file)
+++ rtir/branches/1.1/lib/RT/Action/RTIR_SetIncidentReportState.pm	Fri Sep 17 02:13:35 2004
@@ -0,0 +1,110 @@
+# {{{ 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_SetIncidentReportState;
+require RT::Action::Generic;
+
+use strict;
+use vars qw/@ISA/;
+ at ISA = qw(RT::Action::Generic);
+
+=head2 Prepare
+
+Always run this.
+
+=cut
+
+
+sub Prepare {
+    my $self = shift;
+
+    return 1;
+}
+
+# {{{ sub Commit
+
+=head2 Commit
+
+Set the Block state.
+
+=cut
+
+sub Commit {
+    my $self = shift;
+
+    my $State;
+    my $cf = RT::CustomField->new($self->TransactionObj->CurrentUser);
+    $cf->LoadByNameAndQueue(Queue => $self->TicketObj->QueueObj->Id, Name => '_RTIR_State');
+    unless ($cf->Id) { 
+        return(1);
+    }
+    if ($self->TicketObj->Status eq 'new' or $self->TicketObj->Status eq 'open' or $self->TicketObj->Status eq 'stalled') {
+	$State = 'new';
+        my $parents = RT::Tickets->new($self->TransactionObj->CurrentUser);
+        $parents->LimitHasMember($self->TicketObj->id);
+        $parents->LimitQueue(VALUE => 'Incidents');
+	if ($parents->First) {
+	    $State = 'open';
+        }
+    } elsif ($self->TicketObj->Status eq 'resolved') {
+	$State = 'resolved';
+    } elsif ($self->TicketObj->Status eq 'rejected') {
+	$State = 'rejected';
+    } else {
+	return 0;
+    }
+    $self->TicketObj->AddCustomFieldValue(Field => $cf->id, Value => $State);
+    return 1;
+}
+
+# }}}
+
+eval "require RT::Action::RTIR_SetIncidentReportState_Vendor";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RTIR_SetIncidentReportState_Vendor.pm});
+eval "require RT::Action::RTIR_SetIncidentReportState_Local";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RTIR_SetIncidentReportState_Local.pm});
+
+1;

Added: rtir/branches/1.1/lib/RT/Action/RTIR_SetIncidentState.pm
==============================================================================
--- (empty file)
+++ rtir/branches/1.1/lib/RT/Action/RTIR_SetIncidentState.pm	Fri Sep 17 02:13:35 2004
@@ -0,0 +1,106 @@
+# {{{ 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_SetIncidentState;
+require RT::Action::Generic;
+
+use strict;
+use vars qw/@ISA/;
+ at ISA = qw(RT::Action::Generic);
+
+=head2 Prepare
+
+Always run this.
+
+=cut
+
+
+sub Prepare {
+    my $self = shift;
+
+    return 1;
+}
+
+# {{{ sub Commit
+
+=head2 Commit
+
+Set the Block state.
+
+=cut
+
+sub Commit {
+    my $self = shift;
+
+    my $State;
+    my $cf = RT::CustomField->new($self->TransactionObj->CurrentUser);
+    $cf->LoadByNameAndQueue(Queue => $self->TicketObj->QueueObj->Id, Name => '_RTIR_State');
+    unless ($cf->Id) { 
+        return(1);
+    }
+    if ($self->TicketObj->Status eq 'new' ||
+	$self->TicketObj->Status eq 'open' ||
+	$self->TicketObj->Status eq 'stalled') {
+	$State = 'open';
+    } elsif ($self->TicketObj->Status eq 'resolved') {
+	$State = 'resolved';
+    } elsif ($self->TicketObj->Status eq 'rejected') {
+	$State = 'abandoned';
+    } else {
+	return 0;
+    }
+    $self->TicketObj->AddCustomFieldValue(Field => $cf->id, Value => $State);
+    return 1;
+}
+
+# }}}
+
+eval "require RT::Action::RTIR_SetIncidentState_Vendor";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RTIR_SetIncidentState_Vendor.pm});
+eval "require RT::Action::RTIR_SetIncidentState_Local";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RTIR_SetIncidentState_Local.pm});
+
+1;

Added: rtir/branches/1.1/lib/RT/Action/RTIR_SetInvestigationState.pm
==============================================================================
--- (empty file)
+++ rtir/branches/1.1/lib/RT/Action/RTIR_SetInvestigationState.pm	Fri Sep 17 02:13:35 2004
@@ -0,0 +1,102 @@
+# {{{ 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_SetInvestigationState;
+require RT::Action::Generic;
+
+use strict;
+use vars qw/@ISA/;
+ at ISA = qw(RT::Action::Generic);
+
+=head2 Prepare
+
+Always run this.
+
+=cut
+
+
+sub Prepare {
+    my $self = shift;
+
+    return 1;
+}
+
+# {{{ sub Commit
+
+=head2 Commit
+
+Set the Block state.
+
+=cut
+
+sub Commit {
+    my $self = shift;
+
+    my $State;
+    my $cf = RT::CustomField->new($self->TransactionObj->CurrentUser);
+    $cf->LoadByNameAndQueue(Queue => $self->TicketObj->QueueObj->Id, Name => '_RTIR_State');
+    unless ($cf->Id) { 
+	return(1);
+    }
+    if ($self->TicketObj->Status eq 'open' or $self->TicketObj->Status eq 'new') {
+	$State = 'open';
+    } elsif ($self->TicketObj->Status eq 'resolved') {
+	$State = 'resolved';
+    } else {
+	return 0;
+    }
+    $self->TicketObj->AddCustomFieldValue(Field => $cf->id, Value => $State);
+    return 1;
+}
+
+# }}}
+
+eval "require RT::Action::RTIR_SetInvestigationState_Vendor";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RTIR_SetInvestigationState_Vendor.pm});
+eval "require RT::Action::RTIR_SetInvestigationState_Local";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RTIR_SetInvestigationState_Local.pm});
+
+1;

Added: rtir/branches/1.1/lib/RT/Condition/CustomerResponse.pm
==============================================================================
--- (empty file)
+++ rtir/branches/1.1/lib/RT/Condition/CustomerResponse.pm	Fri Sep 17 02:13:35 2004
@@ -0,0 +1,122 @@
+# {{{ 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::Condition::RTIR_CustomerResponse;
+require RT::Condition::Generic;
+
+use strict;
+use vars qw/@ISA/;
+ at ISA = qw(RT::Condition::Generic);
+
+
+=head2 IsApplicable
+
+If we're changing the owner return true, otherwise return false
+
+=begin testing
+
+my $q = RT::Queue->new($RT::SystemUser);
+$q->Create(Name =>'ownerChangeTest');
+
+ok($q->Id, "Created a scriptest queue");
+
+my $s1 = RT::Scrip->new($RT::SystemUser);
+my ($val, $msg) =$s1->Create( Queue => $q->Id,
+             ScripAction => 'User Defined',
+             ScripCondition => 'On Owner Change',
+             CustomIsApplicableCode => '',
+             CustomPrepareCode => 'return 1',
+             CustomCommitCode => '
+                    $self->TicketObj->SetPriority($self->TicketObj->Priority+1);
+                return(1);
+            ',
+             Template => 'Blank'
+    );
+ok($val,$msg);
+
+my $ticket = RT::Ticket->new($RT::SystemUser);
+my ($tv,$ttv,$tm) = $ticket->Create(Queue => $q->Id,
+                                    Subject => "hair on fire",
+                                    InitialPriority => '20'
+                                    );
+ok($tv, $tm);
+ok($ticket->SetOwner('root'));
+is ($ticket->Priority , '21', "Ticket priority is set right");
+ok($ticket->Steal);
+is ($ticket->Priority , '22', "Ticket priority is set right");
+ok($ticket->Untake);
+is ($ticket->Priority , '23', "Ticket priority is set right");
+ok($ticket->Take);
+is ($ticket->Priority , '24', "Ticket priority is set right");
+
+
+
+
+
+=end testing
+
+
+=cut
+
+sub IsApplicable {
+    my $self = shift;
+    if ($self->TransactionObj->Field eq 'Owner') {
+	return(1);
+    } 
+    else {
+	return(undef);
+    }
+}
+
+eval "require RT::Condition::RTIR_CustomerResponse_Vendor";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/RTIR_CustomerResponse_Vendor.pm});
+eval "require RT::Condition::RTIR_CustomerResponse_Local";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/RTIR_CustomerResponse_Local.pm});
+
+1;
+

Added: rtir/branches/1.1/lib/RT/Condition/RTIR_CloseTicket.pm
==============================================================================
--- (empty file)
+++ rtir/branches/1.1/lib/RT/Condition/RTIR_CloseTicket.pm	Fri Sep 17 02:13:35 2004
@@ -0,0 +1,84 @@
+# {{{ 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::Condition::RTIR_CloseTicket;
+require RT::Condition::Generic;
+
+use strict;
+use vars qw/@ISA/;
+ at ISA = qw(RT::Condition::Generic);
+
+
+=head2 IsApplicable
+
+If the ticket was closed
+
+=cut
+
+sub IsApplicable {
+    my $self = shift;
+
+    if (($self->TransactionObj->Type eq "Status" or
+	 ($self->TransactionObj->Type eq "Set" and 
+	  $self->TransactionObj->Field eq "Status")) and
+	($self->TransactionObj->NewValue eq 'rejected' ||
+	 $self->TransactionObj->NewValue eq 'resolved')) {
+	return 1;
+    } else {
+	return 0;
+    }
+
+}
+
+eval "require RT::Condition::RTIR_CloseTicket_Vendor";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/RTIR_CloseTicket_Vendor.pm});
+eval "require RT::Condition::RTIR_CloseTicket_Local";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/RTIR_CloseTicket_Local.pm});
+
+1;
+

Added: rtir/branches/1.1/lib/RT/Condition/RTIR_CustomerResponse.pm
==============================================================================
--- (empty file)
+++ rtir/branches/1.1/lib/RT/Condition/RTIR_CustomerResponse.pm	Fri Sep 17 02:13:35 2004
@@ -0,0 +1,81 @@
+# {{{ 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::Condition::RTIR_CustomerResponse;
+require RT::Condition::Generic;
+
+use strict;
+use vars qw/@ISA/;
+ at ISA = qw(RT::Condition::Generic);
+
+
+=head2 IsApplicable
+
+If the message was from someone not the owner.
+
+=cut
+
+sub IsApplicable {
+    my $self = shift;
+
+    if ($self->TransactionObj->Type eq 'Correspond' && 
+	$self->TicketObj->Owner ne $self->TransactionObj->Creator) {
+	return 1;
+    } else {
+	return 0;
+    }
+
+}
+
+eval "require RT::Condition::RTIR_CustomerResponse_Vendor";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/RTIR_CustomerResponse_Vendor.pm});
+eval "require RT::Condition::RTIR_CustomerResponse_Local";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/RTIR_CustomerResponse_Local.pm});
+
+1;
+

Added: rtir/branches/1.1/lib/RT/Condition/RTIR_ReopenTicket
==============================================================================
--- (empty file)
+++ rtir/branches/1.1/lib/RT/Condition/RTIR_ReopenTicket	Fri Sep 17 02:13:35 2004
@@ -0,0 +1,85 @@
+# {{{ 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::Condition::RTIR_ReopenTicket;
+require RT::Condition::Generic;
+
+use strict;
+use vars qw/@ISA/;
+ at ISA = qw(RT::Condition::Generic);
+
+
+=head2 IsApplicable
+
+If the ticket was closed
+
+=cut
+
+sub IsApplicable {
+    my $self = shift;
+
+    if (($self->TransactionObj->Type eq "Status" or
+	 ($self->TransactionObj->Type eq "Set" and 
+	  $self->TransactionObj->Field eq "Status")) and
+	(( $self->TransactionObj->OldValue eq 'rejected' ||
+	   $self->TransactionObj->OldValue eq 'resolved') &&
+	 $self->TransactionObj->NewValue eq 'open')) {
+	return 1;
+    } else {
+	return 0;
+    }
+
+}
+
+eval "require RT::Condition::RTIR_ReopenTicket_Vendor";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/RTIR_ReopenTicket_Vendor.pm});
+eval "require RT::Condition::RTIR_ReopenTicket_Local";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/RTIR_ReopenTicket_Local.pm});
+
+1;
+

Added: rtir/branches/1.1/lib/RT/Condition/RTIR_ReopenTicket.pm
==============================================================================
--- (empty file)
+++ rtir/branches/1.1/lib/RT/Condition/RTIR_ReopenTicket.pm	Fri Sep 17 02:13:35 2004
@@ -0,0 +1,85 @@
+# {{{ 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::Condition::RTIR_ReopenTicket;
+require RT::Condition::Generic;
+
+use strict;
+use vars qw/@ISA/;
+ at ISA = qw(RT::Condition::Generic);
+
+
+=head2 IsApplicable
+
+If the ticket was closed
+
+=cut
+
+sub IsApplicable {
+    my $self = shift;
+
+    if (($self->TransactionObj->Type eq "Status" or
+	 ($self->TransactionObj->Type eq "Set" and 
+	  $self->TransactionObj->Field eq "Status")) and
+	(( $self->TransactionObj->OldValue eq 'rejected' ||
+	   $self->TransactionObj->OldValue eq 'resolved') &&
+	 $self->TransactionObj->NewValue eq 'open')) {
+	return 1;
+    } else {
+	return 0;
+    }
+
+}
+
+eval "require RT::Condition::RTIR_ReopenTicket_Vendor";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/RTIR_ReopenTicket_Vendor.pm});
+eval "require RT::Condition::RTIR_ReopenTicket_Local";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/RTIR_ReopenTicket_Local.pm});
+
+1;
+

Added: rtir/branches/1.1/lib/RT/Condition/RTIR_RequireStateChange.pm
==============================================================================
--- (empty file)
+++ rtir/branches/1.1/lib/RT/Condition/RTIR_RequireStateChange.pm	Fri Sep 17 02:13:35 2004
@@ -0,0 +1,85 @@
+# {{{ 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::Condition::RTIR_RequireStateChange;
+require RT::Condition::Generic;
+
+use strict;
+use vars qw/@ISA/;
+ at ISA = qw(RT::Condition::Generic);
+
+
+=head2 IsApplicable
+
+If the ticket was closed
+
+=cut
+
+sub IsApplicable {
+    my $self = shift;
+
+    if ($self->TransactionObj->Type eq "Status" or
+	($self->TransactionObj->Type eq "Set" and 
+	 $self->TransactionObj->Field eq "Status") or
+	$self->TransactionObj->Type eq "Create" or
+	$self->TransactionObj->Type eq "CustomField" or
+	($self->TransactionObj->Type eq "Set" and
+	 $self->TransactionObj->Field eq "Queue")) {
+	return 1;
+    } else {
+	return 0;
+    }
+}
+
+eval "require RT::Condition::RTIR_RequireStateChange_Vendor";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/RTIR_RequireStateChange_Vendor.pm});
+eval "require RT::Condition::RTIR_RequireStateChange_Local";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/RTIR_RequireStateChange_Local.pm});
+
+1;
+


More information about the Rt-commit mailing list