Bug 30177: When editing an existing patron set message_prefs_dirty to true

1 - Define default messaging preferences for a patron category
2 - Go into an existing account and change the patron category to the
    one set in step 1.
3 - Confirm that the messaging prefs have been reset to that of the
    default patron category
4 - Apply patch
5 - Repeat Step 2, this time you should see a warning asking if you want
    to set messaging prefs to the category default
6 - Press OK and save. Confirm that the messaging prefs are now set to
    the default for that category
7 - Try it again with an existing account and press Cancel this time.
    Notice that there should be no change to the patron messaging prefs.
8 - Try making a new patron and switching the category, you should see
    no warning and the message prefs should be proberly set to the
    defaults of any category you choose.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Lucas Gass 2022-02-24 16:17:11 +00:00 committed by Fridolin Somers
parent 6aea5d8212
commit 9b3bad3eea
1 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,10 @@ $(document).ready(function(){
message_prefs_dirty = true;
});
if ( window.location.href.indexOf("op=add") === -1 ) {
message_prefs_dirty = true; // unless op=add consider the message prefs dirty
}
if( $("#messaging_prefs_loading").length ){ // This element only appears in the template if op=add
$('#categorycode_entry').change(function() {
var messaging_prefs_loading = $("#messaging_prefs_loading");