added new function which builds an org selector from a set of top-level orgs
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 25 Aug 2008 21:57:06 +0000 (21:57 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 25 Aug 2008 21:57:06 +0000 (21:57 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10442 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/opac_utils.js

index 590c99d..9240f22 100644 (file)
@@ -994,6 +994,16 @@ function buildOrgSel(selector, org, offset) {
                buildOrgSel( selector, org.children()[c], offset);
 }
 
+function buildMergedOrgSel(selector, org_list, offset) {
+    for(var i = 0; i < org_list.length; i++) {
+        var org = findOrgUnit(org_list[i]);
+       insertSelectorVal( selector, -1, 
+                   org.name(), org.id(), null, findOrgDepth(org) - offset );
+           for( var c in org.children() )
+                   buildOrgSel( selector, org.children()[c], offset);
+    }
+}
+
 
 function parseForm(form) {
        if(!form) return {};