fetch user groups non-async to prevent clobbering expire date when group dijit update...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 24 Feb 2010 19:30:44 +0000 (19:30 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 24 Feb 2010 19:30:44 +0000 (19:30 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15635 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/actor/user/register.js

index e5670d1..3c6c47c 100644 (file)
@@ -425,6 +425,12 @@ function fleshFMRow(row, fmcls, args) {
             break;
     }
 
+    var required = row.getAttribute('required') == 'required';
+
+    // password data is not fetched/required/displayed for existing users
+    if(!patron.isnew() && 'passwd' == fmfield)
+        required = false;
+
     var dijitArgs = {
         style: wstyle, 
         required : required,
@@ -436,8 +442,12 @@ function fleshFMRow(row, fmcls, args) {
     if(value !== null)
         dijitArgs.value = value;
 
-    var required = row.getAttribute('required') == 'required';
+    // fetch profile groups non-async so existing expire_date is
+    // not overwritten when the profile groups arrive and update
+    var sync = (fmfield == 'profile') ? true : false;
+
     var widget = new openils.widget.AutoFieldWidget({
+        forceSync : sync,
         idlField : fieldIdl,
         fmObject : fmObject,
         fmClass : fmcls,