[open-ils-commits] r18757 - trunk/Open-ILS/web/opac/skin/default/js (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Nov 16 15:10:18 EST 2010


Author: phasefx
Date: 2010-11-16 15:10:13 -0500 (Tue, 16 Nov 2010)
New Revision: 18757

Modified:
   trunk/Open-ILS/web/opac/skin/default/js/holds.js
Log:
extend the opac org hiding feature to the place hold pickup lib menu.  Note that this feature depends on Apache being configured to maintain the ol= URL param


Modified: trunk/Open-ILS/web/opac/skin/default/js/holds.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/holds.js	2010-11-16 16:52:22 UTC (rev 18756)
+++ trunk/Open-ILS/web/opac/skin/default/js/holds.js	2010-11-16 20:10:13 UTC (rev 18757)
@@ -758,17 +758,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