added id version of org descendent list function
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 12 Mar 2010 05:03:01 +0000 (05:03 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 12 Mar 2010 05:03:01 +0000 (05:03 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15819 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js

index b2895f5..a6c7f63 100644 (file)
@@ -205,11 +205,15 @@ if(!dojo._hasResource["fieldmapper.OrgUtils"]){
 
     /** 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) {
+    fieldmapper.aou.descendantNodeList = function(orgId, asId) {
         var list = [];
         function addNode(node) {
             if(!node) return;
-            list.push(node);
+            if(asId) {
+                list.push(node.id());
+            } else {
+                list.push(node);
+            }
             var children = node.children();
             if(children) {
                 for(var i = 0; i < children.length; i++)