From 634aa42621eceeb156bc53b4e50f50d4e0ea8163 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 11 Aug 2015 16:37:14 +0000 Subject: [PATCH] LP#1482400: increase visibility of record count during order activation The progress dialog shown during the asset-creation phase of order activation now also displays record counts above the progress bar. To test: [1] Following the test plan of the previous patch, verify that the progress dialog now displays and updates text above the progress bar indicating how many records it has processed, e.g., "Bib Records Merged/Import: 25" Signed-off-by: Galen Charlton --- Open-ILS/web/js/dojo/openils/acq/nls/acq.js | 8 +++++++- Open-ILS/web/js/dojo/openils/widget/ProgressDialog.js | 16 ++++++++++++++++ Open-ILS/web/js/ui/default/acq/common/li_table.js | 19 +++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js index 1915300fb1..0248ad6ef3 100644 --- a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js +++ b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js @@ -105,5 +105,11 @@ "PO_NAME_OPTIONAL" : "${0} (optional)", "LI_EXISTING_COPIES" : "There are ${0} existing copies for this bibliographic record at this location", "LI_CREATING_ASSETS" : "Creating bib, call number, and copy records...", - "PO_ACTIVATING" : "Activating purchase order..." + "PO_ACTIVATING" : "Activating purchase order...", + "ACTIVATE_LI_PROCESSED" : "Lineitems Processed: ${0}", + "ACTIVATE_VQBR_PROCESSED" : "Vandelay Records Processed: ${0}", + "ACTIVATE_BIBS_PROCESSED" : "Bib Records Merged/Imported: ${0}", + "ACTIVATE_LID_PROCESSED" : "ACQ Copies Processed: ${0}", + "ACTIVATE_DEBITS_ACCRUED_PROCESSED" : "Debits Encumbered: ${0}", + "ACTIVATE_COPIES_PROCESSED" : "Real Copies Processed: ${0}" } diff --git a/Open-ILS/web/js/dojo/openils/widget/ProgressDialog.js b/Open-ILS/web/js/dojo/openils/widget/ProgressDialog.js index 7d2d43d34f..977d490e23 100644 --- a/Open-ILS/web/js/dojo/openils/widget/ProgressDialog.js +++ b/Open-ILS/web/js/dojo/openils/widget/ProgressDialog.js @@ -48,6 +48,22 @@ if(!dojo._hasResource['openils.widget.ProgressDialog']) { } this.inherited(arguments); + }, + + update_message : function(msg) { + if(msg || (msg = this.message) ) { + if(!this.msgDiv) { + this.msgDiv = dojo.create('div', {innerHTML : msg}); + this.containerNode.insertBefore(this.msgDiv, this.progress.domNode); + } else { + this.msgDiv.innerHTML = msg; + } + } else { + if(this.msgDiv) { + this.containerNode.removeChild(this.msgDiv); + this.msgDiv = null; + } + } } } ); 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 b863832870..12e177d122 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 @@ -95,6 +95,7 @@ function AcqLiTable() { } ); this.vlAgent = new VLAgent(); + this.batchProgress = {}; if (dojo.byId('acq-lit-apply-idents')) { dojo.byId('acq-lit-apply-idents').onclick = function() { @@ -2943,6 +2944,7 @@ function AcqLiTable() { this.show('acq-lit-progress-numbers'); var self = this; var vlArgs = (noVl) ? {} : {vandelay : this.vlAgent.values()}; + this.batchProgress = {}; progressDialog.show(true); progressDialog.attr("title", localeStrings.LI_CREATING_ASSETS); fieldmapper.standardRequest( @@ -3252,11 +3254,13 @@ function AcqLiTable() { }; this._updateProgressNumbers = function(resp, reloadOnComplete, onComplete, clearProgressDialog) { + this._updateProgressDialog(resp); this.vlAgent.handleResponse(resp, function(resp, res) { if (clearProgressDialog) { progressDialog.hide(); progressDialog.attr("title", ""); + progressDialog.update_message(); } if(reloadOnComplete) location.href = location.href; @@ -3266,6 +3270,21 @@ function AcqLiTable() { ); } + this._updateProgressDialog = function(resp) { + var keys = ['li', 'vqbr', 'bibs', 'lid', 'debits_accrued', 'copies']; + for (var i = 0; i < keys.length; i++) { + if (resp[keys[i]] > (this.batchProgress[keys[i]] || 0)) { + progressDialog.update_message( + dojo.string.substitute( + localeStrings["ACTIVATE_" + keys[i].toUpperCase() + "_PROCESSED"], + [ resp[keys[i]] ] + ) + ); + break; + } + } + this.batchProgress = resp; + } this._createPO = function(fields) { var wantall = (fields.create_from == "all"); -- 2.11.0