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

Evergreen Git git at git.evergreen-ils.org
Wed Dec 14 16:16:29 EST 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  00294ea6d3f4482b502cdc4cb68b7791c4c531a6 (commit)
      from  11c9d08d61d0d8fa9a4d68c42367e398b930e2d5 (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 00294ea6d3f4482b502cdc4cb68b7791c4c531a6
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Wed Dec 14 14:30:52 2011 -0500

    Fix can_have_copies checks
    
    Bibs aren't required to have sources. Thus, adjust all appropriate locations
    to support a default state of "no source bibs can have copies", without
    erroring out.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    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 da5f86c..dfc4c7d 100644
--- a/Open-ILS/web/opac/skin/default/js/rdetail.js
+++ b/Open-ILS/web/opac/skin/default/js/rdetail.js
@@ -197,7 +197,7 @@ function rdetailDraw() {
 				var sourceReq = new Request(FETCH_BIB_SOURCE, G.user.session, bib.source());
 				sourceReq.send(true);
 				var source = sourceReq.result();
-				if (source.can_have_copies() == 'f') {
+				if (source && source.can_have_copies() == 'f') {
 					alert(dojo.string.substitute(opac_strings.SOURCE_CANNOT_HAVE_COPIES, [source.source()]));
 				} else {
 					var req = new Request(CREATE_MFHD_RECORD, G.user.session, 1, here.id(), getRid());
diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
index a07b9a4..659d652 100644
--- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
+++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
@@ -573,7 +573,7 @@ function create_mfhd() {
             [ ses(), bibObj.source() ]
         );
 
-        if (cbsObj.can_have_copies() != get_db_true()) {
+        if (cbsObj && cbsObj.can_have_copies() != get_db_true()) {
             alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbsObj.source()]));
             return;
         }
@@ -948,7 +948,7 @@ function add_volumes() {
                 [ ses(), bibObj.source() ]
             );
 
-            if (cbsObj.can_have_copies() != get_db_true()) {
+            if (cbdObj && cbsObj.can_have_copies() != get_db_true()) {
                 alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbsObj.source()]));
                 return;
             }
diff --git a/Open-ILS/xul/staff_client/server/cat/bib_brief.js b/Open-ILS/xul/staff_client/server/cat/bib_brief.js
index df04c3d..face076 100644
--- a/Open-ILS/xul/staff_client/server/cat/bib_brief.js
+++ b/Open-ILS/xul/staff_client/server/cat/bib_brief.js
@@ -173,7 +173,7 @@ function add_volumes() {
         try {
             JSAN.use('cat.util');
             var cbsObj = cat.util.get_cbs_for_bre_id(docid);
-            if (cbsObj.can_have_copies() != get_db_true()) {
+            if (cbsObj && cbsObj.can_have_copies() != get_db_true()) {
                 alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbsObj.source()]));
                 return;
             }
diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.js b/Open-ILS/xul/staff_client/server/cat/copy_browser.js
index 046c88e..c71183f 100644
--- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js
+++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js
@@ -1857,8 +1857,12 @@ cat.copy_browser.prototype = {
         try {
             JSAN.use('cat.util');
             var cbsObj = cat.util.get_cbs_for_bre_id(obj.docid);
-            obj.can_have_copies = (cbsObj.can_have_copies() == get_db_true());
-            obj.source = cbsObj.source();
+            if(cbsObj) {
+                obj.can_have_copies = (cbsObj.can_have_copies() == get_db_true());
+                obj.source = cbsObj.source();
+            } else {
+                obj.can_have_copies = true;
+            }
         } catch(E) {
             obj.error.sdump('D_ERROR','can have copies check: ' + E);
             alert(E);

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

Summary of changes:
 Open-ILS/web/opac/skin/default/js/rdetail.js       |    2 +-
 .../xul/staff_client/chrome/content/cat/opac.js    |    4 ++--
 Open-ILS/xul/staff_client/server/cat/bib_brief.js  |    2 +-
 .../xul/staff_client/server/cat/copy_browser.js    |    8 ++++++--
 4 files changed, 10 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list