From cfdb4b998b8c751ea8ce60aaf47ddecae0ab4797 Mon Sep 17 00:00:00 2001 From: Remington Steed Date: Wed, 22 Aug 2018 14:19:19 -0400 Subject: [PATCH] LP#1777675: Fix code to update Item Status grid Testing revealed that the grid rows use a different data structure, and the object member names include dots (periods). Thus, bracket notation is required to access those members. This commit also makes a few smaller changes: - Prevents an error in the Check-in app when a last_copy_inventory doesn't exist yet. - Removes the "refresh" parameter from the updateInventory() function, which is never supplied when called, nor used by the function. - Adds some brief code comments. Signed-off-by: Remington Steed Signed-off-by: Dan Wells Signed-off-by: Kathy Lussier --- Open-ILS/web/js/ui/default/staff/circ/checkin/app.js | 2 +- Open-ILS/web/js/ui/default/staff/circ/services/item.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js index b1e0aed937..8d9eec416b 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js @@ -210,7 +210,7 @@ function($scope , $q , $window , $location , $timeout , egCore , checkinSvc , eg row_item['copy_barcode'] = row_item.acp.barcode(); - if (row_item.acp.last_copy_inventory().inventory_date() == "now") + if (row_item.acp.last_copy_inventory() && row_item.acp.last_copy_inventory().inventory_date() == "now") row_item.acp.last_copy_inventory().inventory_date(Date.now()); if (row_item.mbts) { diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/item.js b/Open-ILS/web/js/ui/default/staff/circ/services/item.js index 79d099f991..99f260cd77 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/item.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/item.js @@ -195,7 +195,8 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog } - service.updateInventory = function(copy_list, all_items, refresh) { + //all_items = selected grid rows, to be updated in place + service.updateInventory = function(copy_list, all_items) { if (copy_list.length == 0) return; return egCore.net.request( 'open-ils.circ', @@ -210,8 +211,9 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog {flesh: 1, flesh_fields: {alci: ['inventory_workstation']} }).then(function(alci) { - item._last_copy_inventory.inventory_date = alci.inventory_date(); - item._last_copy_inventory._inventory_workstation_name = + //update existing grid rows + item["last_copy_inventory.inventory_date"] = alci.inventory_date(); + item["last_copy_inventory.inventory_workstation.name"] = alci.inventory_workstation().name(); }); } -- 2.43.2