From: Lebbeous Fogle-Weekley Date: Wed, 13 Mar 2013 14:43:40 +0000 (-0400) Subject: Acq: two tweaks to UI improvements in previous commit X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=324ecea0636741bdea876112f717bd03fd772133;p=working%2FEvergreen.git Acq: two tweaks to UI improvements in previous commit Suggested by Bill Erickson: * Prevent interface locking up with the Mark Received/Unreceived actions when nothing is selected * Make new lineitem batch receive/rollback API methods actually stream Signed-off-by: Lebbeous Fogle-Weekley --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm index a5f8c98c25..4351a252bd 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm @@ -2158,6 +2158,7 @@ sub receive_lineitem_api { __PACKAGE__->register_method( method => 'receive_lineitem_batch_api', api_name => 'open-ils.acq.lineitem.receive.batch', + stream => 1, signature => { desc => 'Mark lineitems as received', params => [ @@ -2344,6 +2345,7 @@ sub rollback_receive_lineitem_api { __PACKAGE__->register_method( method => 'rollback_receive_lineitem_batch_api', api_name => 'open-ils.acq.lineitem.receive.rollback.batch', + stream => 1, signature => { desc => 'Mark a list of lineitems as Un-received', params => [ 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 ad82f7b155..1f15d1622b 100644 --- a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js +++ b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js @@ -89,5 +89,6 @@ "CREATE_PO_INVALID": "A purchase order must have an ordering agency and a provider.", "INVOICE_COPY_COUNT_INFO": "Copies received on this invoice: ${0} out of ${1}.", "INVOICE_IDENT_COLLIDE": "There is already an invoice in the system with the given combination of 'Vendor Invoice ID' and 'Provider,' which is not allowed.", - "NEW_INVOICE": "New Invoice" + "NEW_INVOICE": "New Invoice", + "NO_LI_GENERAL" : "You have not selected any line items.", } 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 93cdbe1d12..2a7bed4ece 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 @@ -2426,6 +2426,11 @@ function AcqLiTable() { this.receiveSelectedLineitems = function() { var li_list = this.getSelected(); + if (!li_list.length) { + alert(localeStrings.NO_LI_GENERAL); + return; + } + for (var i = 0; i < li_list.length; i++) { var li = li_list[i]; @@ -2503,6 +2508,12 @@ function AcqLiTable() { }; this.rollbackReceiveLineitems = function() { + var li_id_list = this.getSelected(false, null, true); + if (!li_id_list.length) { + alert(localeStrings.NO_LI_GENERAL); + return; + } + if (!confirm(localeStrings.ROLLBACK_LI_RECEIVE_CONFIRM)) return; this.show('acq-lit-progress-numbers'); @@ -2511,7 +2522,7 @@ function AcqLiTable() { fieldmapper.standardRequest( ['open-ils.acq', 'open-ils.acq.lineitem.receive.rollback.batch'], { async: true, - params: [this.authtoken, this.getSelected(false, null, true)], + params: [this.authtoken, li_id_list], onresponse : function(r) { var resp = openils.Util.readResponse(r); self._updateProgressNumbers(resp, true);