[open-ils-commits] r11657 - in trunk/Open-ILS/web: js/ui/default/conify/global/permission templates/default/conify/global/permission
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Dec 22 16:43:29 EST 2008
Author: erickson
Date: 2008-12-22 16:43:24 -0500 (Mon, 22 Dec 2008)
New Revision: 11657
Modified:
trunk/Open-ILS/web/js/ui/default/conify/global/permission/grp_penalty_threshold.js
trunk/Open-ILS/web/templates/default/conify/global/permission/grp_penalty_threshold.tt2
Log:
implemented delete
Modified: trunk/Open-ILS/web/js/ui/default/conify/global/permission/grp_penalty_threshold.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/conify/global/permission/grp_penalty_threshold.js 2008-12-22 21:04:52 UTC (rev 11656)
+++ trunk/Open-ILS/web/js/ui/default/conify/global/permission/grp_penalty_threshold.js 2008-12-22 21:43:24 UTC (rev 11657)
@@ -125,7 +125,30 @@
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);
Modified: trunk/Open-ILS/web/templates/default/conify/global/permission/grp_penalty_threshold.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/permission/grp_penalty_threshold.tt2 2008-12-22 21:04:52 UTC (rev 11656)
+++ trunk/Open-ILS/web/templates/default/conify/global/permission/grp_penalty_threshold.tt2 2008-12-22 21:43:24 UTC (rev 11657)
@@ -8,7 +8,7 @@
<span>New Group Penalty Threshold</span>
<div dojoType="dijit.TooltipDialog" execute="GPT.create(arguments[0]);">
<script type='dojo/connect' event='onOpen'>
- new openils.User().buildPermOrgSelector('CREATE_GROUP_PENALTY_THRESHOLD', gptOwningOrg);
+ new openils.User().buildPermOrgSelector('ADMIN_GROUP_PENALTY_THRESHOLD', gptOwningOrg);
GPT.drawCspSelector();
GPT.grpSelector.drawGroups();
</script>
@@ -43,7 +43,10 @@
</tr>
</table>
</div>
-</div>
+</div>
+
+<button dojoType='dijit.form.Button' onClick="GPT.deleteFromGrid">Delete Selected</button>
+
<span>Context Org Unit</span>
<select dojoType="openils.widget.OrgUnitFilteringSelect" jsId='GPT.contextOrgSelector'
searchAttr='shortname' labelAttr='shortname'> </select>
@@ -66,4 +69,3 @@
[% END %]
-
More information about the open-ils-commits
mailing list