From 39ffadb667e0b0ba1643cdfe9d25dd3fe0abb864 Mon Sep 17 00:00:00 2001 From: dbs Date: Wed, 30 Mar 2011 01:52:12 +0000 Subject: [PATCH] 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_0@19910 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/ui/default/actor/user/register.js | 15 +++++++++++++++ .../web/templates/default/actor/user/register_table.tt2 | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) 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 03d0a99570..7255b25eb9 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -148,6 +148,11 @@ 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 saveButton.attr('disabled', true); @@ -265,6 +270,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 4e9fcbe2b0..75e288fbbb 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 -- 2.11.0