[Rt-commit] rt branch, 4.2/squelched-recipients, created. rt-4.2.5-163-gd2923e9
Wallace Reis
wreis at bestpractical.com
Mon Jul 14 18:21:14 EDT 2014
The branch, 4.2/squelched-recipients has been created
at d2923e9b7c9c41b895a3b141f4d6ca82e83da5de (commit)
- Log -----------------------------------------------------------------
commit d2923e9b7c9c41b895a3b141f4d6ca82e83da5de
Author: Wallace Reis <wreis at bestpractical.com>
Date: Mon Jul 14 17:11:32 2014 -0300
Add squelched recipients as preference
User preference to start with squelch checkboxes unchecked/checked on
ticket reply page. This should respect the semi-permanetly squelched
address when applying its logic. If set to true, then the page shows
the checkboxes unchecked - which means the email addresses are *not*
getting any kind of mail.
Additionally, it adds a new config option called $SquelchedRecipients
which allows to set it broadly for all users.
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 09eb3dd..619dafb 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1578,6 +1578,16 @@ detailed breakdown by scrip.
Set($SimplifiedRecipients, 0);
+=item C<$SquelchedRecipients>
+
+If C<$SquelchedRecipients> is set, the checkbox list of who will receive
+B<any> kind of mail on the ticket reply page are displayed initially as
+B<un>checked - which means nobody in that list would get any mail.
+
+=cut
+
+Set($SquelchedRecipients, 0);
+
=item C<$HideResolveActionsWithDependencies>
If set to 1, this option will skip ticket menu actions which can't be
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 7c75d0e..658f88b 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -455,10 +455,19 @@ our %META;
Description => "Show simplified recipient list on ticket update", #loc
},
},
+ SquelchedRecipients => {
+ Section => 'Ticket display', #loc
+ Overridable => 1,
+ SortOrder => 8,
+ Widget => '/Widgets/Form/Boolean',
+ WidgetArguments => {
+ Description => "Start with squelch checkboxes unchecked/checked on ticket update", #loc
+ },
+ },
DisplayTicketAfterQuickCreate => {
Section => 'Ticket display',
Overridable => 1,
- SortOrder => 8,
+ SortOrder => 9,
Widget => '/Widgets/Form/Boolean',
WidgetArguments => {
Description => 'Display ticket after "Quick Create"', #loc
@@ -467,7 +476,7 @@ our %META;
QuoteFolding => {
Section => 'Ticket display',
Overridable => 1,
- SortOrder => 9,
+ SortOrder => 10,
Widget => '/Widgets/Form/Boolean',
WidgetArguments => {
Description => 'Enable quote folding?' # loc
diff --git a/share/html/Ticket/Elements/PreviewScrips b/share/html/Ticket/Elements/PreviewScrips
index 973fe0d..7de47cc 100644
--- a/share/html/Ticket/Elements/PreviewScrips
+++ b/share/html/Ticket/Elements/PreviewScrips
@@ -75,9 +75,11 @@ my %squelched = ProcessTransactionSquelching( \%ARGS );
% my @addresses = $scrip->ActionObj->Action->$type();
% next unless @addresses;
<ul>
+% my $squelched_recipients = RT->Config->Get('SquelchedRecipients', $session{'CurrentUser'});
% for my $addr (@addresses) {
<li>
% my $checked = not $squelched{$addr->address};
+% $checked = $checked ? not $squelched_recipients : $checked;
% $m->callback(CallbackName => 'BeforeAddress', Ticket => $TicketObj, Address => $addr, Type => $type, Checked => \$checked);
% $recips{$addr->address}++;
<b><%loc($type)%></b>: <input type="checkbox" class="checkbox" name="TxnSendMailTo" <% $checked ? 'checked="checked"' : '' |n%> value="<%$addr->address%>" id="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>" />
diff --git a/share/html/Ticket/Elements/ShowSimplifiedRecipients b/share/html/Ticket/Elements/ShowSimplifiedRecipients
index bc662b2..e543ec0 100644
--- a/share/html/Ticket/Elements/ShowSimplifiedRecipients
+++ b/share/html/Ticket/Elements/ShowSimplifiedRecipients
@@ -82,8 +82,10 @@ my %squelched = ProcessTransactionSquelching( \%ARGS );
<tr>
<td valign="top"><% $type %>:</td>
<td valign="top">
+% my $squelched_recipients = RT->Config->Get('SquelchedRecipients', $session{'CurrentUser'});
% for my $addr (sort {$a->address cmp $b->address} values %{$headers{$type}}) {
% my $checked = not $squelched{$addr->address};
+% $checked = $checked ? not $squelched_recipients : $checked;
% $m->callback(CallbackName => 'BeforeAddress', Ticket => $TicketObj, Address => $addr, Type => $type, Checked => \$checked);
% $recips{$addr->address}++;
<input type="checkbox" class="checkbox" name="TxnSendMailTo" <% $checked ? 'checked="checked"' : '' |n%> value="<%$addr->address%>" id="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>" />
-----------------------------------------------------------------------
More information about the rt-commit
mailing list