From 8a4592223eb5efb6f9d07b618c1a35eef8bf72db Mon Sep 17 00:00:00 2001 From: senator Date: Thu, 22 Jul 2010 21:33:32 +0000 Subject: [PATCH] Acq: attempt to fix issue where adding copies in an LI table's copies interface, then returning to the table view, then going back to copies doesn't show the most recent saved changes. git-svn-id: svn://svn.open-ils.org/ILS/trunk@17013 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/ui/default/acq/common/li_table.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js index c86523751c..fe276c804b 100644 --- a/Open-ILS/web/js/ui/default/acq/common/li_table.js +++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js @@ -801,6 +801,7 @@ function AcqLiTable() { oncomplete: function(r) { var li = openils.Util.readResponse(r); + self.liCache[liId] = li; handler(li) } } @@ -887,7 +888,10 @@ function AcqLiTable() { ); } - this.drawCopies = function(liId) { + this.drawCopies = function(liId, force_fetch) { + if (typeof force_fetch == "undefined") + force_fetch = false; + this.show('copies'); var self = this; this.copyCache = {}; @@ -912,7 +916,7 @@ function AcqLiTable() { function() { openils.acq.Lineitem.fetchAttrDefs( function() { - self._fetchLineitem(liId, function(li){self._drawCopies(li);}); + self._fetchLineitem(liId, function(li){self._drawCopies(li);}, force_fetch); } ); } @@ -1775,14 +1779,14 @@ function AcqLiTable() { openils.Util.show("acq-lit-update-copies-progress"); fieldmapper.standardRequest( ['open-ils.acq', 'open-ils.acq.lineitem_detail.cud.batch'], - { async: true, + { async: false, params: [openils.User.authtoken, copies], onresponse: function(r) { var res = openils.Util.readResponse(r); litUpdateCopiesProgress.update(res); }, oncomplete: function() { - self.drawCopies(liId); + self.drawCopies(liId, true /* force_fetch */); openils.Util.hide("acq-lit-update-copies-progress"); } } -- 2.11.0