From: erickson Date: Tue, 8 Apr 2008 22:03:55 +0000 (+0000) Subject: implemented funding-source delete, v1 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ecbd6d4b7ea8c838c418ec4d5eb4c4890fa45076;p=Evergreen.git implemented funding-source delete, v1 git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9274 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js index 26d64f3c09..b2b8da2a9c 100644 --- a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js @@ -92,5 +92,32 @@ openils.acq.FundingSource.create = function(fields, onCreateComplete) { 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[] */ diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html index 46402a9563..93d846d03e 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html @@ -33,6 +33,7 @@ } +
${('New Funding Source')}
@@ -72,12 +73,19 @@
+ + +
+