[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. cd35c83a52ecba29fb5e5c58adddbd31683bd958

Evergreen Git git at git.evergreen-ils.org
Mon Jun 6 15:45:33 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_1 has been updated
       via  cd35c83a52ecba29fb5e5c58adddbd31683bd958 (commit)
       via  840471c63c34e3b2ba14021f1b877b681d16ccc7 (commit)
      from  3d239c8c19082db097edb7eb149734bcfccc927b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cd35c83a52ecba29fb5e5c58adddbd31683bd958
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Thu Jun 2 10:17:07 2011 -0400

    Tweak MFHD scoping
    
    Three changes:
    1) Add a closure for 'entryNum' value (currently used for some display
    placement and menu-entry correlation)
    2) Remove depth-climb to simplify code and better approximate copy scoping
    3) Move 'here' assignment out of the foreach
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Dan Scott <dan at coffeecode.net>

diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js
index 2e92d0e..b9d1cd6 100644
--- a/Open-ILS/web/opac/skin/default/js/rdetail.js
+++ b/Open-ILS/web/opac/skin/default/js/rdetail.js
@@ -355,14 +355,12 @@ function _holdingsDraw(h) {
     if (!holdings) { return null; }
 
     // Only draw holdings within our OU scope
+    var here = findOrgUnit(getLocation());
+    var entryNum = 0;
     dojo.forEach(holdings, function (item) {
-        var here = findOrgUnit(getLocation());
-        if (getDepth() > 0 || getDepth === 0 ) {
-            while (getDepth() < findOrgDepth(here))
-            here = findOrgUnit( here.parent_ou() );
-            if (orgIsMine(findOrgUnit(here), findOrgUnit(item.owning_lib()))) {
-                _holdingsDrawMFHD(item);
-            }
+        if (orgIsMine(here, findOrgUnit(item.owning_lib()))) {
+            _holdingsDrawMFHD(item, entryNum);
+            entryNum++;
         }
     });
 

commit 840471c63c34e3b2ba14021f1b877b681d16ccc7
Author: Dan Scott <dan at coffeecode.net>
Date:   Fri May 27 13:51:59 2011 -0400

    Fix rendering of MFHD records when ownership is out of scope
    
    Dojo would die with a null reference error when an MFHD record
    was retrieved that was outside of the current OU search scope.
    For example, if a given bib record had one linked MFHD record
    for BR1, and one linked MFHD record for BR4, the details page
    would choke trying to draw the MFHD holdings in a scope that
    only included BR1 and end up drawing nothing. Ungood.
    
    Moving the ownership check and invoking _holdingsDrawMFHD()
    only after ensuring that the record is within our scope resolves
    the problem.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js
index c74c385..2e92d0e 100644
--- a/Open-ILS/web/opac/skin/default/js/rdetail.js
+++ b/Open-ILS/web/opac/skin/default/js/rdetail.js
@@ -351,28 +351,28 @@ function loadMarcEditor(recId) {
  * Limited brain power means that I'm brute-forcing it for now
  */
 function _holdingsDraw(h) {
-	holdings = h.getResultObject();
-	if (!holdings) { return null; }
-
-	dojo.forEach(holdings, _holdingsDrawMFHD);
-
-	// Populate XUL menus
-	if (isXUL()) {
-		runEvt('rdetail','MFHDDrawn');
-	}
-}
-
-function _holdingsDrawMFHD(holdings, entryNum) {
+    holdings = h.getResultObject();
+    if (!holdings) { return null; }
 
+    // Only draw holdings within our OU scope
+    dojo.forEach(holdings, function (item) {
         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;
-		}
+            while (getDepth() < findOrgDepth(here))
+            here = findOrgUnit( here.parent_ou() );
+            if (orgIsMine(findOrgUnit(here), findOrgUnit(item.owning_lib()))) {
+                _holdingsDrawMFHD(item);
+            }
         }
+    });
 
+    // Populate XUL menus
+    if (isXUL()) {
+        runEvt('rdetail','MFHDDrawn');
+    }
+}
+
+function _holdingsDrawMFHD(holdings, entryNum) {
 	var hb = holdings.basic_holdings();
 	var hba = holdings.basic_holdings_add();
 	var hs = holdings.supplement_holdings();

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/opac/skin/default/js/rdetail.js |   34 ++++++++++++-------------
 1 files changed, 16 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list