[open-ils-commits] r19997 - branches/rel_2_0/Open-ILS/web/opac/skin/default/js (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Apr 6 14:23:27 EDT 2011


Author: phasefx
Date: 2011-04-06 14:23:23 -0400 (Wed, 06 Apr 2011)
New Revision: 19997

Modified:
   branches/rel_2_0/Open-ILS/web/opac/skin/default/js/holds.js
Log:
backport r18757 for org hiding tweak

Modified: branches/rel_2_0/Open-ILS/web/opac/skin/default/js/holds.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/skin/default/js/holds.js	2011-04-06 15:28:12 UTC (rev 19996)
+++ branches/rel_2_0/Open-ILS/web/opac/skin/default/js/holds.js	2011-04-06 18:23:23 UTC (rev 19997)
@@ -765,17 +765,31 @@
 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() ) {



More information about the open-ils-commits mailing list