[open-ils-commits] r9714 - trunk/Open-ILS/web/js/dojo/fieldmapper
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue May 27 22:56:01 EDT 2008
Author: erickson
Date: 2008-05-27 22:55:59 -0400 (Tue, 27 May 2008)
New Revision: 9714
Modified:
trunk/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js
Log:
added function to return a flat list of org + descendants
Modified: trunk/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js 2008-05-28 02:13:44 UTC (rev 9713)
+++ trunk/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js 2008-05-28 02:55:59 UTC (rev 9714)
@@ -185,6 +185,23 @@
return false;
}
+ /** Given an org id, returns an array of org units including
+ * the org for the ID provided and all descendant orgs */
+ fieldmapper.aou.descendantNodeList = function(orgId) {
+ var list = [];
+ function addNode(node) {
+ if(!node) return;
+ list.push(node);
+ var children = node.children();
+ if(children) {
+ for(var i = 0; i < children.length; i++)
+ addNode(children[i]);
+ }
+ }
+ addNode(fieldmapper.aou.findOrgUnit(orgId));
+ return list;
+ }
+
dojo.addOnUnload( function () {
for (var i in fieldmapper.aou.OrgCache) {
x=fieldmapper.aou.OrgCache[i].treePtr;
More information about the open-ils-commits
mailing list