From b2a87a7306ced98c035c6432252a220b28724b4e Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 6 Apr 2009 15:22:40 +0000 Subject: [PATCH] started plugging in PO printing, at least to HTML. this assumes a format.po.html trigger hook git-svn-id: svn://svn.open-ils.org/ILS/trunk@12797 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/ui/default/acq/common/li_table.js | 25 ++++++++++++++++++++++ Open-ILS/web/js/ui/default/acq/po/view_po.js | 2 +- .../web/templates/default/acq/common/li_table.tt2 | 2 ++ 3 files changed, 28 insertions(+), 1 deletion(-) 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 9df4a44713..6145196cd7 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 @@ -9,6 +9,7 @@ dojo.require('openils.acq.PO'); dojo.require('openils.acq.Picklist'); dojo.require('openils.widget.AutoFieldWidget'); dojo.require('dojo.data.ItemFileReadStore'); +dojo.require('openils.widget.ProgressDialog'); function AcqLiTable() { @@ -442,9 +443,33 @@ function AcqLiTable() { this._loadPLSelect(); acqLitSavePlDialog.show(); break; + + case 'print_po': + this.printPO(); + break; } } + this.printPO = function() { + if(!this.isPO) return; + progressDialog.show(); + console.log("printing PO " + this.isPO); + fieldmapper.standardRequest( + ['open-ils.acq', 'open-ils.acq.purchase_order.format'], + { async: true, + params: [this.authtoken, this.isPO, 'html'], + oncomplete: function(r) { + progressDialog.hide(); + var evt = openils.Util.readResponse(r); + if(evt && evt.template_output()) { + win = window.open('','', 'resizable,width=700,height=500,scrollbars=1'); + win.document.body.innerHTML = evt.template_output().data(); + } + } + } + ); + } + this._createPO = function(fields) { this.show('acq-lit-create-po-progress'); var po = new fieldmapper.acqpo(); diff --git a/Open-ILS/web/js/ui/default/acq/po/view_po.js b/Open-ILS/web/js/ui/default/acq/po/view_po.js index e0bb98286a..d8900c367f 100644 --- a/Open-ILS/web/js/ui/default/acq/po/view_po.js +++ b/Open-ILS/web/js/ui/default/acq/po/view_po.js @@ -8,7 +8,7 @@ var liTable; function init() { liTable = new AcqLiTable(); liTable.reset(); - liTable.isPO = true; + liTable.isPO = poId; fieldmapper.standardRequest( ['open-ils.acq', 'open-ils.acq.purchase_order.retrieve'], diff --git a/Open-ILS/web/templates/default/acq/common/li_table.tt2 b/Open-ILS/web/templates/default/acq/common/li_table.tt2 index e3fe968523..f03a536cc6 100644 --- a/Open-ILS/web/templates/default/acq/common/li_table.tt2 +++ b/Open-ILS/web/templates/default/acq/common/li_table.tt2 @@ -252,5 +252,7 @@ + -- 2.11.0