[open-ils-commits] r18759 - branches/rel_1_6_1/Open-ILS/web/opac/skin/default/js (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Nov 16 15:11:57 EST 2010
Author: phasefx
Date: 2010-11-16 15:11:52 -0500 (Tue, 16 Nov 2010)
New Revision: 18759
Modified:
branches/rel_1_6_1/Open-ILS/web/opac/skin/default/js/holds.js
Log:
backport r18757 from trunk for opac org hiding extension to place hold pickup lib menu
Modified: branches/rel_1_6_1/Open-ILS/web/opac/skin/default/js/holds.js
===================================================================
--- branches/rel_1_6_1/Open-ILS/web/opac/skin/default/js/holds.js 2010-11-16 20:11:32 UTC (rev 18758)
+++ branches/rel_1_6_1/Open-ILS/web/opac/skin/default/js/holds.js 2010-11-16 20:11:52 UTC (rev 18759)
@@ -664,17 +664,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