gave org selecter builder the option to display shortname instead of name, good for...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Aug 2008 19:43:21 +0000 (19:43 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Aug 2008 19:43:21 +0000 (19:43 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10455 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 9240f22..3527596 100644 (file)
@@ -987,20 +987,22 @@ function goHome() {
 }
 
 
-function buildOrgSel(selector, org, offset) {
+function buildOrgSel(selector, org, offset, namecol) {
+    if(!namecol) namecol = 'name';
        insertSelectorVal( selector, -1, 
-               org.name(), org.id(), null, findOrgDepth(org) - offset );
+               org[namecol](), org.id(), null, findOrgDepth(org) - offset );
        for( var c in org.children() )
-               buildOrgSel( selector, org.children()[c], offset);
+               buildOrgSel( selector, org.children()[c], offset, namecol);
 }
 
-function buildMergedOrgSel(selector, org_list, offset) {
+function buildMergedOrgSel(selector, org_list, offset, namecol) {
+    if(!namecol) namecol = 'name';
     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 );
+                   org[namecol](), org.id(), null, findOrgDepth(org) - offset );
            for( var c in org.children() )
-                   buildOrgSel( selector, org.children()[c], offset);
+                   buildOrgSel( selector, org.children()[c], offset, namecol);
     }
 }