From: dbs Date: Wed, 30 Mar 2011 01:43:38 +0000 (+0000) Subject: Restore the Reset Password button on patron editor X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2e1e590062ca7b926d775b75002cf78bb268648e;p=evergreen%2Ftadl.git Restore the Reset Password button on patron editor Per LP 488243, the Reset Password button that existed on the old XUL patron editor was lost in the transition to the new Dojo patron editor. Jason Stephenson stepped up and offered a patch to restore the functionality. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. Signed-off-by: Jason Stephenson git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_1@19908 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js index 4025f5c0cc..8c078fca37 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -207,6 +207,10 @@ function load() { input.widget.attr('disabled', true).attr('readOnly', true); } + dojo.connect(generatePassword, 'onClick', generatePasswordHandler); + if (uEditUsePhonePw) { + generatePassword.attr('disabled', true); + } if(!patron.isnew() && !checkGrpAppPerm(patron.profile()) && patron.id() != openils.User.user.id()) { // we are not allowed to edit this user, so disable the save option @@ -326,6 +330,16 @@ function replaceCardHandler() { patron.cards(t); } +/** + * Generate a random password for the patron. + */ +function generatePasswordHandler() { + uEditMakeRandomPw(patron); + var f = findWidget('au', 'passwd'); + f.widget.attr('value', patron.passwd()); + f = findWidget('au', 'passwd2'); + f.widget.attr('value', patron.passwd()); +} /** * Loads a staged user and turns them into something the editor can understand diff --git a/Open-ILS/web/templates/default/actor/user/register_table.tt2 b/Open-ILS/web/templates/default/actor/user/register_table.tt2 index 30eeb5c525..e8672a554d 100644 --- a/Open-ILS/web/templates/default/actor/user/register_table.tt2 +++ b/Open-ILS/web/templates/default/actor/user/register_table.tt2 @@ -19,7 +19,12 @@ - + + + + + + Verify Password