Bug 9556: fix setting messaging prefs when changing patron category

As a result of accumulated changes to field names returned
by the members/default_messageprefs.pl service, the JavaScript
to change the patron messaging preferences to the category default
when changing a patron's category in the patron editor stopped
working.

To test:

[1] Turn on the EnhancedMessagingPreferences feature.
[2] Set message preference defaults for at least two
    patron categories.
[3] Before applying the patch, create a new patron record
    using one of the categories you set prefs for, then
    change the category, then change it back again.  You
    will see that numeric settings like the number of days
    for advanced notices will change, but checkboxes won't change.
[4] Apply the patch, then create a new patron record and
    try changing the patron category.  You will see that all of
    the preferences will get updated to the category default
    each time you change the category.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Galen Charlton 2013-02-06 08:02:18 -08:00 committed by Chris Cormack
parent 9da5a782f7
commit 2f4aae67af
1 changed files with 2 additions and 2 deletions

View File

@ -1399,8 +1399,8 @@
var attrid = item.message_attribute_id;
var transports = ['email', 'rss', 'sms'];
$.each(transports, function(j, transport) {
if (item['transport-' + transport] != ' ') {
$('#' + transport + attrid).attr('checked', item['transport-' + transport]);
if (item['transports_' + transport] == 1) {
$('#' + transport + attrid).attr('checked', 'checked');
} else {
$('#' + transport + attrid).removeAttr('checked');
}