From c4be6fefbfd01da84c2b628712ba12e9359912c1 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 5 May 2017 17:44:06 -0400 Subject: [PATCH] webstaff: implement prediction deletion action Signed-off-by: Galen Charlton --- .../src/templates/staff/serials/t_prediction_manager.tt2 | 1 + .../default/staff/serials/directives/prediction_manager.js | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/Open-ILS/src/templates/staff/serials/t_prediction_manager.tt2 b/Open-ILS/src/templates/staff/serials/t_prediction_manager.tt2 index cecf908cfa..c0ad70d99b 100644 --- a/Open-ILS/src/templates/staff/serials/t_prediction_manager.tt2 +++ b/Open-ILS/src/templates/staff/serials/t_prediction_manager.tt2 @@ -56,6 +56,7 @@
+
diff --git a/Open-ILS/web/js/ui/default/staff/serials/directives/prediction_manager.js b/Open-ILS/web/js/ui/default/staff/serials/directives/prediction_manager.js index 02f735e7a2..8066cbf38f 100644 --- a/Open-ILS/web/js/ui/default/staff/serials/directives/prediction_manager.js +++ b/Open-ILS/web/js/ui/default/staff/serials/directives/prediction_manager.js @@ -51,6 +51,19 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider , }); }); } + $scope.deleteScap = function(pred) { + var scap = egCore.idl.fromTypedHash(pred); + // TODO ask to confirm + // TODO check whether there are linked issuances + egCore.pcrud.remove(scap).then(function() { + // completely reset the model in order to reset the + // forms; causes a blink, alas + $scope.predictions = []; + egSerialsCoreSvc.fetch($scope.bibId).then(function() { + reload($scope.ssubId); + }); + }); + } $scope.startNewScap = function() { $scope.new_prediction = egCore.idl.toTypedHash(new egCore.idl.scap()); -- 2.11.0