From 18adc2d579cd51757e4492dbb96c379e4c8aa71f Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 12 May 2008 20:34:38 +0000 Subject: [PATCH] more external file JSing git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9562 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../default/acq/financial/list_funding_sources.js | 36 ++++++++++ .../ui_js/oils/default/acq/financial/list_funds.js | 39 +++++++++++ .../acq/financial/list_funding_sources.html | 77 +++++---------------- .../oils/default/acq/financial/list_funds.html | 78 +++++----------------- 4 files changed, 109 insertions(+), 121 deletions(-) create mode 100644 Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funding_sources.js create mode 100644 Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funds.js diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funding_sources.js b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funding_sources.js new file mode 100644 index 0000000000..24d1ece802 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funding_sources.js @@ -0,0 +1,36 @@ +dojo.require("dijit.Dialog"); +dojo.require("dijit.form.FilteringSelect"); +dojo.require('openils.acq.FundingSource'); +dojo.require('openils.acq.CurrencyType'); +dojo.require('openils.widget.OrgUnitFilteringSelect'); +dojo.require('dijit.form.Button'); +dojo.require('dojox.grid.Grid'); +dojo.require('openils.Event'); + +var globalUser = new openils.User(); + +function getOrgInfo(rowIndex) { + data = fundingSourceListGrid.model.getRow(rowIndex); + if(!data) return; + return fieldmapper.aou.findOrgUnit(data.owner).shortname(); +} + +function getBalanceInfo(rowIndex) { + data = fundingSourceListGrid.model.getRow(rowIndex); + if(!data) return; + return new String(openils.acq.FundingSource.cache[data.id].summary().balance); +} + +function loadFSGrid() { + openils.acq.FundingSource.createStore( + function(storeData) { + var store = new dojo.data.ItemFileReadStore({data:storeData}); + var model = new dojox.grid.data.DojoData(null, store, + {rowsPerPage: 20, clientSort: true, query:{id:'*'}}); + fundingSourceListGrid.setModel(model); + fundingSourceListGrid.update(); + } + ); +} + +dojo.addOnLoad(loadFSGrid); diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funds.js b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funds.js new file mode 100644 index 0000000000..0f059f9013 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funds.js @@ -0,0 +1,39 @@ +dojo.require("dijit.Dialog"); +dojo.require("dijit.form.FilteringSelect"); +dojo.require('dijit.form.Button'); +dojo.require('dojox.grid.Grid'); + +dojo.require('openils.widget.OrgUnitFilteringSelect'); +dojo.require('openils.acq.CurrencyType'); +dojo.require('openils.Event'); +dojo.require('openils.acq.Fund'); + +var globalUser = new openils.User(); + +function getOrgInfo(rowIndex) { + data = fundListGrid.model.getRow(rowIndex); + if(!data) return; + return fieldmapper.aou.findOrgUnit(data.org).shortname(); +} + +function getBalanceInfo(rowIndex) { + data = fundListGrid.model.getRow(rowIndex); + if(!data) return; + return new String(openils.acq.Fund.cache[data.id].summary().combined_balance); +} + + +function loadFundGrid() { + openils.acq.Fund.createStore( + function(storeData) { + var store = new dojo.data.ItemFileReadStore({data:storeData}); + var model = new dojox.grid.data.DojoData(null, store, + {rowsPerPage: 20, clientSort: true, query:{id:'*'}}); + fundListGrid.setModel(model); + fundListGrid.update(); + } + ); +} + +dojo.addOnLoad(loadFundGrid); + 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 79c28249f9..4aa5dd9c50 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 @@ -7,21 +7,10 @@
${_('Funding Sources')}
- - + + - +
diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funds.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funds.html index ca52199829..94879bec86 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funds.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funds.html @@ -7,19 +7,10 @@
${_('Funds')}
- + +
-- 2.11.0