From 0a3180d24c086774d7edff72dccbe00bd456874f Mon Sep 17 00:00:00 2001 From: phasefx Date: Thu, 3 Jun 2010 10:31:16 +0000 Subject: [PATCH] faster Library Settings UI and progress dialog git-svn-id: svn://svn.open-ils.org/ILS/trunk@16576 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../server/admin/org_unit_settings.js | 49 ++++++++++++------- .../server/admin/org_unit_settings.xhtml | 1 + 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js index fae50a1335..a43248c59c 100644 --- a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js +++ b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js @@ -14,12 +14,14 @@ dojo.require('openils.Event'); 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,23 +49,33 @@ function osInit(data) { } 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', @@ -74,7 +86,10 @@ function osDraw() { 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 @@ function osEditSetting(deleteMe) { var res = r.recv().content(); if(e = openils.Event.parse(res)) return alert(e); - osDraw(); + osDraw(obj); } } ); diff --git a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml index e8ad6a0df3..6d5700d669 100644 --- a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml +++ b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml @@ -101,6 +101,7 @@ +
-- 2.43.2