added org util method to find the full path for an org unit, where the full path...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 8 Mar 2010 19:43:33 +0000 (19:43 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 8 Mar 2010 19:43:33 +0000 (19:43 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15737 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 3b6123d..b2895f5 100644 (file)
@@ -220,6 +220,16 @@ if(!dojo._hasResource["fieldmapper.OrgUtils"]){
         return list;
     }
 
+    fieldmapper.aou.fullPath = function(orgId, asId) {
+
+        var orgList = fieldmapper.aou.orgNodeTrail(fieldmapper.aou.findOrgUnit(orgId));
+        orgList.pop(); // prevent dupes
+        orgList = orgList.concat(fieldmapper.aou.descendantNodeList(contextOrg))
+
+        if(!asId) return orgList;
+        return orgList.map( function(node) { return node.id(); } );
+    }
+
        dojo.addOnUnload( function () {
                for (var i in fieldmapper.aou.OrgCache) {
                        x=fieldmapper.aou.OrgCache[i].treePtr;