[open-ils-commits] r19906 - in trunk/Open-ILS/web: js/ui/default/actor/user templates/default/actor/user (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Mar 29 21:41:09 EDT 2011
Author: dbs
Date: 2011-03-29 21:41:08 -0400 (Tue, 29 Mar 2011)
New Revision: 19906
Modified:
trunk/Open-ILS/web/js/ui/default/actor/user/register.js
trunk/Open-ILS/web/templates/default/actor/user/register_table.tt2
Log:
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 <jstephenson at mvlc.org>
Modified: trunk/Open-ILS/web/js/ui/default/actor/user/register.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/actor/user/register.js 2011-03-30 00:41:09 UTC (rev 19905)
+++ trunk/Open-ILS/web/js/ui/default/actor/user/register.js 2011-03-30 01:41:08 UTC (rev 19906)
@@ -207,6 +207,10 @@
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 @@
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
Modified: trunk/Open-ILS/web/templates/default/actor/user/register_table.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/actor/user/register_table.tt2 2011-03-30 00:41:09 UTC (rev 19905)
+++ trunk/Open-ILS/web/templates/default/actor/user/register_table.tt2 2011-03-30 01:41:08 UTC (rev 19906)
@@ -19,7 +19,12 @@
</span>
</td>
</tr>
- <tr fmclass='au' fmfield='passwd' required='required'/>
+ <tr fmclass='au' fmfield='passwd' required='required'>
+ <td/><td/><td/>
+ <td>
+ <button dojoType='dijit.form.Button' jsId='generatePassword' scrollOnFocus='false'>Generate Password</button>
+ </td>
+ </tr>
<tr fmclass='au' fmfield='passwd2' required='required'><td/><td>Verify Password</td><td/></tr>
<tr fmclass='au' fmfield='first_given_name' required='required'/>
<tr fmclass='au' fmfield='second_given_name'/>
More information about the open-ils-commits
mailing list