[Bps-public-commit] rt-extension-notificationmatrix branch, master, updated. 3f63b35580865887682b89999f583c7ae31dd759

Jesse Vincent jesse at bestpractical.com
Wed Sep 1 15:27:28 EDT 2010


The branch, master has been updated
       via  3f63b35580865887682b89999f583c7ae31dd759 (commit)
       via  dcc96b883daa36116fab2d8418d574fe4191ecea (commit)
       via  b6d544731cae8d6e671fa0abd346c6d889632b9a (commit)
       via  311c5e68c2f52f2ab311752ad4db94b94cafc832 (commit)
       via  d59b82dda3866cafafdac12caa4871d0fac167fd (commit)
       via  d23039a5a1009fb63a001f6a4fce50335ac005fb (commit)
      from  adb914a668edae29582194c8d1057bd52b56572b (commit)

Summary of changes:
 MANIFEST                                    |    1 +
 lib/RT/Extension/NotificationMatrix.pm      |    2 +-
 lib/RT/Extension/NotificationMatrix/Rule.pm |    4 ++-
 t/basic.t                                   |   49 ++++++++++++++++++++++----
 4 files changed, 46 insertions(+), 10 deletions(-)

- Log -----------------------------------------------------------------
commit d23039a5a1009fb63a001f6a4fce50335ac005fb
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Aug 31 14:21:49 2010 -0400

    manifest update

diff --git a/MANIFEST b/MANIFEST
index 8295689..7f7d237 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -14,6 +14,7 @@ lib/RT/Extension/NotificationMatrix/Rule.pm
 lib/RT/Extension/NotificationMatrix/Rule/QueueChanged.pm
 lib/RT/Extension/NotificationMatrix/Rule/TicketCommented.pm
 lib/RT/Extension/NotificationMatrix/Rule/TicketCreated.pm
+lib/RT/Extension/NotificationMatrix/Rule/TicketRepliedTo.pm
 lib/RT/Extension/NotificationMatrix/Rule/TicketResolved.pm
 lib/RT/Extension/NotificationMatrix/Rule/TicketTaken.pm
 lib/RT/Extension/NotificationMatrix/Rule/TicketUpdatedExternally.pm

commit d59b82dda3866cafafdac12caa4871d0fac167fd
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Aug 31 14:21:58 2010 -0400

    1.7

diff --git a/lib/RT/Extension/NotificationMatrix.pm b/lib/RT/Extension/NotificationMatrix.pm
index 407d9f9..5418b61 100644
--- a/lib/RT/Extension/NotificationMatrix.pm
+++ b/lib/RT/Extension/NotificationMatrix.pm
@@ -2,7 +2,7 @@ use warnings;
 use strict;
 
 package RT::Extension::NotificationMatrix;
-our $VERSION = '1.6';
+our $VERSION = '1.7';
 
 RT::Ruleset->Add(
     Name => 'NotificationMatrix',

commit 311c5e68c2f52f2ab311752ad4db94b94cafc832
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Sep 1 15:26:22 2010 -0400

    Add autoreply tests

diff --git a/t/basic.t b/t/basic.t
index 0725f02..36cc31c 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -10,7 +10,7 @@ BEGIN {
 }
 
 use RT;
-use RT::Test tests => 23;
+use RT::Test tests => 26;
 use RT::Test::Email;
 RT->Config->Set( LogToScreen => 'debug' );
 RT->Config->Set('Plugins',qw(RT::Extension::NotificationMatrix));
@@ -39,7 +39,7 @@ for my $user_name (qw(user_a user_b user_c)) {
     my $user = $users{$user_name} = RT::User->new($RT::SystemUser);
     $user->Create( Name => uc($user_name),
                    Privileged => 1,
-                   EmailAddress => $user_name.'@company.com');
+                   EmailAddress => $user_name.'@example.com');
 }
 
 my $q = RT::Queue->new($RT::SystemUser);
@@ -134,11 +134,11 @@ mail_ok {
                );
     ok($tid);
 } { from => qr'USER_B via RT',
-    bcc => 'user_a at company.com, user_b at company.com', # from ticket created: group_a
+    bcc => 'user_a at example.com, user_b at example.com', # from ticket created: group_a
     subject => qr/a test/,
     body => qr/Transaction: Ticket created by USER_B/,
 }, { from => qr'USER_B via RT',
-    to => 'user_b at company.com',
+    to => 'user_b at example.com',
     subject => qr/a test/,
     body => qr/automatically generated in response/,
 };
@@ -147,7 +147,7 @@ mail_ok {
     my ($res, $msg) = $t->SetOwner($users{user_b});
     ok($res, $msg);
 } { from => qr'USER_B via RT',
-    bcc => 'user_b at company.com, user_c at company.com', # from ticket taken: group_b
+    bcc => 'user_b at example.com, user_c at example.com', # from ticket taken: group_b
     subject => qr/a test/,
     body => qr/Given to USER_B/,
 };
