[open-ils-commits] [GIT] Evergreen ILS branch master updated. 032b9e7f47d25f3d2f166dc516b8dfe972249ed4

Evergreen Git git at git.evergreen-ils.org
Thu Oct 11 11:04:36 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  032b9e7f47d25f3d2f166dc516b8dfe972249ed4 (commit)
      from  c650360b7adb7f1f25ac176b45d3598591fdf05c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 032b9e7f47d25f3d2f166dc516b8dfe972249ed4
Author: Bill Erickson <berick at esilibrary.com>
Date:   Wed Oct 3 15:00:26 2012 -0400

    ACQ invoice receive UI handles async LI retrieval
    
    openils.acq.Linetitem.fetchAndRender() now fetches lineitems
    asynchronously.  This commit causes the invoice receive UI to calculate
    the copies to be received after all lineitems have been (async) fetched.
    Without this, it always appears as though there are no copies to receive
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/web/js/ui/default/acq/invoice/receive.js b/Open-ILS/web/js/ui/default/acq/invoice/receive.js
index d521335..b9320c9 100644
--- a/Open-ILS/web/js/ui/default/acq/invoice/receive.js
+++ b/Open-ILS/web/js/ui/default/acq/invoice/receive.js
@@ -265,28 +265,38 @@ function ReceivableCopyTable() {
             this._set_invoice_header();
         }
 
-        this.pcrud.search("acqie", {"invoice": this.inv_id}).forEach(
+        var entries = this.pcrud.search("acqie", {"invoice": this.inv_id});
+        var fetched = 0;
+        var self = this;
+
+        entries.forEach(
             function(entry) {
                 if (entry.lineitem()) {
                     openils.acq.Lineitem.fetchAndRender(
                         entry.lineitem(),
                         {"flesh_li_details": true, "flesh_notes": true},
-                        function(li, str) { self.add_lineitem(entry, li, str); }
+                        function(li, str) { 
+                            self.add_lineitem(entry, li, str); 
+
+                            fetched++;
+                            if (fetched == entries.length) {
+                                self._render_copy_count_info();
+
+                                if (openils.Util.objectProperties(self.li_by_lid).length) {
+                                    openils.Util.show("non-empty");
+                                    openils.Util.hide("empty");
+                                } else {
+                                    openils.Util.hide("non-empty");
+                                    openils.Util.show("empty");
+                                }
+
+                                progress_dialog.hide();
+                            }
+                        }
                     );
                 }
             }
         );
-
-        this._render_copy_count_info();
-
-        if (openils.Util.objectProperties(this.li_by_lid).length) {
-            openils.Util.show("non-empty");
-            openils.Util.hide("empty");
-        } else {
-            openils.Util.hide("non-empty");
-            openils.Util.show("empty");
-        }
-        progress_dialog.hide();
     };
 
     /* returns an array of lineitem_detail IDs */

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/js/ui/default/acq/invoice/receive.js |   36 +++++++++++++-------
 1 files changed, 23 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list