[Rt-commit] r9016 - in rt/branches/3.7-EXPERIMENTAL: . html/Ticket/Elements

sartak at bestpractical.com sartak at bestpractical.com
Wed Sep 12 12:26:06 EDT 2007


Author: sartak
Date: Wed Sep 12 12:26:05 2007
New Revision: 9016

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/PreviewScrips
   rt/branches/3.7-EXPERIMENTAL/html/Ticket/Update.html

Log:
 r42565 at onn:  sartak | 2007-09-12 12:19:20 -0400
 Split parts of PreviewScripts into a SquelchRecipients method, and use it in key checking


Modified: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/PreviewScrips
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/PreviewScrips	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/PreviewScrips	Wed Sep 12 12:26:05 2007
@@ -50,7 +50,51 @@
 
 </%args>
 <%init>
+my ($Object, @non_recipients) = $m->comp('SELF:SquelchRecipients', %ARGS);
+</%init>
+<h2><&|/l&>This message will be sent to...</&></h2>
+
+% if ( $Object ) {
+<i><&|/l&>(Check boxes to disable notifications to the listed recipients)</&></i><br />
 
+% foreach my $scrip (@{$Object->Scrips->Prepared}) {
+% next unless $scrip->ActionObj->Action->isa('RT::Action::SendEmail');
+<b><% $scrip->Description || loc('Scrip #[_1]',$scrip->id) %></b><br />
+<&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name)&>[_1] [_2] with template [_3]</&>
+<br />
+%foreach my $type qw(To Cc Bcc) {
+%my @addresses =  $scrip->ActionObj->Action->$type();
+<ul>
+%foreach my $addr (@addresses) {
+<li> <b><%loc($type)%></b>: <input type="checkbox" class="checkbox" name="Ticket-<%$TicketObj->id%>-SquelchMailTo" value="<%$addr->address%>" /> <%$addr->address%>
+% }
+</ul>
+% }
+% if (RT->Config->Get('PreviewScripMessages')) {
+<textarea cols="80" rows="5">
+<%$scrip->ActionObj->TemplateObj->MIMEObj->as_string%>
+</textarea>
+% }
+% }
+% }
+<br />
+
+<h2><&|/l&>Messages about this ticket will not be sent to...</&></h2>
+<i><&|/l&>(Check boxes to enable notifications to the listed recipients)</&></i>
+<br />
+<ul>
+% foreach my $recipient (@non_recipients) {
+<li><input type="checkbox" class="checkbox" name="Ticket-<%$TicketObj->id%>-UnsquelchMailTo" value="<%$recipient->Content%>" />
+<% $recipient->Content %>
+% }
+</ul>
+<& /Elements/Submit, Value => 'UpdatePreview', Label => loc('Save changes')&>
+
+<%METHOD SquelchRecipients>
+<%ARGS>
+$TicketObj => undef
+</%ARGS>
+<%INIT>
 my $arg = 'Ticket-'.$TicketObj->Id.'-SquelchMailTo';
 my @squelchto = ref($ARGS{$arg}) eq 'ARRAY' ? @{$ARGS{$arg}} : ($ARGS{$arg});
 
@@ -93,45 +137,9 @@
 }
 
 
-my @non_recipients = $TicketObj->SquelchMailTo;
-</%init>
-<h2><&|/l&>This message will be sent to...</&></h2>
-
-% if ( $Object ) {
-<i><&|/l&>(Check boxes to disable notifications to the listed recipients)</&></i><br />
-
-% foreach my $scrip (@{$Object->Scrips->Prepared}) {
-% next unless $scrip->ActionObj->Action->isa('RT::Action::SendEmail');
-<b><% $scrip->Description || loc('Scrip #[_1]',$scrip->id) %></b><br />
-<&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name)&>[_1] [_2] with template [_3]</&>
-<br />
-%foreach my $type qw(To Cc Bcc) {
-%my @addresses =  $scrip->ActionObj->Action->$type();
-<ul>
-%foreach my $addr (@addresses) {
-<li> <b><%loc($type)%></b>: <input type="checkbox" class="checkbox" name="Ticket-<%$TicketObj->id%>-SquelchMailTo" value="<%$addr->address%>" /> <%$addr->address%>
-% }
-</ul>
-% }
-% if (RT->Config->Get('PreviewScripMessages')) {
-<textarea cols="80" rows="5">
-<%$scrip->ActionObj->TemplateObj->MIMEObj->as_string%>
-</textarea>
-% }
-% }
-% }
-<br />
-
-<h2><&|/l&>Messages about this ticket will not be sent to...</&></h2>
-<i><&|/l&>(Check boxes to enable notifications to the listed recipients)</&></i>
-<br />
-<ul>
-% foreach my $recipient (@non_recipients) {
-<li><input type="checkbox" class="checkbox" name="Ticket-<%$TicketObj->id%>-UnsquelchMailTo" value="<%$recipient->Content%>" />
-<% $recipient->Content %>
-% }
-</ul>
-<& /Elements/Submit, Value => 'UpdatePreview', Label => loc('Save changes')&>
+return ($Object, $TicketObj->SquelchMailTo);
+</%INIT>
+</%METHOD>
 
 <%METHOD GetRecipients>
 <%ARGS>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Update.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Ticket/Update.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Update.html	Wed Sep 12 12:26:05 2007
@@ -268,8 +268,6 @@
 }
 # }}}
 
-# XXX: we must apply squelshing here, to get real recipients below
-
 my @results;
 my @gnupg_keys_issues;
 if ( $ARGS{'SubmitTicket'} && $ARGS{'Encrypt'} ) {


More information about the Rt-commit mailing list