[Rt-commit] rt branch, 4.4/squelching-all, created. rt-4.2.5-196-g5ff6521

Wallace Reis wreis at bestpractical.com
Tue Aug 19 18:39:06 EDT 2014


The branch, 4.4/squelching-all has been created
        at  5ff652157249adffeb1660fd88ea7adce6c00fbd (commit)

- Log -----------------------------------------------------------------
commit fd9449ac8de698a9d1d08a17a9bbbd53fe0836f7
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-permanently 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 38dfc52..dbcd8e3 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1583,6 +1583,17 @@ 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. It
+does not affect correspondence done via email yet.
+
+=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 6126aad..6317db6 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -459,10 +459,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 => "Default to squelching all outgoing email notifications (from web interface) 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
@@ -471,7 +480,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/Helpers/PreviewScrips b/share/html/Helpers/PreviewScrips
index a27c8f7..5e0ad65 100644
--- a/share/html/Helpers/PreviewScrips
+++ b/share/html/Helpers/PreviewScrips
@@ -76,6 +76,9 @@ my %recips;
 $m->abort unless @dryrun;
 
 my %squelched = ProcessTransactionSquelching( \%ARGS );
+my $squelched_config = !( RT->Config->Get('SquelchedRecipients', $session{'CurrentUser'}) );
+my %submitted;
+$submitted{$_} = 1 for split /,/, $ARGS{TxnRecipients};
 </%init>
 <p>
 <&|/l, RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$TicketObj->Id,
