[open-ils-commits] r17455 - in branches/rel_2_0/Open-ILS/web: js/ui/default/acq/search templates/default/acq/search (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Sep 2 17:05:10 EDT 2010


Author: erickson
Date: 2010-09-02 17:05:04 -0400 (Thu, 02 Sep 2010)
New Revision: 17455

Modified:
   branches/rel_2_0/Open-ILS/web/js/ui/default/acq/search/invoice.js
   branches/rel_2_0/Open-ILS/web/templates/default/acq/search/unified.tt2
Log:
back-porting: 17355 use openils.Util.printHtmlString for invoice printing; added progress dialog while wiating for invoices to arrive

Modified: branches/rel_2_0/Open-ILS/web/js/ui/default/acq/search/invoice.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/ui/default/acq/search/invoice.js	2010-09-02 21:04:26 UTC (rev 17454)
+++ branches/rel_2_0/Open-ILS/web/js/ui/default/acq/search/invoice.js	2010-09-02 21:05:04 UTC (rev 17455)
@@ -1,3 +1,5 @@
+dojo.require('openils.widget.ProgressDialog');
+
 function getInvIdent(rowIndex, item) {
     if (item) {
         return {
@@ -19,9 +21,9 @@
     var inv_ids = dijit.byId("acq-unified-inv-grid").
         getSelectedItems().map(function(o) {return o.id[0];});
 
-    /* XXX this business about opening a window and populating its
-     * body should be wrapped up in a simple dijit or something.
-     * consolidate with claim_voucher.js maybe. */
+    progressDialog.show(true);
+
+    var html;
     if (inv_ids.length) {
         var win = null;
         fieldmapper.standardRequest(
@@ -30,22 +32,18 @@
                 "async": true,
                 "onresponse": function(r) {
                     if (r = openils.Util.readResponse(r)) {
-                        if (!win) {
-                            win = window.open(
-                                "", "", "resizable,width=800," +
-                                "height=600,scrollbars=1"
-                            );
-                            win.document.title = localeStrings.INVOICES;
-                            win.document.body.innerHTML =
-                                "<style type='text/css'>.acq-invoice-" +
+                        if(!html) {
+                            html = "<style type='text/css'>.acq-invoice-" +
                                 "voucher {page-break-after:always;}" +
                                 "</style>\n";
                         }
-                        win.document.body.innerHTML +=
-                            r.template_output().data();
+                        html += r.template_output().data();
                     }
                 },
-                "oncomplete": function() { win.print(); }
+                "oncomplete": function() { 
+                    progressDialog.hide();
+                    openils.Util.printHtmlString(html);
+                }
             }
         );
     }

Modified: branches/rel_2_0/Open-ILS/web/templates/default/acq/search/unified.tt2
===================================================================
--- branches/rel_2_0/Open-ILS/web/templates/default/acq/search/unified.tt2	2010-09-02 21:04:26 UTC (rev 17454)
+++ branches/rel_2_0/Open-ILS/web/templates/default/acq/search/unified.tt2	2010-09-02 21:05:04 UTC (rev 17455)
@@ -229,5 +229,6 @@
         [% INCLUDE "default/acq/common/li_table_pager.tt2" %]
         [% INCLUDE "default/acq/common/li_table.tt2" %]
     </div>
+    <div jsId='progressDialog' dojoType='openils.widget.ProgressDialog'/>
 </div>
 [% END %]



More information about the open-ils-commits mailing list