From: Cesar Velez Date: Wed, 12 Dec 2018 22:43:35 +0000 (-0500) Subject: LP#1737800 - add delete action to pending patrons X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=29bcf68b7a9c1a1be34044b5975bdd7692307ea1;p=evergreen%2Fpines.git LP#1737800 - add delete action to pending patrons This adds a way to remove a pending/staged user from the pending users grid. --- diff --git a/Open-ILS/src/templates/staff/circ/patron/t_pending_list.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_pending_list.tt2 index 7384211ef5..c8ecf9f05c 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_pending_list.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_pending_list.tt2 @@ -22,6 +22,9 @@ + + diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/pending.js b/Open-ILS/web/js/ui/default/staff/circ/patron/pending.js index 0690b3c5fc..844aa18e16 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/pending.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/pending.js @@ -37,12 +37,33 @@ function($scope , $q , $routeParams , $window , $location , egCore , egGridDataP ).focus(); } + function delete_patron(sel_pending_users) { + if (angular.isArray(sel_pending_users)){ + var promises = []; + angular.forEach(sel_pending_users, function(stgu){ + promises.push(egCore.net.request( + 'open-ils.actor', + 'open-ils.actor.user.stage.delete', + egCore.auth.token(), + stgu.user.row_id() + )); + }); + + $q.all(promises).then(refresh_page()); + } + } + $scope.load_patron = function(action, data, items) { load_patron(items); } + $scope.deletePatron = function(action, data, items) { + delete_patron(items); + } + $scope.grid_controls = { - activateItem : load_patron + activateItem : load_patron, + deleteItem : delete_patron } function refresh_page() {