if(orgSettings[k])
orgSettings[k] = orgSettings[k].value;
+ uEditUsePhonePw = orgSettings['patron.password.use_phone'];
uEditFetchUserSettings(userId);
if(userId) {
var wclass = row.getAttribute('wclass');
var wstyle = row.getAttribute('wstyle');
var wconstraints = row.getAttribute('wconstraints');
+
+ var isPasswd2 = (fmfield == 'passwd2');
+ if(isPasswd2) fmfield = 'passwd';
var fieldIdl = fieldmapper.IDL.fmclasses[fmcls].field_map[fmfield];
if(!args) args = {};
disabled : disabled
};
+ // TODO RSN: Add Setting!
+ if(fmcls == 'au' && fmfield == 'dob')
+ dijitArgs.popupClass = "";
+
var value = row.getAttribute('wvalue');
if(value !== null)
dijitArgs.value = value;
parentNode : span,
widgetClass : wclass,
dijitArgs : dijitArgs,
+ orgDefaultsToWs : true,
orgLimitPerms : ['UPDATE_USER'],
});
widget.build();
+ // now put it back before we register the widget
+ if(isPasswd2) fmfield = 'passwd2';
+
widget._wtype = fmcls;
widget._fmfield = fmfield;
widget._addr = args.addr;
return;
case 'day_phone':
+ // if configured, use the last for digits of the day phone number as the password
+ if(uEditUsePhonePw && patron.isnew()) {
+ dojo.connect(widget.widget, 'onChange',
+ function(newVal) {
+ if(newVal && newVal.length >= 4) {
+ var pw1 = findWidget('au', 'passwd').widget;
+ var pw2 = findWidget('au', 'passwd2').widget;
+ pw1.attr('value', newVal.substring(newVal.length - 4));
+ pw2.attr('value', newVal.substring(newVal.length - 4));
+ }
+ }
+ );
+ }
case 'evening_phone':
case 'other_phone':
dojo.connect(widget.widget, 'onChange',
switch(w._wtype) {
case 'au':
- patron[w._fmfield](val);
+ if(w._fmfield != 'passwd2')
+ patron[w._fmfield](val);
break;
case 'ac':
<tr fmclass='ac' fmfield='barcode' required='required'/>
<tr fmclass='au' fmfield='usrname' required='required'/>
<tr fmclass='au' fmfield='passwd' required='required'/>
- <tr fmclass='au' fmfield='passwd' required='required'><td/><td>Verify Password</td><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'/>
<tr fmclass='au' fmfield='family_name' required='required'/>
<tr fmclass='au' fmfield='dob'/>
<tr fmclass='au' fmfield='juvenile'/>
<tr fmclass='au' fmfield='ident_type' required='required'/>
- <tr fmclass='au' fmfield='ident_value' required='required'/>
+ <tr fmclass='au' fmfield='ident_value'/>
<tr fmclass='au' fmfield='email'/>
<tr fmclass='au' fmfield='day_phone'/>
<tr fmclass='au' fmfield='evening_phone'/>