Like JSPac does, but currently without the check of having phone/email.
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
};
$ctx->{user_setting_map} = $user_setting_map;
- my $default_notify = $$user_setting_map{'opac.hold_notify'} || '';
+ my $default_notify = (defined $$user_setting_map{'opac.hold_notify'} ? $$user_setting_map{'opac.hold_notify'} : 'email:phone');
if ($default_notify =~ /email/) {
$ctx->{default_email_notify} = 'checked';
} else {
if(!load_info.settings['opac.default_phone']) load_info.settings['opac.default_phone'] = '';
if(!load_info.settings['opac.default_sms_notify']) load_info.settings['opac.default_sms_notify'] = '';
if(!load_info.settings['opac.default_sms_carrier']) load_info.settings['opac.default_sms_carrier'] = '';
- if(load_info.settings['opac.hold_notify']) {
+ if(load_info.settings['opac.hold_notify'] || load_info.settings['opac.hold_notify'] === '') {
var email = load_info.settings['opac.hold_notify'].indexOf('email') > -1;
var phone = load_info.settings['opac.hold_notify'].indexOf('phone') > -1;
var sms = load_info.settings['opac.hold_notify'].indexOf('sms') > -1;
settings[user.settings()[i].name()] = JSON2js(user.settings()[i].value());
}
if(!settings['opac.default_phone'] && user.day_phone()) settings['opac.default_phone'] = user.day_phone();
+ if(!settings['opac.hold_notify'] && settings['opac.hold_notify'] !== '') settings['opac.hold_notify'] = 'email:phone';
return {"barcode": barcode, "settings" : settings};
},