@@ -172,7 +172,7 @@ mail_ok {
     my ($res, $msg) = $t2->Correspond(Content => "foobar");
     ok($res, $msg);
 } { from => qr'USER_A via RT',
-    to => 'user_b at company.com',
+    to => 'user_b at example.com',
     subject => qr/a test/,
     body => qr/foobar/,
 };
@@ -196,7 +196,7 @@ mail_ok {
     my ($res, $msg) = $t2->Comment(Content => "foobar");
     ok($res, $msg);
 } { from => qr'USER_A via RT',
-    bcc => 'user_b at company.com, user_c at company.com',
+    bcc => 'user_b at example.com, user_c at example.com',
     subject => qr/a test/,
     body => qr/foobar/,
 };
@@ -212,12 +212,46 @@ mail_ok {
     my ($res, $msg) = $t2->Comment(Content => "foobar");
     ok($res, $msg);
 } { from => qr'USER_B via RT',
-    bcc => 'user_c at company.com',
+    bcc => 'user_c at example.com',
     subject => qr/a test/,
     body => qr/foobar/,
 };
 
 
+warn "Requestor gorup is ".$requestors->id;
+$matrix = { TicketCreated => [ $requestors->id ],
+           };
+
+$q->SetAttribute(Name => 'NotificationMatrix',
+                 Description => 'Notification Matrix Internal Data',
+                 Content => $matrix);
+
+
+
+mail_ok {
+    my $cu = RT::CurrentUser->new;
+    $cu->Load( $users{user_b} );
+    $t->SetCurrentUser($cu);
+    my $t2 = RT::Ticket->new($cu);
+    my ($res, $txn, $msg) = $t2->Create(Subject =>'new request', MIMEObj => MIME::Entity->build(Data =>"foo bar"),
+                    Requestor => $cu->EmailAddress,
+                   Queue => $q->Id,
+                   
+
+    
+    );
+    ok($res, $msg);
+} { from => qr'USER_B via RT',
+    bcc => 'user_c at example.com',
+    subject => qr/new request/,
+    subject => qr/AutoReply/,
+    body => qr/foo bar/,
+};
+
+
+
+
+
 #my ($baseurl, $m) = RT::Test->started_ok;
 
 #diag "$baseurl/?user=root&pass=password"; sleep 1 while 1;

commit b6d544731cae8d6e671fa0abd346c6d889632b9a
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Sep 1 15:29:17 2010 -0400

    further test corrections

diff --git a/t/basic.t b/t/basic.t
index 36cc31c..7f2cc1b 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -218,7 +218,6 @@ mail_ok {
 };
 
 
-warn "Requestor gorup is ".$requestors->id;
 $matrix = { TicketCreated => [ $requestors->id ],
            };
 
@@ -242,7 +241,7 @@ mail_ok {
     );
     ok($res, $msg);
 } { from => qr'USER_B via RT',
-    bcc => 'user_c at example.com',
+    to => 'user_b at example.com',
     subject => qr/new request/,
     subject => qr/AutoReply/,
     body => qr/foo bar/,

commit dcc96b883daa36116fab2d8418d574fe4191ecea
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Sep 1 15:29:30 2010 -0400

    On Autoreply, we DO want to notify the owner

diff --git a/lib/RT/Extension/NotificationMatrix/Rule.pm b/lib/RT/Extension/NotificationMatrix/Rule.pm
index 4d2865f..aafa626 100644
--- a/lib/RT/Extension/NotificationMatrix/Rule.pm
+++ b/lib/RT/Extension/NotificationMatrix/Rule.pm
@@ -160,7 +160,9 @@ sub _PrepareSendEmail {
         }
     }
 
-    if (!RT->Config->Get('NotifyActor')) {
+    # Don't notify the actor unless it's the autoreply.
+    if (!RT->Config->Get('NotifyActor') && 
+        !$self->isa('RT::Extension::NotificationMatrix::Rule::TicketCreated')) {
         my $creatorObj = $self->TransactionObj->CreatorObj;
         my $creator = $creatorObj->EmailAddress() || '';
         @{ $email->{$_} }  = grep ( lc $_ ne lc $creator, @{ $email->{$_} } )

commit 3f63b35580865887682b89999f583c7ae31dd759
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Sep 1 15:30:01 2010 -0400

    1.8

diff --git a/lib/RT/Extension/NotificationMatrix.pm b/lib/RT/Extension/NotificationMatrix.pm
index 5418b61..e9e305e 100644
--- a/lib/RT/Extension/NotificationMatrix.pm
+++ b/lib/RT/Extension/NotificationMatrix.pm
@@ -2,7 +2,7 @@ use warnings;
 use strict;
 
 package RT::Extension::NotificationMatrix;
-our $VERSION = '1.7';
+our $VERSION = '1.8';
 
 RT::Ruleset->Add(
     Name => 'NotificationMatrix',

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list