[open-ils-commits] [GIT] Evergreen ILS branch rel_2_0 updated. c7e7477079bfde1dfe00efe2cfc8ebdc0c457020

Evergreen Git git at git.evergreen-ils.org
Mon Jun 6 15:46:10 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_0 has been updated
       via  c7e7477079bfde1dfe00efe2cfc8ebdc0c457020 (commit)
       via  d40831870ac9124ddd7438e38b847f7d67d251ee (commit)
      from  d30e80f798d1f868f96ed2ac637a9a0de012291c (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 c7e7477079bfde1dfe00efe2cfc8ebdc0c457020
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 95afd73..cbbc802 100644
--- a/Open-ILS/web/opac/skin/default/js/rdetail.js
+++ b/Open-ILS/web/opac/skin/default/js/rdetail.js
@@ -275,14 +275,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 d40831870ac9124ddd7438e38b847f7d67d251ee
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 4b2ceb1..95afd73 100644
--- a/Open-ILS/web/opac/skin/default/js/rdetail.js
+++ b/Open-ILS/web/opac/skin/default/js/rdetail.js
@@ -271,28 +271,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