[Rt-commit] rt branch, 3.8-trunk, updated. rt-3.8.8-109-g6d14f53
Chia-liang Kao
clkao at bestpractical.com
Wed Jul 7 05:48:39 EDT 2010
The branch, 3.8-trunk has been updated
via 6d14f5351a5d8e479457d11c23abf7faab586f85 (commit)
via 2938e1110a8af7c72de8c07819b492000e1562b4 (commit)
from 5cc73752fcb4116f599fa05aa5bcfa54406455cb (commit)
Summary of changes:
lib/RT/Transaction_Overlay.pm | 18 +++++++++++++++++-
share/html/Ticket/Elements/PreviewScrips | 20 ++++++++++++++++++++
2 files changed, 37 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit 2938e1110a8af7c72de8c07819b492000e1562b4
Author: Chia-liang Kao <clkao at bestpractical.com>
Date: Wed Jul 7 17:40:48 2010 +0800
Provide rules reader for RT::Transaction.
diff --git a/lib/RT/Transaction_Overlay.pm b/lib/RT/Transaction_Overlay.pm
index c1821bc..1db19be 100755
--- a/lib/RT/Transaction_Overlay.pm
+++ b/lib/RT/Transaction_Overlay.pm
@@ -176,7 +176,7 @@ sub Create {
# Entry point of the rule system
my $ticket = RT::Ticket->new($RT::SystemUser);
$ticket->Load($args{'ObjectId'});
- my $rules = RT::Ruleset->FindAllRules(
+ my $rules = $self->{rules} = RT::Ruleset->FindAllRules(
Stage => 'TransactionCreate',
Type => $args{'Type'},
TicketObj => $ticket,
@@ -211,6 +211,22 @@ sub Scrips {
}
+=head2 Rules
+
+Returns the array of Rule objects for this transaction.
+This routine is only useful on a freshly created transaction object.
+Rules do not get persisted to the database with transactions.
+
+
+=cut
+
+
+sub Rules {
+ my $self = shift;
+ return($self->{'rules'});
+}
+
+
# {{{ sub Delete
=head2 Delete
commit 6d14f5351a5d8e479457d11c23abf7faab586f85
Author: Chia-liang Kao <clkao at bestpractical.com>
Date: Wed Jul 7 17:45:47 2010 +0800
preview recipients for rule-based sendemail actions.
diff --git a/share/html/Ticket/Elements/PreviewScrips b/share/html/Ticket/Elements/PreviewScrips
index d376f5d..06f098b 100755
--- a/share/html/Ticket/Elements/PreviewScrips
+++ b/share/html/Ticket/Elements/PreviewScrips
@@ -84,6 +84,26 @@ my @non_recipients = @{ $squelch{'EmailAddresses'} };
% }
% }
% }
+
+% if ( $Object and $Object->Rules ) {
+% for my $rule (@{$Object->Rules}) {
+% next unless $rule->{hints} && $rule->{hints}{class} eq 'SendEmail';
+<b><% $rule->Describe %></b>
+% my $data = $rule->{hints}{recipients};
+% foreach my $type qw(To Cc Bcc) {
+<ul>
+% foreach my $address (@{$data->{$type}}) {
+<li>
+ <b><%loc($type)%></b>: <input type="checkbox" class="checkbox" name="Ticket-<%$TicketObj->id%>-SquelchMailTo" value="<%$address%>" /> <%$address%>
+
+% $m->callback(CallbackName => 'AfterAddress', Ticket => $TicketObj, Address => Email::Address->parse($address), Type => $type);
+</li>
+% }
+</ul>
+
+% }
+% }
+% }
<br />
<h2><&|/l&>Messages about this ticket will not be sent to...</&></h2>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list