[open-ils-commits] r9562 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
public/oils/media/ui_js/oils/default/acq/financial
templates/oils/default/acq/financial
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon May 12 16:34:42 EDT 2008
Author: erickson
Date: 2008-05-12 16:34:38 -0400 (Mon, 12 May 2008)
New Revision: 9562
Added:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funding_sources.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funds.js
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_funds.html
Log:
more external file JSing
Added: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funding_sources.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funding_sources.js (rev 0)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funding_sources.js 2008-05-12 20:34:38 UTC (rev 9562)
@@ -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);
Added: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funds.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funds.js (rev 0)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funds.js 2008-05-12 20:34:38 UTC (rev 9562)
@@ -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);
+
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-05-12 20:24:31 UTC (rev 9561)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html 2008-05-12 20:34:38 UTC (rev 9562)
@@ -7,21 +7,10 @@
<div id='oils-acq-list-header-label'>${_('Funding Sources')}</div>
</div>
-<script src='/oils/media/js/dojo/fieldmapper/OrgUtils.js'> </script>
-<script src='/oils/media/js/dojo/openils/widget/OrgUnitFilteringSelect.js'> </script>
+<!-- load the page-specific JS -->
+<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/financial/list_funding_sources.js'> </script>
<script type="text/javascript">
- 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 createFS(fields) {
/** Creates a new funding source */
openils.acq.FundingSource.create(
@@ -87,56 +76,22 @@
</div>
<!-- The main grid lives here -->
-<div id="oils-acq-funding-source-list-grid" jsId='fundingSourceListGrid' dojoType="dojox.Grid"></div>
-
<script>
-
- function loadFSGrid() {
- globalUser.getBySession();
-
- /** define how the primary grid is rendered */
-
- 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 getName(rowIndex) {
- data = fundingSourceListGrid.model.getRow(rowIndex);
- if(!data) return;
- return '<a href="${c.oils.acq.prefix.value}/funding_source/view/'+data.id+'">'+data.name+'</a>';
- }
-
- var gridStructure = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Name")}', width:'auto', get:getName},
- {name: '${_("Owner")}', width:'auto', get:getOrgInfo},
- {name: '${_("Currency Type")}', field: "currency_type"},
- {name: '${_("Balance")}', get:getBalanceInfo}
- ]]
- }];
-
- 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.setStructure(gridStructure);
- fundingSourceListGrid.setModel(model);
- fundingSourceListGrid.update();
- }
- );
+ function getName(rowIndex) {
+ data = fundingSourceListGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return '<a href="${c.oils.acq.prefix.value}/funding_source/view/'+data.id+'">'+data.name+'</a>';
}
- dojo.addOnLoad(loadFSGrid);
+ var fsGridStructure = [{
+ cells : [[
+ {name: '${_("ID")}', field: 'id'},
+ {name: '${_("Name")}', width:'auto', get:getName},
+ {name: '${_("Owner")}', width:'auto', get:getOrgInfo},
+ {name: '${_("Currency Type")}', field: "currency_type"},
+ {name: '${_("Balance")}', get:getBalanceInfo}
+ ]]
+ }];
</script>
-
+<div id="oils-acq-funding-source-list-grid" jsId='fundingSourceListGrid' dojoType="dojox.Grid" structure='fsGridStructure'></div>
</%def>
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funds.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funds.html 2008-05-12 20:24:31 UTC (rev 9561)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funds.html 2008-05-12 20:34:38 UTC (rev 9562)
@@ -7,19 +7,10 @@
<div id='oils-acq-list-header-label'>${_('Funds')}</div>
</div>
-<script type="text/javascript">
- dojo.require("dijit.Dialog");
- dojo.require("dijit.form.FilteringSelect");
- dojo.require('dijit.form.Button');
- dojo.require('dojox.grid.Grid');
+<!-- load the page-specific JS -->
+<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/financial/list_funds.js'> </script>
- dojo.require('openils.widget.OrgUnitFilteringSelect');
- dojo.require('openils.acq.CurrencyType');
- dojo.require('openils.Event');
- dojo.require('openils.acq.Fund');
-
- var globalUser = new openils.User();
-
+<script type="text/javascript">
function createFund(fields) {
/** Creates a new fund source */
openils.acq.Fund.create(
@@ -90,57 +81,24 @@
</div>
<!-- The main grid lives here -->
-<div jsId='fundListGrid' dojoType="dojox.Grid"></div>
-
<script>
-
- function loadFundGrid() {
- globalUser.getBySession();
-
- /** define how the primary grid is rendered */
-
- 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 getName(rowIndex) {
- data = fundListGrid.model.getRow(rowIndex);
- if(!data) return;
- return '<a href="${c.oils.acq.prefix.value}/fund/view/'+data.id+'">'+data.name+'</a>';
- }
-
- var gridStructure = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Name")}', width:'auto', get:getName},
- {name: '${_("Year")}', field: "year"},
- {name: '${_("Location")}', get:getOrgInfo},
- {name: '${_("Currency Type")}', field: "currency_type"},
- {name: '${_("Combined Balance")}', get:getBalanceInfo}
- ]]
- }];
-
- 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.setStructure(gridStructure);
- fundListGrid.setModel(model);
- fundListGrid.update();
- }
- );
+ function getName(rowIndex) {
+ data = fundListGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return '<a href="${c.oils.acq.prefix.value}/fund/view/'+data.id+'">'+data.name+'</a>';
}
- dojo.addOnLoad(loadFundGrid);
+ var fundListGridStructure = [{
+ cells : [[
+ {name: '${_("ID")}', field: 'id'},
+ {name: '${_("Name")}', width:'auto', get:getName},
+ {name: '${_("Year")}', field: "year"},
+ {name: '${_("Location")}', get:getOrgInfo},
+ {name: '${_("Currency Type")}', field: "currency_type"},
+ {name: '${_("Combined Balance")}', get:getBalanceInfo}
+ ]]
+ }];
</script>
+<div jsId='fundListGrid' dojoType="dojox.Grid" structure='fundListGridStructure'></div>
</%def>
More information about the open-ils-commits
mailing list