[open-ils-commits] [GIT] Evergreen ILS branch master updated. d54a9c8d6b0e3c4bc2503420c1e054693058e3e0

Evergreen Git git at git.evergreen-ils.org
Mon Jun 6 15:41:39 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, master has been updated
       via  d54a9c8d6b0e3c4bc2503420c1e054693058e3e0 (commit)
       via  14ff73e8a9ccdd2f5cfa2851b8cfd60b0c1bb92c (commit)
       via  34e57d1be25446e1de88a5a44afba7c57a287f6b (commit)
       via  cb8dd181d92c78939dd5f275fffae00067b90da5 (commit)
       via  3bd7c7e41404585b925915afbd2abd67bf4300bf (commit)
      from  19685ce120646a4eec75322f387d93d7d64a4e38 (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 d54a9c8d6b0e3c4bc2503420c1e054693058e3e0
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 14ff73e8a9ccdd2f5cfa2851b8cfd60b0c1bb92c
Merge: 34e57d1 19685ce
Author: Dan Scott <dan at coffeecode.net>
Date:   Mon Jun 6 15:18:06 2011 -0400

    Merge branch 'master' of git.evergreen-ils.org:Evergreen into dbs/fix-mfhd-render


commit 34e57d1be25446e1de88a5a44afba7c57a287f6b
Merge: cb8dd18 501f26f
Author: Dan Scott <dan at coffeecode.net>
Date:   Tue May 31 17:00:34 2011 -0400

    Merge branch 'master' of git.evergreen-ils.org:Evergreen into dbs/fix-mfhd-render


commit cb8dd181d92c78939dd5f275fffae00067b90da5
Merge: 3bd7c7e 3fe31b6
Author: Dan Scott <dan at coffeecode.net>
Date:   Tue May 31 09:32:57 2011 -0400

    Merge branch 'master' of git.evergreen-ils.org:Evergreen into dbs/fix-mfhd-render


commit 3bd7c7e41404585b925915afbd2abd67bf4300bf
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