From: erickson Date: Thu, 26 Aug 2010 18:14:12 +0000 (+0000) Subject: use openils.Util.printHtmlString for invoice printing; added progress dialog while... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b18151cc8a2ac05e8f7d4f667bed8eec44134361;p=evergreen%2Fpines.git use openils.Util.printHtmlString for invoice printing; added progress dialog while wiating for invoices to arrive git-svn-id: svn://svn.open-ils.org/ILS/trunk@17355 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/ui/default/acq/search/invoice.js b/Open-ILS/web/js/ui/default/acq/search/invoice.js index 02adfb28b2..a5dc460f90 100644 --- a/Open-ILS/web/js/ui/default/acq/search/invoice.js +++ b/Open-ILS/web/js/ui/default/acq/search/invoice.js @@ -1,3 +1,5 @@ +dojo.require('openils.widget.ProgressDialog'); + function getInvIdent(rowIndex, item) { if (item) { return { @@ -19,9 +21,9 @@ function printInvoiceVouchers() { 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 @@ function printInvoiceVouchers() { "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 = - "\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); + } } ); } diff --git a/Open-ILS/web/templates/default/acq/search/unified.tt2 b/Open-ILS/web/templates/default/acq/search/unified.tt2 index 120436a3e4..2befad99e4 100644 --- a/Open-ILS/web/templates/default/acq/search/unified.tt2 +++ b/Open-ILS/web/templates/default/acq/search/unified.tt2 @@ -229,5 +229,6 @@ [% INCLUDE "default/acq/common/li_table_pager.tt2" %] [% INCLUDE "default/acq/common/li_table.tt2" %] +
[% END %]