[open-ils-commits] r13806 - branches/rel_1_4_0/Open-ILS/xul/staff_client/server/admin (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Aug 10 13:55:38 EDT 2009


Author: erickson
Date: 2009-08-10 13:55:34 -0400 (Mon, 10 Aug 2009)
New Revision: 13806

Modified:
   branches/rel_1_4_0/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_0/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js
===================================================================
--- branches/rel_1_4_0/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js	2009-08-10 17:54:36 UTC (rev 13805)
+++ branches/rel_1_4_0/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js	2009-08-10 17:55:34 UTC (rev 13806)
@@ -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