[Rt-commit] r8662 - rtir/branches/2.3-EXPERIMENTAL/lib/RT/Condition

ruz at bestpractical.com ruz at bestpractical.com
Tue Aug 21 06:49:57 EDT 2007


Author: ruz
Date: Tue Aug 21 06:49:54 2007
New Revision: 8662

Modified:
   rtir/branches/2.3-EXPERIMENTAL/lib/RT/Condition/RTIR_CustomerResponse.pm
   rtir/branches/2.3-EXPERIMENTAL/lib/RT/Condition/RTIR_StaffResponse.pm

Log:
* switch conditions to IsStaff

Modified: rtir/branches/2.3-EXPERIMENTAL/lib/RT/Condition/RTIR_CustomerResponse.pm
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/lib/RT/Condition/RTIR_CustomerResponse.pm	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/lib/RT/Condition/RTIR_CustomerResponse.pm	Tue Aug 21 06:49:54 2007
@@ -43,16 +43,21 @@
 # those contributions and any derivatives thereof.
 # 
 # }}} END BPS TAGGED BLOCK
- 
-
 
 package RT::Condition::RTIR_CustomerResponse;
 
-
 use strict;
+use warnings;
 
 use base 'RT::Condition::RTIR';
 
+=head1 NAME
+
+RT::Condition::RTIR_CustomerResponse - check for customers corresponds
+
+=head1 DESCRIPTION
+
+=head1 METHODS
 
 =head2 IsApplicable
 
@@ -63,13 +68,11 @@
 sub IsApplicable {
     my $self = shift;
 
-    if ($self->TransactionObj->Type eq 'Correspond' && 
-        $self->TicketObj->Owner ne $self->TransactionObj->Creator) {
-        return 1;
-    } else {
-        return 0;
-    }
+    # we're interested in corresponds only
+    return 0 unless $self->TransactionObj->Type eq 'Correspond';
 
+    # and reply not from staff member
+    return !$self->IsStaff;
 }
 
 eval "require RT::Condition::RTIR_CustomerResponse_Vendor";
@@ -78,4 +81,3 @@
 die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/RTIR_CustomerResponse_Local.pm});
 
 1;
-

Modified: rtir/branches/2.3-EXPERIMENTAL/lib/RT/Condition/RTIR_StaffResponse.pm
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/lib/RT/Condition/RTIR_StaffResponse.pm	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/lib/RT/Condition/RTIR_StaffResponse.pm	Tue Aug 21 06:49:54 2007
@@ -63,13 +63,11 @@
 sub IsApplicable {
     my $self = shift;
 
-    if ($self->TransactionObj->Type eq 'Correspond' && 
-        $self->TicketObj->Owner eq $self->TransactionObj->Creator) {
-        return 1;
-    } else {
-        return 0;
-    }
+    # we're interested in corresponds only
+    return 0 unless $self->TransactionObj->Type eq 'Correspond';
 
+    # and reply from staff member
+    return $self->IsStaff;
 }
 
 eval "require RT::Condition::RTIR_StaffResponse_Vendor";


More information about the Rt-commit mailing list