[Rt-commit] rt branch, 4.4/preview-scrip-recipients-checkbox, created. rt-4.4.1-319-g7d11eb8

Dave Goehrig dave at bestpractical.com
Thu Mar 2 12:02:00 EST 2017


The branch, 4.4/preview-scrip-recipients-checkbox has been created
        at  7d11eb830bc2a19c56c712676757cb0e1afaad30 (commit)

- Log -----------------------------------------------------------------
commit 7d11eb830bc2a19c56c712676757cb0e1afaad30
Author: Dave Goehrig <dave at bestpractical.com>
Date:   Thu Mar 2 11:57:55 2017 -0500

    Disable checkbox while scrip loading
    
    To prevent you from clicking on the checkbox
    while the PreviewScrips widget is loading,
    I've overridden the click handler to return false
    preventing the click event from working.
    
    It should be noted that "disabled" and "readonly"
    attributres do not have the desired behavior on
    checkboxes as they impact the value and not the
    check state.
    
    Fixes: I#32290

diff --git a/share/html/Helpers/PreviewScrips b/share/html/Helpers/PreviewScrips
index ecc2a3e..74ba149 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" id="TxnSendMailToAll" name="TxnSendMailToAll" value="1">
+<input type="checkbox" class="checkbox" id="TxnSendMailToAll" name="TxnSendMailToAll" <% $ARGS{TxnSendMailToAll} ? 'checked="checked"' : ''  %> value="1">
 <label for="TxnSendMailToAll"><b><% loc('All recipients') %></b></label><br />
 %   }
 %     for my $scrip (@scrips) {
@@ -141,6 +141,6 @@ $submitted{$_} = 1 for split /,/, $ARGS{TxnRecipients};
 % }
 
 % $m->callback( CallbackName => 'AfterRecipients', TicketObj => $TicketObj );
-
 <input type="hidden" name="TxnRecipients" value="<% join ",",sort keys %recips %>" />
 % $m->abort();
+
diff --git a/share/html/Ticket/Update.html b/share/html/Ticket/Update.html
index 8540600..79e9235 100644
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@ -225,13 +225,18 @@ jQuery( function() {
                }
            }
        );
+    
+       jQuery("#previewscrips input[name=TxnSendMailToAll]").click(function() { return false; });
        jQuery('#previewscrips div.titlebox-content').load( '<% RT->Config->Get('WebPath')%>/Helpers/PreviewScrips',
            jQuery('form[name=TicketUpdate]').serializeArray(),
            function() {
+                console.log("Loading preview scrips helper");
                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'); } );
+               jQuery("#previewscrips input[name=TxnSendMailToAll]").click( function() { 
+                    setCheckbox(this, 'TxnSendMailTo');
+                } );
                if (txn_send_field.length > 0) {
                    setCheckbox(txn_send_field[0]);
                }

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


More information about the rt-commit mailing list