Acq: two tweaks to UI improvements in previous commit
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 13 Mar 2013 14:43:40 +0000 (10:43 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 13 Mar 2013 19:51:26 +0000 (15:51 -0400)
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 <lebbeous@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm
Open-ILS/web/js/dojo/openils/acq/nls/acq.js
Open-ILS/web/js/ui/default/acq/common/li_table.js

index ca49a79..d8f7e8d 100644 (file)
@@ -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 => [
index ad82f7b..1f15d16 100644 (file)
@@ -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.",
 }
index b58f612..a541cf2 100644 (file)
@@ -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);