[open-ils-commits] r16530 - in trunk/Open-ILS/web: js/ui/default/actor/user templates/default/actor/user (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri May 28 11:50:26 EDT 2010
Author: erickson
Date: 2010-05-28 11:50:23 -0400 (Fri, 28 May 2010)
New Revision: 16530
Modified:
trunk/Open-ILS/web/js/ui/default/actor/user/register.js
trunk/Open-ILS/web/templates/default/actor/user/register_table.tt2
Log:
added duplicate username checking/warning
Modified: trunk/Open-ILS/web/js/ui/default/actor/user/register.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/actor/user/register.js 2010-05-28 14:19:21 UTC (rev 16529)
+++ trunk/Open-ILS/web/js/ui/default/actor/user/register.js 2010-05-28 15:50:23 UTC (rev 16530)
@@ -613,6 +613,36 @@
if(fmcls == 'au') {
switch(fmfield) {
+ case 'usrname':
+ dojo.connect(widget.widget, 'onChange',
+ function() {
+ var input = findWidget('au', 'usrname');
+ var usrname = input.widget.attr('value');
+
+ if(!usrname) {
+ dojo.addClass(dojo.byId('uedit-dupe-username-warning'), 'hidden');
+ return;
+ }
+
+ fieldmapper.standardRequest(
+ ['open-ils.actor', 'open-ils.actor.username.exists'],
+ {
+ params: [openils.User.authtoken, usrname],
+ oncomplete : function(r) {
+ var res = openils.Util.readResponse(r);
+ if(res) {
+ dojo.removeClass(dojo.byId('uedit-dupe-username-warning'), 'hidden');
+ } else {
+ dojo.addClass(dojo.byId('uedit-dupe-username-warning'), 'hidden');
+ }
+ }
+ }
+ );
+ }
+ );
+
+ return;
+
case 'profile': // when the profile changes, update the expire date
dojo.connect(widget.widget, 'onChange',
function() {
Modified: trunk/Open-ILS/web/templates/default/actor/user/register_table.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/actor/user/register_table.tt2 2010-05-28 14:19:21 UTC (rev 16529)
+++ trunk/Open-ILS/web/templates/default/actor/user/register_table.tt2 2010-05-28 15:50:23 UTC (rev 16530)
@@ -6,7 +6,14 @@
<button dojoType='dijit.form.Button' jsId='allCards'>See All</button>
</td>
</tr>
- <tr fmclass='au' fmfield='usrname' required='required'/>
+ <tr fmclass='au' fmfield='usrname' required='required'>
+ <td/><td/><td/>
+ <td>
+ <span id='uedit-dupe-username-warning' style='color:red; font-weight:bold' class='hidden'>
+ Username is already in use
+ </span>
+ </td>
+ </tr>
<tr fmclass='au' fmfield='passwd' required='required'/>
<tr fmclass='au' fmfield='passwd2' required='required'><td/><td>Verify Password</td><td/></tr>
<tr fmclass='au' fmfield='first_given_name' required='required'/>
More information about the open-ils-commits
mailing list