From 11c3308a4b88c5d6c03b68058fb142c1b650e01b Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Mon, 3 Oct 2011 16:03:00 -0400 Subject: [PATCH] JSPAC: Fix a bug (I think) in orgIsMine(), and show more MFHD holdings ... ... when search scope would have it so. Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Dan Scott --- Open-ILS/web/opac/common/js/org_utils.js | 4 ++-- Open-ILS/web/opac/skin/default/js/rdetail.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/opac/common/js/org_utils.js b/Open-ILS/web/opac/common/js/org_utils.js index 1012c81067..091d277dec 100644 --- a/Open-ILS/web/opac/common/js/org_utils.js +++ b/Open-ILS/web/opac/common/js/org_utils.js @@ -100,7 +100,7 @@ function orgIsMine(me, org, depth) { if(me.id() == org.id()) { return true; } - if (depth) { + if (depth !== undefined) { while (depth < findOrgDepth(me)) { me = findOrgUnit( me.parent_ou() ); } @@ -110,7 +110,7 @@ function orgIsMine(me, org, depth) { } var kids = me.children(); for( var i = 0; kids && i < kids.length; i++ ) { - if(orgIsMine(kids[i], org, false)) { + if(orgIsMine(kids[i], org /* intentional lack of 3rd arg */)) { return true; } diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js index 3fbc501868..2d08344f5e 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -360,8 +360,9 @@ function _holdingsDraw(h) { // Only draw holdings within our OU scope var here = findOrgUnit(getLocation()); var entryNum = 0; + var depth = getDepth(); dojo.forEach(holdings, function (item) { - if (orgIsMine(here, findOrgUnit(item.owning_lib()))) { + if (orgIsMine(here, findOrgUnit(item.owning_lib()), depth)) { _holdingsDrawMFHD(item, entryNum); entryNum++; } -- 2.43.2