reinstate "Mark Received" and "Un-Receive" options to individual line items. This...
authorBill Erickson <berickxx@gmail.com>
Wed, 29 Oct 2014 21:09:05 +0000 (17:09 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
    Cross-port: 1defb6b

KCLS/openils/var/templates_kcls/acq/common/li_table.tt2
Open-ILS/web/js/ui/kcls/acq/common/li_table.js

index ea6f1ce..170f9ce 100644 (file)
                     <td>
                         <select name='actions'>
                             <option name='action_none'>[% l('-- Actions --') %]</option>
+                            <option name='action_mark_recv' disabled='disabled'>Mark Received</option>
+                            <option name='action_mark_unrecv' disabled='disabled'>Un-Receive</option>
                             <option name='action_update_barcodes'>[% l('Update Barcodes') %]</option>
                             <option name='action_holdings_maint'>[% l('Holdings Maint.') %]</option>
                             <option name='action_manage_claims'>[% l('Claims') %]</option>
index 28acf89..a983a37 100644 (file)
@@ -1106,7 +1106,8 @@ function AcqLiTable() {
     /* XXX NOT related to _updateLiState(). rethink */
     this.updateLiState = function(li, row) {
         if (!row) row = this._findLiRow(li);
-
+        var actReceive = nodeByName("action_mark_recv", row);
+        var actUnRecv = nodeByName("action_mark_unrecv", row);
         var actUpdateBarcodes = nodeByName("action_update_barcodes", row);
         var actHoldingsMaint = nodeByName("action_holdings_maint", row);
 
@@ -1174,9 +1175,21 @@ function AcqLiTable() {
                 return; // all done
 
             case "on-order":
+                actReceive.disabled = false;
+                actReceive.onclick = function() {
+                    if (self.checkLiAlerts(li.id()))
+                        self.issueReceive(li);
+                    nodeByName("action_none", row).selected = true;
+                };
                 break;
 
             case "received":
+                actUnRecv.disabled = false;
+                actUnRecv.onclick = function() {
+                    if (confirm(localeStrings.UNRECEIVE_LI))
+                        self.issueReceive(li, /* rollback */ true);
+                    nodeByName("action_none", row).selected = true;
+                };
                 break;
         }