From f6ac572987d68c443e16998aeb633990c37e389b Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Wed, 13 Mar 2013 10:43:40 -0400 Subject: [PATCH] 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 Signed-off-by: Bill Erickson --- .../perlmods/lib/OpenILS/Application/Acq/Order.pm | 2 ++ Open-ILS/web/js/dojo/openils/acq/nls/acq.js | 3 ++- Open-ILS/web/js/ui/default/acq/common/li_table.js | 13 ++++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) 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 ca49a79c4b..d8f7e8d4e0 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 b58f6123e7..a541cf27a5 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 @@ -2799,6 +2799,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]; @@ -2876,6 +2881,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'); @@ -2884,7 +2895,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); -- 2.43.2