From: David Lawrence Date: Tue, 9 Aug 2011 22:03:23 +0000 (-0400) Subject: Bug 585440 - Allow disabled accounts to turn off all bugmail X-Git-Tag: bugzilla-4.3.1~300 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b113460e54775cbd3e5e412ad37b9ba7ab66edc;p=thirdparty%2Fbugzilla.git Bug 585440 - Allow disabled accounts to turn off all bugmail r/a=mkanat --- diff --git a/js/field.js b/js/field.js index ea1769bd1c..69f71e526a 100644 --- a/js/field.js +++ b/js/field.js @@ -897,3 +897,16 @@ YAHOO.bugzilla.keywordAutocomplete = { }); } }; + +/** + * Set the disable email checkbox to true if the user has disabled text + */ +function userDisabledTextOnChange(disabledtext) { + var disable_mail = document.getElementById('disable_mail'); + if (disabledtext.value === "" && !disable_mail_manually_set) { + disable_mail.checked = false; + } + if (disabledtext.value !== "" && !disable_mail_manually_set) { + disable_mail.checked = true; + } +} diff --git a/template/en/default/admin/users/edit.html.tmpl b/template/en/default/admin/users/edit.html.tmpl index 3efa4b8bf1..d684dcebd4 100644 --- a/template/en/default/admin/users/edit.html.tmpl +++ b/template/en/default/admin/users/edit.html.tmpl @@ -31,6 +31,7 @@ message = message style_urls = ['skins/standard/admin.css', 'skins/standard/editusers.css'] doc_section = "useradmin.html#modifyusers" + javascript_urls = [ 'js/field.js' ] %] [% PROCESS admin/users/listselectvars.html.tmpl diff --git a/template/en/default/admin/users/userdata.html.tmpl b/template/en/default/admin/users/userdata.html.tmpl index f3f0e5aa9f..3315d87da6 100644 --- a/template/en/default/admin/users/userdata.html.tmpl +++ b/template/en/default/admin/users/userdata.html.tmpl @@ -20,6 +20,10 @@ # otheruser: Bugzilla::User object of user to edit #%] + + @@ -86,7 +90,8 @@ + [% IF otheruser.email_disabled %] checked="checked" [% END %] + onchange="disable_mail_manually_set=1;"> (This affects [% terms.bug %]mail and whinemail, not password-reset or other non-[% terms.bug %]-related emails) @@ -102,6 +107,7 @@ defaultrows = 10 cols = 60 defaultcontent = otheruser.disabledtext + onchange = "userDisabledTextOnChange(this);" %]
(If non-empty, then the account will be disabled, and this text should explain why.) diff --git a/template/en/default/global/textarea.html.tmpl b/template/en/default/global/textarea.html.tmpl index c158615bd7..84aacf2ee6 100644 --- a/template/en/default/global/textarea.html.tmpl +++ b/template/en/default/global/textarea.html.tmpl @@ -53,4 +53,7 @@ [% END %] [% IF mandatory %] aria-required="true" + [% END %] + [% IF onchange %] + onchange="[% onchange FILTER html %]" [% END %]>[% defaultcontent FILTER html %]