From e8b62d4be009332ff9c5432aa5998c0b862afc67 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Fri, 9 Jun 2017 10:11:21 -0400 Subject: [PATCH] webstaff: Item Status bugs with Transfer Items... ...to Previously Marked Volume Now it throws up the override dialog only if an ils event is returned, and it doesn't prematurely refresh the screen or re-scan a barcode while the dialog is open. Signed-off-by: Jason Etheridge Signed-off-by: Andrea Neiman Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- .../web/js/ui/default/staff/cat/item/app.js | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) 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 bada28ccb4..48d2d8270f 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 @@ -840,26 +840,32 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog ).then( function(resp) { // oncomplete var evt = egCore.evt.parse(resp); - egConfirmDialog.open( - egCore.strings.OVERRIDE_TRANSFER_COPIES_TO_MARKED_VOLUME_TITLE, - egCore.strings.OVERRIDE_TRANSFER_COPIES_TO_MARKED_VOLUME_BODY, - {'evt_desc': evt} - ).result.then(function() { - egCore.net.request( - 'open-ils.cat', - 'open-ils.cat.transfer_copies_to_volume.override', - egCore.auth.token(), - xfer_target, - copy_ids, - { events: ['TITLE_LAST_COPY', 'COPY_DELETE_WARNING'] } - ); - }); + console.log('evt',evt); + if (evt) { + egConfirmDialog.open( + egCore.strings.OVERRIDE_TRANSFER_COPIES_TO_MARKED_VOLUME_TITLE, + egCore.strings.OVERRIDE_TRANSFER_COPIES_TO_MARKED_VOLUME_BODY, + {'evt_desc': evt} + ).result.then(function() { + egCore.net.request( + 'open-ils.cat', + 'open-ils.cat.transfer_copies_to_volume.override', + egCore.auth.token(), + xfer_target, + copy_ids, + { events: ['TITLE_LAST_COPY', 'COPY_DELETE_WARNING'] } + ); + }).then(function() { + angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)}); + }); + } else { + angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)}); + } + }, null, // onerror null // onprogress - ).then(function() { - angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)}); - }); + ); } } -- 2.43.2