Revert changes to opac.js from "previous" commit.
authorJason Stephenson <jstephenson@mvlc.org>
Wed, 16 Nov 2011 01:36:01 +0000 (20:36 -0500)
committerJason Stephenson <jstephenson@mvlc.org>
Wed, 16 Nov 2011 01:36:01 +0000 (20:36 -0500)
Turns out that opac.js has problems using files from the server via
JSAN.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/xul/staff_client/chrome/content/cat/opac.js

index d6cca68..a07b9a4 100644 (file)
@@ -559,8 +559,19 @@ function set_serctrl_view() {
 function create_mfhd() {
     // Check if the source is allowed to have copies, first.
     try {
-        JSAN.use('cat.util');
-        var cbsObj = cat.util.get_cbs_for_bre_id(docid);
+        var bibObj = g.network.request(
+            api.FM_BRE_RETRIEVE_VIA_ID.app,
+            api.FM_BRE_RETRIEVE_VIA_ID.method,
+            [ ses(), [docid] ]
+        );
+
+        bibObj = bibObj[0];
+
+        var cbsObj = g.network.request(
+            api.FM_CBS_RETRIEVE_VIA_PCRUD.app,
+            api.FM_CBS_RETRIEVE_VIA_PCRUD.method,
+            [ ses(), bibObj.source() ]
+        );
 
         if (cbsObj.can_have_copies() != get_db_true()) {
             alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbsObj.source()]));
@@ -923,8 +934,19 @@ function add_volumes() {
 
         // Check if the source is allowed to have copies.
         try {
-            JSAN.use('cat.util');
-            var cbsObj = cat.util.get_cbs_for_bre_id(docid);
+            var bibObj = g.network.request(
+                api.FM_BRE_RETRIEVE_VIA_ID.app,
+                api.FM_BRE_RETRIEVE_VIA_ID.method,
+                               [ ses(), [docid] ]
+            );
+
+                       bibObj = bibObj[0];
+
+            var cbsObj = g.network.request(
+                api.FM_CBS_RETRIEVE_VIA_PCRUD.app,
+                api.FM_CBS_RETRIEVE_VIA_PCRUD.method,
+                [ ses(), bibObj.source() ]
+            );
 
             if (cbsObj.can_have_copies() != get_db_true()) {
                 alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbsObj.source()]));