[Bps-public-commit] rt-extension-notificationmatrix branch, master, updated. 0be8fadca337e0793371a886c417c0db8e81d163

Chia-liang Kao clkao at bestpractical.com
Wed Jul 28 07:55:08 EDT 2010


The branch, master has been updated
       via  0be8fadca337e0793371a886c417c0db8e81d163 (commit)
       via  73cc1e1df095595f4ce1107030c6aca1b819328c (commit)
      from  618e72778dea87810983c81903b9a9a323cc8e11 (commit)

Summary of changes:
 lib/RT/Extension/NotificationMatrix.pm             |    8 -----
 lib/RT/Extension/NotificationMatrix/Rule.pm        |    5 +--
 .../NotificationMatrix/Rule/QueueChanged.pm        |   24 +++++++++++++++++
 .../NotificationMatrix/Rule/TicketCommented.pm     |   27 +++++++++++++++++++
 .../NotificationMatrix/Rule/TicketCreated.pm       |   26 ++++++++++++++++++
 .../NotificationMatrix/Rule/TicketResolved.pm      |   27 +++++++++++++++++++
 .../NotificationMatrix/Rule/TicketTaken.pm         |   24 +++++++++++++++++
 .../Rule/TicketUpdatedExternally.pm                |   28 ++++++++++++++++++++
 8 files changed, 158 insertions(+), 11 deletions(-)

- Log -----------------------------------------------------------------
commit 73cc1e1df095595f4ce1107030c6aca1b819328c
Author: Chia-liang Kao <clkao at clkao.org>
Date:   Wed Jul 28 19:56:19 2010 +0800

    Don't need queue names in template names.

diff --git a/lib/RT/Extension/NotificationMatrix.pm b/lib/RT/Extension/NotificationMatrix.pm
index 7049a8c..b6e50e9 100644
--- a/lib/RT/Extension/NotificationMatrix.pm
+++ b/lib/RT/Extension/NotificationMatrix.pm
@@ -51,10 +51,6 @@ message with the first found template of:
 
 =over
 
-=item $QueueName-$RuleName
-
-For example: General-TicketResolved
-
 =item $RuleName
 
 For example: TicketResolved
@@ -70,10 +66,6 @@ first found template of:
 
 =over
 
-=item $QueueName-$RuleName-External
-
-For example: General-TicketResolved-External
-
 =item $RuleName-External
 
 For example: TicketResolved-External
