[open-ils-commits] r17013 - trunk/Open-ILS/web/js/ui/default/acq/common (senator)

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


Author: senator
Date: 2010-07-22 17:33:32 -0400 (Thu, 22 Jul 2010)
New Revision: 17013

Modified:
   trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
Log:
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.


Modified: trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js	2010-07-22 20:59:52 UTC (rev 17012)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js	2010-07-22 21:33:32 UTC (rev 17013)
@@ -801,6 +801,7 @@
 
                 oncomplete: function(r) {
                     var li = openils.Util.readResponse(r);
+                    self.liCache[liId] = li;
                     handler(li)
                 }
             }
@@ -887,7 +888,10 @@
         );
     }
 
-    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() {
                 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 @@
             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");
                     }
                 }



More information about the open-ils-commits mailing list