From 1e7e5b0efe6a9bc0721322f20d44809ec8e961e0 Mon Sep 17 00:00:00 2001 From: dbs Date: Mon, 1 Jun 2009 03:36:12 +0000 Subject: [PATCH] Borrow miker's approach to finding the right depth to display holdings (might be worthwhile abstracting the 'here' bit to org_utils.js) git-svn-id: svn://svn.open-ils.org/ILS/trunk@13271 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/skin/default/js/rdetail.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js index a307dcc2ac..2c1d0cb8a2 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -228,9 +228,15 @@ function _holdingsDraw(h) { } function _holdingsDrawMFHD(holdings, entryNum) { - if (!orgIsMine(findOrgUnit(holdings.owning_lib()), findOrgUnit(getLocation()))) { - return null; - } + var here = findOrgUnit(getLocation()); + if (getDepth() > 0 || getDepth === 0 ) { + while (getDepth() < findOrgDepth(here)) + here = findOrgUnit( here.parent_ou() ); + if (!orgIsMine(findOrgUnit(here), findOrgUnit(holdings.owning_lib()))) { + return null; + } + } + var hh = holdings.holdings(); var hch = holdings.current_holdings(); var hs = holdings.supplements(); -- 2.11.0