[open-ils-commits] r9274 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
public/oils/media/js/openils/acq
templates/oils/default/acq/financial
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Apr 8 18:41:06 EDT 2008
Author: erickson
Date: 2008-04-08 18:03:55 -0400 (Tue, 08 Apr 2008)
New Revision: 9274
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html
Log:
implemented funding-source delete, v1
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js 2008-04-08 21:36:53 UTC (rev 9273)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js 2008-04-08 22:03:55 UTC (rev 9274)
@@ -92,5 +92,32 @@
req.send();
};
+
+openils.acq.FundingSource.deleteFromGrid = function(grid, onComplete) {
+ var list = []
+ var selected = grid.selection.getSelected();
+ for(var rowIdx in selected)
+ list.push(grid.model.getDatum(selected[rowIdx], 0));
+ openils.acq.FundingSource.deleteList(list, onComplete);
+};
+
+openils.acq.FundingSource.deleteList = function(list, onComplete) {
+ openils.acq.FundingSource._deleteList(list, 0, onComplete);
}
+openils.acq.FundingSource._deleteList = function(list, idx, onComplete) {
+ if(idx >= list.length)
+ return onComplete();
+ var ses = new OpenSRF.ClientSession('open-ils.acq');
+ var req = ses.request('open-ils.acq.funding_source.delete', oilsAuthtoken, list[idx]);
+ req.oncomplete = function(r) {
+ msg = r.recv()
+ stat = msg.content();
+ /* XXX CHECH FOR EVENT */
+ openils.acq.FundingSource._deleteList(list, ++idx, onComplete);
+ }
+ req.send();
+};
+
+
+} /* end dojo._hasResource[] */
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html 2008-04-08 21:36:53 UTC (rev 9273)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html 2008-04-08 22:03:55 UTC (rev 9274)
@@ -33,6 +33,7 @@
}
</script>
+<div class='oils-acq-actions-div'>
<div dojoType="dijit.form.DropDownButton">
<span>${('New Funding Source')}</span>
<div dojoType="dijit.TooltipDialog" execute="createFS(arguments[0]);">
@@ -72,12 +73,19 @@
</div>
</div>
+<button dojoType="dijit.form.Button"
+ onclick="openils.acq.FundingSource.deleteFromGrid(fundingSourceGrid, function(){location.href = location.href})">
+ ${_('Delete Selected')}
+</button>
+
+</div>
+
<div id='oils-acq-funding-source-grid'> </div>
<script>
+ var fundingSourceGrid = null;
function loadFSGrid() {
dojo.require('openils.acq.FundingSource');
- var fundingSourceGrid = null;
var gridCols = [
{name: '${_("ID")}', field: 'id'},
More information about the open-ils-commits
mailing list