@@ -96,7 +99,7 @@ my %squelched = ProcessTransactionSquelching( \%ARGS );
               <ul>
 %             for my $addr (@addresses) {
                   <li>
-%                 my $checked = not $squelched{$addr->address};
+%                 my $checked = $submitted{$addr->address} ? not $squelched{$addr->address} : $squelched_config;
 %                 $m->callback(CallbackName => 'BeforeAddress', Ticket => $TicketObj, Address => $addr, Type => $type, Checked => \$checked);
 %                 $recips{$addr->address}++;
                   <b><%loc($type)%></b>:
diff --git a/share/html/Helpers/ShowSimplifiedRecipients b/share/html/Helpers/ShowSimplifiedRecipients
index 4c6b60c..8f84857 100644
--- a/share/html/Helpers/ShowSimplifiedRecipients
+++ b/share/html/Helpers/ShowSimplifiedRecipients
@@ -94,6 +94,9 @@ if (@scrips) {
 }
 my %recips;
 my %squelched = ProcessTransactionSquelching( \%ARGS );
+my $squelched_config = !( RT->Config->Get('SquelchedRecipients', $session{'CurrentUser'}) );
+my %submitted;
+$submitted{$_} = 1 for split /,/, $ARGS{TxnRecipients};
 </%init>
 <table>
 % for my $type (qw(To Cc Bcc)) {
@@ -102,7 +105,7 @@ my %squelched = ProcessTransactionSquelching( \%ARGS );
 <td valign="top"><% $type %>:</td>
 <td valign="top">
 %     for my $addr (sort {$a->address cmp $b->address} values %{$headers{$type}}) {
-%         my $checked = not $squelched{$addr->address};
+%         my $checked = $submitted{$addr->address} ? not $squelched{$addr->address} : $squelched_config;
 %         $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} %>" />

commit a5840864b420852e815dc30bb232b92df94057e5
Author: Wallace Reis <wreis at bestpractical.com>
Date:   Tue Jul 15 18:48:09 2014 -0300

    'Select All' checkbox for scrips correspondences/comments
    
    At ticket reply page, we have the option to select/deselect who in the
    list of people should receive a copy of the reply/comment. This aims to
    add an 'all' checkbox which can select/deselect all of them at once.

diff --git a/share/html/Helpers/PreviewScrips b/share/html/Helpers/PreviewScrips
index 5e0ad65..3592a94 100644
--- a/share/html/Helpers/PreviewScrips
+++ b/share/html/Helpers/PreviewScrips
@@ -88,6 +88,14 @@ $submitted{$_} = 1 for split /,/, $ARGS{TxnRecipients};
 % my @scrips = grep {$_->ActionObj->Action->isa('RT::Action::SendEmail')}
 %              map {@{$_->Scrips->Prepared}} @dryrun;
 % if (@scrips) {
+%   if ( grep {
+%          my $s = $_;
+%          my $action = $s->ActionObj->Action;
+%          scalar(map { $action->$_ } qw(To Cc Bcc))
+%        } @scrips ) {
+<input type="checkbox" class="checkbox" name="TxnSendMailToAll" value="1" <% $all_checkbox | n %> onclick="setCheckbox(this,'TxnSendMailTo')">
+<label for="TxnSendMailToAll"><b><% loc('All recipients') %></b></label><br />
+%   }
 %     for my $scrip (@scrips) {
           <b><% $scrip->Description || loc('Scrip #[_1]',$scrip->id) %></b><br />
           <&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->Template)&>[_1] [_2] with template [_3]</&>
diff --git a/share/html/Helpers/ShowSimplifiedRecipients b/share/html/Helpers/ShowSimplifiedRecipients
index 8f84857..b6b1dac 100644
--- a/share/html/Helpers/ShowSimplifiedRecipients
+++ b/share/html/Helpers/ShowSimplifiedRecipients
@@ -99,6 +99,15 @@ my %submitted;
 $submitted{$_} = 1 for split /,/, $ARGS{TxnRecipients};
 </%init>
 <table>
+%   if ( scalar(map { keys %{$headers{$_}} } qw(To Cc Bcc)) ) {
+<tr>
+<td> </td>
+<td>
+<input type="checkbox" class="checkbox" name="TxnSendMailToAll" value="1" <% $all_checkbox | n %> onclick="setCheckbox(this,'TxnSendMailTo')">
+<label for="TxnSendMailToAll"><b><% loc('All recipients') %></b></label>
+</td>
+</tr>
+% }
 % for my $type (qw(To Cc Bcc)) {
 %     next unless keys %{$headers{$type}} or keys %{$no_squelch{$type}};
 <tr>
diff --git a/share/static/js/util.js b/share/static/js/util.js
index b665c0e..1636cbf 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -82,6 +82,8 @@ function set_rollup_state(e,e2,state) {
 
 function setCheckbox(input, name, val) {
     if (val == null) val = input.checked;
+    var allfield = jQuery('input[name=' + input.name + ']');
+    allfield.prop('checked', val);
 
     // Find inputs within the current form or collection list, whichever is closest.
     var container = jQuery(input).closest("form, table.collection-as-table").get(0);

commit 896ee7af8d813555b7831edb1a4ab298c6ff3381
Author: Wallace Reis <wreis at bestpractical.com>
Date:   Mon Jul 21 10:01:11 2014 -0300

    Make 'select all' check/uncheck bi-directional
    
    If I uncheck "All $thing", and then I re-check all of the items by hand,
    then "All $thing" pops back to being checked as soon as I re-checked
    the last item.

diff --git a/share/html/Helpers/PreviewScrips b/share/html/Helpers/PreviewScrips
index 3592a94..26061e3 100644
--- a/share/html/Helpers/PreviewScrips
+++ b/share/html/Helpers/PreviewScrips
@@ -117,9 +117,8 @@ $submitted{$_} = 1 for split /,/, $ARGS{TxnRecipients};
 %                 }
 
 %                 if ( $show_checkbox ) {
-                      <input type="checkbox" class="checkbox" name="TxnSendMailTo" <% $checked ? 'checked="checked"' : '' |n%> value="<%$addr->address%>" id="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>" />
+                      <input type="checkbox" class="checkbox" name="TxnSendMailTo" <% $checked ? 'checked="checked"' : '' |n%> value="<%$addr->address%>" id="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>" onclick="checkboxSetEvent(this)" />
 %                 }
-
                   <label for="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>"><& /Elements/ShowUser, Address => $addr &></label>
 %                 $m->callback(CallbackName => 'AfterAddress', Ticket => $TicketObj, Address => $addr, Type => $type);
 %                 unless ( $show_checkbox ) {
diff --git a/share/html/Helpers/ShowSimplifiedRecipients b/share/html/Helpers/ShowSimplifiedRecipients
index b6b1dac..b801e87 100644
--- a/share/html/Helpers/ShowSimplifiedRecipients
+++ b/share/html/Helpers/ShowSimplifiedRecipients
@@ -117,7 +117,7 @@ $submitted{$_} = 1 for split /,/, $ARGS{TxnRecipients};
 %         my $checked = $submitted{$addr->address} ? not $squelched{$addr->address} : $squelched_config;
 %         $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} %>" />
+<input type="checkbox" class="checkbox" name="TxnSendMailTo" <% $checked ? 'checked="checked"' : '' |n%> value="<%$addr->address%>" id="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>" onclick="checkboxSetEvent(this)" />
 <label for="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>"><& /Elements/ShowUser, Address => $addr &></label>
 %         $m->callback(CallbackName => 'AfterAddress', Ticket => $TicketObj, Address => $addr, Type => $type);
 <br />
diff --git a/share/static/js/util.js b/share/static/js/util.js
index 1636cbf..9f93721 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -80,14 +80,18 @@ function set_rollup_state(e,e2,state) {
 
 /* other utils */
 
+function getClosestInputElements(input) {
+    // Find inputs within the current form or collection list, whichever is closest.
+    var container = jQuery(input).closest("form, table.collection-as-table").get(0);
+    return container.getElementsByTagName('input');
+}
+
 function setCheckbox(input, name, val) {
     if (val == null) val = input.checked;
     var allfield = jQuery('input[name=' + input.name + ']');
     allfield.prop('checked', val);
 
-    // Find inputs within the current form or collection list, whichever is closest.
-    var container = jQuery(input).closest("form, table.collection-as-table").get(0);
-    var myfield   = container.getElementsByTagName('input');
+    var myfield = getClosestInputElements(input);
     for ( var i = 0; i < myfield.length; i++ ) {
         if ( myfield[i].type != 'checkbox' ) continue;
         if ( name ) {
@@ -104,6 +108,38 @@ function setCheckbox(input, name, val) {
     }
 }
 
+function checkboxSetEvent(input) {
+    var name = input.name;
+    var myfield = getClosestInputElements(input);
+    var checked_count = 0;
+    var field_count = 0;
+    for ( var i = 0; i < myfield.length; i++ ) {
+        if ( myfield[i].type != 'checkbox' ) continue;
+        if ( name ) {
+            if ( name instanceof RegExp ) {
+                if ( ! myfield[i].name.match( name ) ) continue;
+            }
+            else {
+                if ( myfield[i].name != name ) continue;
+            }
+
+        }
+
+        field_count++;
+        if ( myfield[i].checked ) {
+            checked_count++;
+        }
+    }
+
+    var allfield = jQuery('input[name=' + name + 'All' + ']');
+    if (field_count == checked_count) {
+        allfield.prop('checked', true);
+    }
+    else {
+        allfield.prop('checked', false);
+    }
+}
+
 /* apply callback to nodes or elements */
 
 function walkChildNodes(parent, callback)

commit 5a29b26438a469de47a3a4974385efb622cf462c
Author: Wallace Reis <wreis at bestpractical.com>
Date:   Fri Aug 8 16:33:02 2014 -0300

    Merge checkbox click event handlers
    
    Merge "setCheckbox" and "checkboxSetEvent" handlers into single one
    function which sets up everything bi-directionally (on both the "All"
    checkbox, as well as the individual ones).

diff --git a/share/html/Helpers/PreviewScrips b/share/html/Helpers/PreviewScrips
index 26061e3..8ea1382 100644
--- a/share/html/Helpers/PreviewScrips
+++ b/share/html/Helpers/PreviewScrips
@@ -117,7 +117,7 @@ $submitted{$_} = 1 for split /,/, $ARGS{TxnRecipients};
 %                 }
 
 %                 if ( $show_checkbox ) {
-                      <input type="checkbox" class="checkbox" name="TxnSendMailTo" <% $checked ? 'checked="checked"' : '' |n%> value="<%$addr->address%>" id="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>" onclick="checkboxSetEvent(this)" />
+                      <input type="checkbox" class="checkbox" name="TxnSendMailTo" <% $checked ? 'checked="checked"' : '' |n%> value="<%$addr->address%>" id="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>" onclick="setCheckbox(this)" />
 %                 }
                   <label for="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>"><& /Elements/ShowUser, Address => $addr &></label>
 %                 $m->callback(CallbackName => 'AfterAddress', Ticket => $TicketObj, Address => $addr, Type => $type);
diff --git a/share/html/Helpers/ShowSimplifiedRecipients b/share/html/Helpers/ShowSimplifiedRecipients
index b801e87..bfef62b 100644
--- a/share/html/Helpers/ShowSimplifiedRecipients
+++ b/share/html/Helpers/ShowSimplifiedRecipients
@@ -117,7 +117,7 @@ $submitted{$_} = 1 for split /,/, $ARGS{TxnRecipients};
 %         my $checked = $submitted{$addr->address} ? not $squelched{$addr->address} : $squelched_config;
 %         $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} %>" onclick="checkboxSetEvent(this)" />
+<input type="checkbox" class="checkbox" name="TxnSendMailTo" <% $checked ? 'checked="checked"' : '' |n%> value="<%$addr->address%>" id="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>" onclick="setCheckbox(this)" />
 <label for="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>"><& /Elements/ShowUser, Address => $addr &></label>
 %         $m->callback(CallbackName => 'AfterAddress', Ticket => $TicketObj, Address => $addr, Type => $type);
 <br />
diff --git a/share/static/js/util.js b/share/static/js/util.js
index 9f93721..8416853 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -88,31 +88,20 @@ function getClosestInputElements(input) {
 
 function setCheckbox(input, name, val) {
     if (val == null) val = input.checked;
-    var allfield = jQuery('input[name=' + input.name + ']');
-    allfield.prop('checked', val);
 
-    var myfield = getClosestInputElements(input);
-    for ( var i = 0; i < myfield.length; i++ ) {
-        if ( myfield[i].type != 'checkbox' ) continue;
-        if ( name ) {
-            if ( name instanceof RegExp ) {
-                if ( ! myfield[i].name.match( name ) ) continue;
-            }
-            else {
-                if ( myfield[i].name != name ) continue;
-            }
-
-        }
-
-        myfield[i].checked = val;
+    var is_set_event = false;
+    if ( !name ) {
+        name = input.name;
+        is_set_event = true;
+    }
+    else {
+        var allfield = jQuery('input[name=' + input.name + ']');
+        allfield.prop('checked', val);
     }
-}
 
-function checkboxSetEvent(input) {
-    var name = input.name;
-    var myfield = getClosestInputElements(input);
     var checked_count = 0;
     var field_count = 0;
+    var myfield = getClosestInputElements(input);
     for ( var i = 0; i < myfield.length; i++ ) {
         if ( myfield[i].type != 'checkbox' ) continue;
         if ( name ) {
@@ -125,18 +114,25 @@ function checkboxSetEvent(input) {
 
         }
 
-        field_count++;
-        if ( myfield[i].checked ) {
-            checked_count++;
+        if ( is_set_event ) {
+            field_count++;
+            if ( myfield[i].checked ) {
+                checked_count++;
+            }
+        }
+        else {
+            myfield[i].checked = val;
         }
     }
 
-    var allfield = jQuery('input[name=' + name + 'All' + ']');
-    if (field_count == checked_count) {
-        allfield.prop('checked', true);
-    }
-    else {
-        allfield.prop('checked', false);
+    if ( is_set_event ) {
+        var allfield = jQuery('input[name=' + name + 'All' + ']');
+        if (field_count == checked_count) {
+            allfield.prop('checked', true);
+        }
+        else {
+            allfield.prop('checked', false);
+        }
     }
 }
 

commit 0d1015e4ac74901fced67e46b04134ac287d0c2f
Author: Wallace Reis <wreis at bestpractical.com>
Date:   Wed Aug 13 08:12:40 2014 -0300

    Ticket update recipient checkboxes
    
    Fix checkboxes sync state when adding one-time Cc.

diff --git a/share/html/Ticket/Update.html b/share/html/Ticket/Update.html
index 039efec..b03bc41 100644
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@ -220,11 +220,19 @@ jQuery( function() {
        };
        jQuery('#recipients div.titlebox-content').load( '<% RT->Config->Get('WebPath')%>/Helpers/ShowSimplifiedRecipients',
            jQuery('form[name=TicketUpdate]').serialize(),
-           function() { jQuery("#recipients input[name=TxnSendMailTo]").change( syncCheckboxes ); }
+           function() {
+               var txn_send_field = jQuery("#recipients input[name=TxnSendMailTo]");
+               txn_send_field.change( syncCheckboxes );
+               setCheckbox(txn_send_field);
+           }
        );
        jQuery('#previewscrips div.titlebox-content').load( '<% RT->Config->Get('WebPath')%>/Helpers/PreviewScrips',
            jQuery('form[name=TicketUpdate]').serialize(),
-           function() { jQuery("#previewscrips input[name=TxnSendMailTo]").change( syncCheckboxes ); }
+           function() {
+               var txn_send_field = jQuery("#previewscrips input[name=TxnSendMailTo]");
+               txn_send_field.change( syncCheckboxes );
+               setCheckbox(txn_send_field);
+           }
        );
    };
    updateScrips();
diff --git a/share/static/js/util.js b/share/static/js/util.js
index 8416853..8be6cae 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -91,7 +91,7 @@ function setCheckbox(input, name, val) {
 
     var is_set_event = false;
     if ( !name ) {
-        name = input.name;
+        name = input.name || input.attr('name');
         is_set_event = true;
     }
     else {

commit 5ff652157249adffeb1660fd88ea7adce6c00fbd
Author: Wallace Reis <wreis at bestpractical.com>
Date:   Wed Aug 13 13:44:42 2014 -0300

    Ticket update recipient checkboxes
    
    Move checkbox click event handler to recipient list load's callback.

diff --git a/share/html/Helpers/PreviewScrips b/share/html/Helpers/PreviewScrips
index 8ea1382..f4379d3 100644
--- a/share/html/Helpers/PreviewScrips
+++ b/share/html/Helpers/PreviewScrips
@@ -93,7 +93,7 @@ $submitted{$_} = 1 for split /,/, $ARGS{TxnRecipients};
 %          my $action = $s->ActionObj->Action;
 %          scalar(map { $action->$_ } qw(To Cc Bcc))
 %        } @scrips ) {
-<input type="checkbox" class="checkbox" name="TxnSendMailToAll" value="1" <% $all_checkbox | n %> onclick="setCheckbox(this,'TxnSendMailTo')">
+<input type="checkbox" class="checkbox" name="TxnSendMailToAll" value="1">
 <label for="TxnSendMailToAll"><b><% loc('All recipients') %></b></label><br />
 %   }
 %     for my $scrip (@scrips) {
@@ -117,7 +117,7 @@ $submitted{$_} = 1 for split /,/, $ARGS{TxnRecipients};
 %                 }
 
 %                 if ( $show_checkbox ) {
-                      <input type="checkbox" class="checkbox" name="TxnSendMailTo" <% $checked ? 'checked="checked"' : '' |n%> value="<%$addr->address%>" id="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>" onclick="setCheckbox(this)" />
+                      <input type="checkbox" class="checkbox" name="TxnSendMailTo" <% $checked ? 'checked="checked"' : '' |n%> value="<%$addr->address%>" id="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>" />
 %                 }
                   <label for="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>"><& /Elements/ShowUser, Address => $addr &></label>
 %                 $m->callback(CallbackName => 'AfterAddress', Ticket => $TicketObj, Address => $addr, Type => $type);
diff --git a/share/html/Helpers/ShowSimplifiedRecipients b/share/html/Helpers/ShowSimplifiedRecipients
index bfef62b..99ff9ae 100644
--- a/share/html/Helpers/ShowSimplifiedRecipients
+++ b/share/html/Helpers/ShowSimplifiedRecipients
@@ -103,7 +103,7 @@ $submitted{$_} = 1 for split /,/, $ARGS{TxnRecipients};
 <tr>
 <td> </td>
 <td>
-<input type="checkbox" class="checkbox" name="TxnSendMailToAll" value="1" <% $all_checkbox | n %> onclick="setCheckbox(this,'TxnSendMailTo')">
+<input type="checkbox" class="checkbox" name="TxnSendMailToAll" value="1">
 <label for="TxnSendMailToAll"><b><% loc('All recipients') %></b></label>
 </td>
 </tr>
@@ -117,7 +117,7 @@ $submitted{$_} = 1 for split /,/, $ARGS{TxnRecipients};
 %         my $checked = $submitted{$addr->address} ? not $squelched{$addr->address} : $squelched_config;
 %         $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} %>" onclick="setCheckbox(this)" />
+<input type="checkbox" class="checkbox" name="TxnSendMailTo" <% $checked ? 'checked="checked"' : '' |n%> value="<%$addr->address%>" id="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>" />
 <label for="TxnSendMailTo-<% $addr->address %>-<% $recips{$addr->address} %>"><& /Elements/ShowUser, Address => $addr &></label>
 %         $m->callback(CallbackName => 'AfterAddress', Ticket => $TicketObj, Address => $addr, Type => $type);
 <br />
diff --git a/share/html/Ticket/Update.html b/share/html/Ticket/Update.html
index b03bc41..3baaa5f 100644
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@ -216,13 +216,16 @@ jQuery( function() {
    var updateScrips = function() {
        CKEDITOR.instances['UpdateContent'].updateElement();
        var syncCheckboxes = function(ev) {
-           jQuery("input[name=TxnSendMailTo]").filter( function() { return this.value == ev.target.value; } ).prop("checked",jQuery(ev.target).prop('checked'));
+           var target = ev.target;
+           jQuery("input[name=TxnSendMailTo]").filter( function() { return this.value == target.value; } ).prop("checked",jQuery(target).prop('checked'));
        };
        jQuery('#recipients div.titlebox-content').load( '<% RT->Config->Get('WebPath')%>/Helpers/ShowSimplifiedRecipients',
            jQuery('form[name=TicketUpdate]').serialize(),
            function() {
                var txn_send_field = jQuery("#recipients input[name=TxnSendMailTo]");
                txn_send_field.change( syncCheckboxes );
+               txn_send_field.click( function () { setCheckbox(this) } );
+               jQuery("#recipients input[name=TxnSendMailToAll]").click( function() { setCheckbox(this, 'TxnSendMailTo'); } );
                setCheckbox(txn_send_field);
            }
        );
@@ -231,6 +234,8 @@ jQuery( function() {
            function() {
                var txn_send_field = jQuery("#previewscrips input[name=TxnSendMailTo]");
                txn_send_field.change( syncCheckboxes );
+               txn_send_field.click( function () { setCheckbox(this) } );
+               jQuery("#previewscrips input[name=TxnSendMailToAll]").click( function() { setCheckbox(this, 'TxnSendMailTo'); } );
                setCheckbox(txn_send_field);
            }
        );

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


More information about the rt-commit mailing list