fixed bug in related lineitems page where it was attempting to fetch the bib record...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 22 Jul 2010 21:39:32 +0000 (21:39 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 22 Jul 2010 21:39:32 +0000 (21:39 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17015 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/acq/lineitem/related.js

index f6f170b..f377bb6 100644 (file)
@@ -23,7 +23,8 @@ function fetchLi() {
                 "flesh_cancel_reason": true
             }],
             "oncomplete": function(r) {
-                fetchBib();
+                var li = openils.Util.readResponse(r);
+                fetchBib(li.eg_bib_id());
             }
         }
     );
@@ -56,13 +57,14 @@ function fetchRelated() {
     );
 }
 
-function fetchBib() {
+function fetchBib(bibId) {
+    bibId = bibId || targetId;
     new openils.BibTemplate({ 
-        record : targetId, 
+        record : bibId, 
         org_unit : fieldmapper.aou.findOrgUnit(openils.User.user.ws_ou()).shortname()
     }).render();
 
-    new openils.PermaCrud().retrieve('bre', targetId, {
+    new openils.PermaCrud().retrieve('bre', bibId, {
         oncomplete : function(r) {
             bibRecord = openils.Util.readResponse(r);
             // render bib details