[Rt-commit] rt branch, 4.4/all-onetime-suggestions, created. rt-4.4.1-122-g2b4b20e

Shawn Moore shawn at bestpractical.com
Mon Sep 26 15:09:34 EDT 2016


The branch, 4.4/all-onetime-suggestions has been created
        at  2b4b20e34b9dbada6c773171e1d19f753f810ece (commit)

- Log -----------------------------------------------------------------
commit 2b4b20e34b9dbada6c773171e1d19f753f810ece
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Mon Sep 26 19:09:26 2016 +0000

    Add all recipients checkbox to one-time suggestions list
    
    Fixes: T#173570

diff --git a/share/html/Ticket/Elements/UpdateCc b/share/html/Ticket/Elements/UpdateCc
index 641fa33..36d3f15 100644
--- a/share/html/Ticket/Elements/UpdateCc
+++ b/share/html/Ticket/Elements/UpdateCc
@@ -59,6 +59,8 @@
         <div class="OneTimeCcs hidden">
 %   }
 <i class="label">(<&|/l&>check to add</&>)</i>
+<input type="checkbox" class="checkbox" name="AllSuggestedCc" value="1" onclick="setCheckbox(this, /^UpdateCc-/, null, true)">
+<label for="AllSuggestedCc"><% loc('All recipients') %></label>
 %}
 %foreach my $addr ( @one_time_Ccs ) {
 <input
@@ -84,6 +86,8 @@
         <div class="OneTimeCcs hidden">
 %   }
 <i class="label">(<&|/l&>check to add</&>)</i>
+<input type="checkbox" class="checkbox" name="AllSuggestedBcc" value="1" onclick="setCheckbox(this, /^UpdateBcc-/, null, true)">
+<label for="AllSuggestedBcc"><% loc('All recipients') %></label>
 %}
 %foreach my $addr ( @one_time_Ccs ) {
 <input
diff --git a/share/static/js/util.js b/share/static/js/util.js
index 5cd61dd..eda0127 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -91,7 +91,7 @@ function getClosestInputElements(input) {
     }
 }
 
-function setCheckbox(input, name, val) {
+function setCheckbox(input, name, val, fireClickHandler) {
     if (val == null) val = input.checked;
 
     var is_set_event = false;
@@ -126,7 +126,15 @@ function setCheckbox(input, name, val) {
             }
         }
         else {
-            myfield[i].checked = val;
+            // if we're changing the checked state
+            if (!(myfield[i].checked) != !val) {
+                if (fireClickHandler) {
+                    jQuery(myfield[i]).trigger('click');
+                }
+                else {
+                    myfield[i].checked = val;
+                }
+            }
         }
     }
 

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


More information about the rt-commit mailing list