extend the opac org hiding feature to the place hold pickup lib menu. Note that...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 16 Nov 2010 20:10:13 +0000 (20:10 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 16 Nov 2010 20:10:13 +0000 (20:10 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@18757 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/skin/default/js/holds.js

index 9a7d6fe..1fcfd19 100644 (file)
@@ -758,17 +758,31 @@ function holdsCheckPossibility(pickuplib, hold, recurse) {
 function holdsBuildOrgSelector(node) {
 
        if(!node) node = globalOrgTree;
-    if(!isTrue(node.opac_visible())) return;
+       if(!isTrue(node.opac_visible())) return;
 
-       var selector = $('holds_org_selector');
-       var index = selector.options.length;
+       var render_this_org = true;
+       var orgHiding = checkOrgHiding(); // value here is cached so not too painful with the recursion
+       if (orgHiding) {
+               if (node.id() == globalOrgTree.id()) {
+                       node = orgHiding.org; // top of tree = org hiding context org
+               }
+               if ( ! orgIsMine( orgHiding.org, node, orgHiding.depth ) ) {
+                       render_this_org = false;
+               }
+       }
 
-       var type = findOrgType(node.ou_type());
-       var indent = type.depth() - 1;
-       var opt = setSelectorVal( selector, index, node.name(), node.id(), null, indent );
-       if(!type.can_have_users()) {
-               opt.disabled = true;
-               addCSSClass(opt, 'disabled_option');
+       if (render_this_org) {
+               var selector = $('holds_org_selector');
+               var index = selector.options.length;
+
+               var type = findOrgType(node.ou_type());
+               var indent = type.depth() - 1;
+
+               var opt = setSelectorVal( selector, index, node.name(), node.id(), null, indent );
+               if(!type.can_have_users()) {
+                       opt.disabled = true;
+                       addCSSClass(opt, 'disabled_option');
+               }
        }
        
        for( var i in node.children() ) {