From f3328ced0938f9ef790b0b8bfff8b2ec3bef55d9 Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 13 Apr 2009 20:21:16 +0000 Subject: [PATCH] plugged in per-po asset creation git-svn-id: svn://svn.open-ils.org/ILS/trunk@12854 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/ui/default/acq/common/li_table.js | 27 ++++++++++++++++++++++ .../web/templates/default/acq/common/li_table.tt2 | 17 +++++++------- 2 files changed, 36 insertions(+), 8 deletions(-) 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 65e6600b24..9dbef90300 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 @@ -10,6 +10,8 @@ dojo.require('openils.acq.Picklist'); dojo.require('openils.widget.AutoFieldWidget'); dojo.require('dojo.data.ItemFileReadStore'); dojo.require('openils.widget.ProgressDialog'); +dojo.requireLocalization('openils.acq', 'acq'); +var localeStrings = dojo.i18n.getLocalization('openils.acq', 'acq'); function AcqLiTable() { @@ -474,9 +476,34 @@ function AcqLiTable() { case 'receive_po': this.receivePO(); break; + + case 'create_assets': + this.createAssets(); + break; } } + this.createAssets = function() { + if(!this.isPO) return; + if(!confirm(localeStrings.CREATE_PO_ASSETS_CONFIRM)) return; + progressDialog.show(); + fieldmapper.standardRequest( + ['open-ils.acq', 'open-ils.acq.purchase_order.assets.create'], + { async: true, + params: [this.authtoken, this.isPO], + onresponse: function(r) { + var resp = openils.Util.readResponse(r); + if(!resp) return; + if(resp.complete) { + progressDialog.hide(); + } else { + progressDialog.update({maximum:resp.total, progress:resp.progress}); + } + } + } + ); + } + this.printPO = function() { if(!this.isPO) return; progressDialogInd.show(); 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 2886c5d251..af0231f56b 100644 --- a/Open-ILS/web/templates/default/acq/common/li_table.tt2 +++ b/Open-ILS/web/templates/default/acq/common/li_table.tt2 @@ -12,14 +12,15 @@