<button dojoType='dijit.form.Button' jsId='generatePassword' scrollOnFocus='false' tabIndex='-1'></button>
</td>
</tr>
- <tr fmclass='au' fmfield='passwd2' required='required'><td/><td id='verifyPassword'></td><td/></tr>
+ <tr fmclass='au' fmfield='passwd2' required='required'><td/><td id='verifyPassword'></td><td/>
+ <td>
+ <button dojoType='dijit.form.Button' jsId='requestPasswordResetViaEmail' scrollOnFocus='false' tabIndex='-1'></button>
+ </td>
+ </tr>
<tr fmclass='au' fmfield='prefix'/>
<tr fmclass='au' fmfield='first_given_name' required='required'/>
<tr fmclass='au' fmfield='second_given_name'/>
allCards.attr("label", localeStrings.SEE_ALL);
dojo.byId('uedit-dupe-username-warning').innerHTML = localeStrings.DUPE_USERNAME;
generatePassword.attr("label", localeStrings.RESET_PASSWORD);
+ requestPasswordResetViaEmail.attr("label", 'Send Password Reset Link');
setExpireDate.attr("label", localeStrings.UPDATE_EXPIRE_DATE);
dojo.byId('verifyPassword').innerHTML = localeStrings.VERIFY_PASSWORD;
dojo.byId('parentGuardian').innerHTML = localeStrings.PARENT_OR_GUARDIAN;
dojo.connect(generatePassword, 'onClick', generatePasswordHandler);
+ dojo.connect(requestPasswordResetViaEmail, 'onClick', requestPasswordResetViaEmailHandler);
+
dojo.connect(setExpireDate, 'onClick', setExpireDateHandler);
if(!patron.isnew() && !checkGrpAppPerm(patron.profile()) && patron.id() != openils.User.user.id()) {
f.widget.attr('value', patron.passwd());
}
+function requestPasswordResetViaEmailHandler() {
+ if (patron.email()) {
+ var resp = fieldmapper.standardRequest(
+ ['open-ils.actor', 'open-ils.actor.patron.password_reset.request'],
+ { params : ['barcode', patron.card().barcode(), patron.email()] }
+ )
+ alert('Submitted request for password reset link to be sent via email.');
+ } else {
+ alert('Patron must have email address on file to perform a password reset via email.');
+ }
+}
+
/**
* Generate a potential usrname for the patron.
*/