[open-ils-commits] r16576 - trunk/Open-ILS/xul/staff_client/server/admin (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Jun 3 06:31:22 EDT 2010


Author: phasefx
Date: 2010-06-03 06:31:16 -0400 (Thu, 03 Jun 2010)
New Revision: 16576

Modified:
   trunk/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js
   trunk/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml
Log:
faster Library Settings UI and progress dialog

Modified: trunk/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js	2010-06-03 05:29:22 UTC (rev 16575)
+++ trunk/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js	2010-06-03 10:31:16 UTC (rev 16576)
@@ -14,12 +14,14 @@
 dojo.require('openils.widget.OrgUnitFilteringSelect');
 dojo.require('openils.PermaCrud');
 dojo.require('openils.widget.AutoFieldWidget');
+dojo.require('openils.widget.ProgressDialog');
 
 var authtoken;
 var contextOrg;
 var user;
 var workOrgs;
 var osSettings = {};
+var ouSettingValues = {};
 var osEditAutoWidget;
 
 function osInit(data) {
@@ -47,24 +49,34 @@
 }
 dojo.addOnLoad(osInit);
 
-function osDraw() {
-    var types = new openils.PermaCrud({authtoken:authtoken}).retrieveAll('coust');
+function osDraw(specific_setting) {
+    progressDialog.show(true, "Processing..."); /* FIXME: I18N */
 
-    dojo.forEach(types, 
-        function(type) {
-            osSettings[type.name()] = {
-                label : type.label(),
-                desc : type.description(),
-                type : type.datatype(),
-                fm_class : type.fm_class()
-            }
-        }
-    );
-    
     var names = [];
-    for(var key in osSettings)
-        names.push(key);
+    if (specific_setting) {
 
+        for(var key in specific_setting)
+            names.push(key);
+
+    } else {
+
+        var types = new openils.PermaCrud({authtoken:authtoken}).retrieveAll('coust');
+
+        dojo.forEach(types, 
+            function(type) {
+                osSettings[type.name()] = {
+                    label : type.label(),
+                    desc : type.description(),
+                    type : type.datatype(),
+                    fm_class : type.fm_class()
+                }
+            }
+        );
+        
+        for(var key in osSettings)
+            names.push(key);
+    }
+
     fieldmapper.standardRequest(
         [   'open-ils.actor', 
             'open-ils.actor.ou_setting.ancestor_default.batch'],
@@ -74,7 +86,10 @@
                 var data = r.recv().content();
                 if(e = openils.Event.parse(data))
                     return alert(e);
-                osLoadGrid(data);
+                for(var key in data)
+                    ouSettingValues[key] = data[key];
+                osLoadGrid(ouSettingValues);
+                progressDialog.hide();
             }
         }
     );
@@ -303,7 +318,7 @@
                 var res = r.recv().content();
                 if(e = openils.Event.parse(res))
                     return alert(e);
-                osDraw();
+                osDraw(obj);
             }
         }
     );

Modified: trunk/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml	2010-06-03 05:29:22 UTC (rev 16575)
+++ trunk/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml	2010-06-03 10:31:16 UTC (rev 16576)
@@ -101,6 +101,7 @@
         </div> <!-- edit dialog -->
         <span id='os-true' class='hidden'>&common.true;</span>
         <span id='os-false' class='hidden'>&common.false;</span>
+        <div dojoType="openils.widget.ProgressDialog" jsId="progressDialog" indeterminate="true"></div>
     </body>
 </html>
 



More information about the open-ils-commits mailing list