From: erickson Date: Mon, 22 Dec 2008 21:43:24 +0000 (+0000) Subject: implemented delete X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3898272da278d43ee5ecc6d5787d10e3c8513143;p=Evergreen.git implemented delete git-svn-id: svn://svn.open-ils.org/ILS/trunk@11657 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/ui/default/conify/global/permission/grp_penalty_threshold.js b/Open-ILS/web/js/ui/default/conify/global/permission/grp_penalty_threshold.js index 12b2e5e47b..260cd204c2 100644 --- a/Open-ILS/web/js/ui/default/conify/global/permission/grp_penalty_threshold.js +++ b/Open-ILS/web/js/ui/default/conify/global/permission/grp_penalty_threshold.js @@ -125,7 +125,30 @@ var GPT = { var pId = this.grid.store.getValue(item, this.field); return GPT.penaltyMap[pId].name(); } - } -}; + }, + + deleteFromGrid : function() { + GPT._deleteFromGrid(gptGrid.selection.getSelected(), 0); + }, + _deleteFromGrid : function(list, idx) { + if(idx >= list.length) // we've made it through the list + return; + + var item = list[idx]; + var id = gptGrid.store.getValue(item, 'id'); + fieldmapper.standardRequest( + ['open-ils.permacrud', 'open-ils.permacrud.delete.pgpt'], + { async: true, + params: [openils.User.authtoken, id], + oncomplete: function(r) { + if(obj = openils.Util.readResponse(r)) { + gptGrid.store.deleteItem(item); + } + GPT._deleteFromGrid(list, ++idx); + } + } + ); + }, + }; openils.Util.addOnLoad(GPT.init); diff --git a/Open-ILS/web/templates/default/conify/global/permission/grp_penalty_threshold.tt2 b/Open-ILS/web/templates/default/conify/global/permission/grp_penalty_threshold.tt2 index b5fc3addf2..2bc3017335 100644 --- a/Open-ILS/web/templates/default/conify/global/permission/grp_penalty_threshold.tt2 +++ b/Open-ILS/web/templates/default/conify/global/permission/grp_penalty_threshold.tt2 @@ -8,7 +8,7 @@ New Group Penalty Threshold
@@ -43,7 +43,10 @@
- + + + + Context Org Unit @@ -66,4 +69,3 @@ [% END %] -