Both for staff and patron benefit.
Also, we disable the checkbox if there is no email address on file.
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
[% l('Notify when hold is ready for pickup?') %]
<blockquote>
<input type="checkbox" name="email_notify" value="t"
- [% IF ctx.default_email_notify %]checked="checked"[% END %]/>
+ [% IF !ctx.user.email %]disabled="true"[% ELSIF ctx.default_email_notify %]checked="checked"[% END %]/>
[% l('Yes, by Email') %]<br/>
+ <blockquote>
+ [% l('Email Address:') %] <span name="email_address">[% ctx.user.email %]</span>
+ </blockquote>
<input type="checkbox" name="phone_notify_checkbox"
[% IF ctx.default_phone_notify %]checked="checked"[% END %]/>
[% l('Yes, by Phone') %]<br/>
for(var i in update_elements) update_elements[i].value = load_info.settings['opac.default_sms_notify'];
update_elements = document.getElementsByName('sms_carrier');
for(var i in update_elements) update_elements[i].value = load_info.settings['opac.default_sms_carrier'];
+ update_elements = document.getElementsByName('email_notify');
+ for(var i in update_elements) {
+ update_elements[i].disabled = (load_info.user_email ? false : true);
+ if(update_elements[i].disabled) update_elements[i].checked = false;
+ }
+ update_elements = document.getElementsByName('email_address');
+ for(var i in update_elements) update_elements[i].textContent = load_info.user_email;
}
}
window.onload = function() {
}
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};
+ return {"barcode": barcode, "settings" : settings, "user_email" : user.email()};
},
'sort_menu' : function(menu, recurse) {