[open-ils-commits] r13805 - branches/rel_1_4/Open-ILS/xul/staff_client/server/admin (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Aug 10 13:54:40 EDT 2009
Author: erickson
Date: 2009-08-10 13:54:36 -0400 (Mon, 10 Aug 2009)
New Revision: 13805
Modified:
branches/rel_1_4/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js
Log:
deduplicate the list of context orgs to prevent errors inserting into dojo store
Modified: branches/rel_1_4/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js
===================================================================
--- branches/rel_1_4/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js 2009-08-10 16:14:58 UTC (rev 13804)
+++ branches/rel_1_4/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js 2009-08-10 17:54:36 UTC (rev 13805)
@@ -78,7 +78,17 @@
fieldmapper.aou.descendantNodeList(orgList[i]));
}
- var store = new dojo.data.ItemFileReadStore({data:aou.toStoreData(orgNodeList)});
+ // dedeuplicate the list of org units
+ var newList = [];
+ dojo.forEach(orgNodeList,
+ function(node) {
+ if(!newList.filter(
+ function(node2) { return (node2.id() == node.id()); })[0])
+ newList.push(node);
+ }
+ );
+
+ var store = new dojo.data.ItemFileReadStore({data:aou.toStoreData(newList)});
osContextSelector.store = store;
osContextSelector.startup();
osContextSelector.setValue(user.user.ws_ou());
More information about the open-ils-commits
mailing list