From 8f6c8570d127abf138dc34def58c4b50e9c0d9dc Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Fri, 26 Oct 2018 20:20:16 -0400 Subject: [PATCH] Fix up the other places. --- Open-ILS/web/js/ui/default/staff/cat/catalog/app.js | 17 ++++++----------- Open-ILS/web/js/ui/default/staff/cat/item/app.js | 11 ++--------- Open-ILS/web/js/ui/default/staff/circ/checkin/app.js | 14 +++++++------- Open-ILS/web/js/ui/default/staff/circ/renew/app.js | 8 ++++---- Open-ILS/web/js/ui/default/staff/circ/services/holds.js | 17 +++++++++-------- 5 files changed, 28 insertions(+), 39 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js index 07c2592e83..815f9d5efa 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js @@ -1637,22 +1637,17 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e $scope.selectedHoldingsDiscard = function () { var copy_list = gatherSelectedRawCopies(); if (copy_list.length == 0) return; - - angular.forEach(copy_list, function(cp) { - egCirc.mark_discard({ - id: cp.id(), - barcode: cp.barcode(), - circ_lib: cp.circ_lib().id() - }).then(function() { - holdingsSvcInst.fetchAgain().then(function() { - $scope.holdingsGridDataProvider.refresh(); - }); + egCirc.mark_discard(copy_list).then(function() { + holdinsSvcInst.fetchAgain().then(function() { + $scop.holdingsGridDataProvider.refresh(); }); }); } $scope.selectedHoldingsMissing = function () { - egCirc.mark_missing(gatherSelectedHoldingsIds()).then(function() { + var copy_list = gatherSelectedRawCopies(); + if (copy_list.length == 0) return; + egCirc.mark_missing(copy_list).then(function() { holdingsSvcInst.fetchAgain().then(function() { $scope.holdingsGridDataProvider.refresh(); }); diff --git a/Open-ILS/web/js/ui/default/staff/cat/item/app.js b/Open-ILS/web/js/ui/default/staff/cat/item/app.js index 1c822536c7..681a40f23f 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/item/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/item/app.js @@ -155,18 +155,11 @@ function($scope , $location , $timeout , egCore , egGridDataProvider , itemSvc) } $scope.selectedHoldingsDiscard = function () { - itemSvc.selectedHoldingsDiscard([{ - id : $scope.args.copyId, - barcode : $scope.args.copyBarcode, - refresh : true - }]); + itemSvc.selectedHoldingsDiscard([$scope.args]); } $scope.selectedHoldingsMissing = function () { - itemSvc.selectedHoldingsMissing([{ - id : $scope.args.copyId, - barcode : $scope.args.copyBarcode - }]); + itemSvc.selectedHoldingsMissing([$scope.args]); } $scope.selectedHoldingsVolCopyAdd = function () { 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 bf6d978c53..de5861fda7 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 @@ -336,17 +336,17 @@ function($scope , $q , $window , $location , $timeout , egCore , checkinSvc , eg } $scope.showMarkDiscard = function(items) { - var copy_ids = []; + var copies = []; angular.forEach(items, function(item) { if (item.acp) { - egCirc.mark_discard({ - id: item.acp.id(), - barcode: item.acp.barcode() - }) - + copies.push(item.acp); } }); - + if (copies.length) { + egCirc.mark_discard(copies).then(function() { + // update grid items? + }); + } } $scope.abortTransit = function(items) { diff --git a/Open-ILS/web/js/ui/default/staff/circ/renew/app.js b/Open-ILS/web/js/ui/default/staff/circ/renew/app.js index 7c0e0e8419..29bc81bb50 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/renew/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/renew/app.js @@ -183,13 +183,13 @@ function($scope , $window , $location , egCore , egGridDataProvider , egCirc) { } $scope.showMarkDiscard = function(items) { - var copy_ids = []; + var copyies = []; angular.forEach(items, function(item) { - if (item.acp) copy_ids.push(item.acp.id()); + if (item.acp) copies.push(item.acp); }); - if (copy_ids.length) { - egCirc.mark_discard(copy_ids).then(function() { + if (copies.length) { + egCirc.mark_discard(copies).then(function() { // update grid items? }); } diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js index 3654d19c78..2a23a09839 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js @@ -712,22 +712,23 @@ function($window , $location , $timeout , egCore , egHolds , egCirc) { } service.mark_discard = function(items) { + var copies = []; angular.forEach(items, function(item) { if (item.copy) { - egCirc.mark_discard({ - id: item.copy.id(), - barcode: item.copy.barcode() - }).then(service.refresh); + copies.push(item.copy); } }); + if (copies.length) { + egCirc.mark_discard(copies).then(service.refresh): + } } service.mark_missing = function(items) { - var copy_ids = items + var copies = items .filter(function(item) { return Boolean(item.copy) }) - .map(function(item) { return item.copy.id() }); - if (copy_ids.length) - egCirc.mark_missing(copy_ids).then(service.refresh); + .map(function(item) { return item.copy }); + if (copies.length) + egCirc.mark_missing(copies).then(service.refresh); } service.mark_missing_wide = function(items) { -- 2.11.0