diff --git a/lib/RT/Extension/NotificationMatrix/Rule.pm b/lib/RT/Extension/NotificationMatrix/Rule.pm
index d16aca2..2e42de0 100644
--- a/lib/RT/Extension/NotificationMatrix/Rule.pm
+++ b/lib/RT/Extension/NotificationMatrix/Rule.pm
@@ -79,9 +79,8 @@ sub LoadTemplate {
 
     my $name = ref($self);
     $name =~ s/^RT::Extension::NotificationMatrix::Rule::// or die "unknown rule: $name";
-    my @templates = ($self->TicketObj->QueueObj->Name.'-'.$name, $name);
-    @templates = map { $_.'-External' } @templates if $external;
-    push @templates, $external ? $self->DefaultExternalTemplate : $self->DefaultTemplate;
+    my @templates = $external ? ("$name-External", $self->DefaultExternalTemplate)
+                              : ($name,            $self->DefaultTemplate);
     for my $tname (@templates, 'Transaction') {
         $template->Load($tname);
         last if $template->Id;

commit 0be8fadca337e0793371a886c417c0db8e81d163
Author: Chia-liang Kao <clkao at clkao.org>
Date:   Wed Jul 28 19:56:55 2010 +0800

    document template used by rules.

diff --git a/lib/RT/Extension/NotificationMatrix/Rule/QueueChanged.pm b/lib/RT/Extension/NotificationMatrix/Rule/QueueChanged.pm
index c0c4fcd..cf6e00e 100644
--- a/lib/RT/Extension/NotificationMatrix/Rule/QueueChanged.pm
+++ b/lib/RT/Extension/NotificationMatrix/Rule/QueueChanged.pm
@@ -11,4 +11,28 @@ sub ConditionMatched {
     $self->ScripConditionMatched("On Queue Change");
 }
 
+=head Templates
+
+For external notification, the first template found will be used:
+
+=over
+
+=item QueueChanged
+
+=item Transaction
+
+=back
+
+For internal notification, the first template found will be used:
+
+=over
+
+=item QueueChanged
+
+=item Transaction
+
+=back
+
+=cut
+
 1;
diff --git a/lib/RT/Extension/NotificationMatrix/Rule/TicketCommented.pm b/lib/RT/Extension/NotificationMatrix/Rule/TicketCommented.pm
index 28188f3..e001541 100644
--- a/lib/RT/Extension/NotificationMatrix/Rule/TicketCommented.pm
+++ b/lib/RT/Extension/NotificationMatrix/Rule/TicketCommented.pm
@@ -12,4 +12,31 @@ sub ConditionMatched {
     $self->ScripConditionMatched("On Comment");
 }
 
+=head Templates
+
+For external notification, the first template found will be used:
+
+=over
+
+=item TicketCommented
+
+=item Transaction
+
+=back
+
+For internal notification, the first template found will be used:
+
+=over
+
+=item TicketCommented
+
+=item Admin Comment
+
+=item Transaction
+
+=back
+
+=cut
+
+
 1;
diff --git a/lib/RT/Extension/NotificationMatrix/Rule/TicketCreated.pm b/lib/RT/Extension/NotificationMatrix/Rule/TicketCreated.pm
index d14b596..c387597 100644
--- a/lib/RT/Extension/NotificationMatrix/Rule/TicketCreated.pm
+++ b/lib/RT/Extension/NotificationMatrix/Rule/TicketCreated.pm
@@ -13,4 +13,30 @@ sub ConditionMatched {
     $self->ScripConditionMatched("On Create");
 }
 
+=head Templates
+
+For external notification, the first template found will be used:
+
+=over
+
+=item TicketCreated
+
+=item AutoReply
+
+=item Transaction
+
+=back
+
+For internal notification, the first template found will be used:
+
+=over
+
+=item TicketCreated
+
+=item Transaction
+
+=back
+
+=cut
+
 1;
diff --git a/lib/RT/Extension/NotificationMatrix/Rule/TicketResolved.pm b/lib/RT/Extension/NotificationMatrix/Rule/TicketResolved.pm
index 412971a..f7010ee 100644
--- a/lib/RT/Extension/NotificationMatrix/Rule/TicketResolved.pm
+++ b/lib/RT/Extension/NotificationMatrix/Rule/TicketResolved.pm
@@ -12,4 +12,31 @@ sub ConditionMatched {
     $self->ScripConditionMatched("On Resolve");
 }
 
+=head Templates
+
+For external notification, the first template found will be used:
+
+=over
+
+=item TicketResolved
+
+=item Resolved
+
+=item Transaction
+
+=back
+
+For internal notification, the first template found will be used:
+
+=over
+
+=item TicketResolved
+
+=item Transaction
+
+=back
+
+=cut
+
+
 1;
diff --git a/lib/RT/Extension/NotificationMatrix/Rule/TicketTaken.pm b/lib/RT/Extension/NotificationMatrix/Rule/TicketTaken.pm
index 994f141..b029fde 100644
--- a/lib/RT/Extension/NotificationMatrix/Rule/TicketTaken.pm
+++ b/lib/RT/Extension/NotificationMatrix/Rule/TicketTaken.pm
@@ -13,4 +13,28 @@ sub ConditionMatched {
     return ($txn->Field && $txn->Field eq 'Owner' && $txn->OldValue == $RT::Nobody->Id)
 }
 
+=head Templates
+
+For external notification, the first template found will be used:
+
+=over
+
+=item TicketTaken
+
+=item Transaction
+
+=back
+
+For internal notification, the first template found will be used:
+
+=over
+
+=item TicketTaken
+
+=item Transaction
+
+=back
+
+=cut
+
 1;
diff --git a/lib/RT/Extension/NotificationMatrix/Rule/TicketUpdatedExternally.pm b/lib/RT/Extension/NotificationMatrix/Rule/TicketUpdatedExternally.pm
index a438150..c13a905 100644
--- a/lib/RT/Extension/NotificationMatrix/Rule/TicketUpdatedExternally.pm
+++ b/lib/RT/Extension/NotificationMatrix/Rule/TicketUpdatedExternally.pm
@@ -28,4 +28,32 @@ sub ConditionMatched {
     return 1;
 }
 
+=head Templates
+
+For external notification, the first template found will be used:
+
+=over
+
+=item TicketUpdatedExternally
+
+=item Correspondence
+
+=item Transaction
+
+=back
+
+For internal notification, the first template found will be used:
+
+=over
+
+=item TicketUpdatedExternally
+
+=item Admin Correspondence
+
+=item Transaction
+
+=back
+
+=cut
+
 1;

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



More information about the Bps-public-commit mailing list