From: erickson Date: Thu, 22 Jul 2010 21:39:32 +0000 (+0000) Subject: fixed bug in related lineitems page where it was attempting to fetch the bib record... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8a7f358d153733852b1edac0d490d2b3d1f7126e;p=evergreen%2Fbjwebb.git fixed bug in related lineitems page where it was attempting to fetch the bib record based on the lineitem id git-svn-id: svn://svn.open-ils.org/ILS/trunk@17015 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/ui/default/acq/lineitem/related.js b/Open-ILS/web/js/ui/default/acq/lineitem/related.js index f6f170b67..f377bb6c2 100644 --- a/Open-ILS/web/js/ui/default/acq/lineitem/related.js +++ b/Open-ILS/web/js/ui/default/acq/lineitem/related.js @@ -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