[open-ils-commits] r17015 - trunk/Open-ILS/web/js/ui/default/acq/lineitem (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Jul 22 17:39:38 EDT 2010


Author: erickson
Date: 2010-07-22 17:39:32 -0400 (Thu, 22 Jul 2010)
New Revision: 17015

Modified:
   trunk/Open-ILS/web/js/ui/default/acq/lineitem/related.js
Log:
fixed bug in related lineitems page where it was attempting to fetch the bib record based on the lineitem id

Modified: trunk/Open-ILS/web/js/ui/default/acq/lineitem/related.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/lineitem/related.js	2010-07-22 21:37:59 UTC (rev 17014)
+++ trunk/Open-ILS/web/js/ui/default/acq/lineitem/related.js	2010-07-22 21:39:32 UTC (rev 17015)
@@ -23,7 +23,8 @@
                 "flesh_cancel_reason": true
             }],
             "oncomplete": function(r) {
-                fetchBib();
+                var li = openils.Util.readResponse(r);
+                fetchBib(li.eg_bib_id());
             }
         }
     );
@@ -56,13 +57,14 @@
     );
 }
 
-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



More information about the open-ils-commits mailing list