[open-ils-commits] r9561 - 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:24:35 EDT 2008
Author: erickson
Date: 2008-05-12 16:24:31 -0400 (Mon, 12 May 2008)
New Revision: 9561
Added:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_providers.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/view_provider.js
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_providers.html
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_provider.html
Log:
moving to external JS files
Added: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_providers.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_providers.js (rev 0)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_providers.js 2008-05-12 20:24:31 UTC (rev 9561)
@@ -0,0 +1,29 @@
+dojo.require("dijit.Dialog");
+dojo.require("dijit.form.FilteringSelect");
+dojo.require('dijit.form.Button');
+dojo.require('dojox.grid.Grid');
+
+dojo.require('openils.acq.CurrencyType');
+dojo.require('openils.Event');
+dojo.require('openils.acq.Provider');
+dojo.require("fieldmapper.OrgUtils");
+
+function getOrgInfo(rowIndex) {
+ data = providerListGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return fieldmapper.aou.findOrgUnit(data.owner).shortname();
+}
+
+function loadProviderGrid() {
+ openils.acq.Provider.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:'*'}});
+ providerListGrid.setModel(model);
+ providerListGrid.update();
+ }
+ );
+}
+
+dojo.addOnLoad(loadProviderGrid);
Added: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/view_provider.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/view_provider.js (rev 0)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/view_provider.js 2008-05-12 20:24:31 UTC (rev 9561)
@@ -0,0 +1,40 @@
+dojo.require("dijit.Dialog");
+dojo.require('dijit.layout.TabContainer');
+dojo.require('dijit.layout.ContentPane');
+dojo.require('dojox.grid.Grid');
+dojo.require("fieldmapper.OrgUtils");
+dojo.require('openils.acq.Provider');
+dojo.require('openils.Event');
+dojo.require('openils.User');
+
+var provider = null;
+
+function getOrgInfo(rowIndex) {
+ data = providerGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return fieldmapper.aou.findOrgUnit(data.owner).shortname();
+}
+
+function loadProviderGrid() {
+ var store = new dojo.data.ItemFileReadStore({data:acqpro.toStoreData([provider])});
+ var model = new dojox.grid.data.DojoData(
+ null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ providerGrid.setModel(model);
+ providerGrid.update();
+}
+
+function fetchProvider() {
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.provider.retrieve'],
+ { async: true,
+ params: [ openils.User.authtoken, providerId ],
+ oncomplete: function(r) {
+ provider = r.recv().content();
+ loadProviderGrid(provider);
+ }
+ }
+ );
+}
+
+dojo.addOnLoad(fetchProvider);
+
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_providers.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_providers.html 2008-05-12 20:18:01 UTC (rev 9560)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_providers.html 2008-05-12 20:24:31 UTC (rev 9561)
@@ -3,66 +3,31 @@
<%def name="page_title()">${_('Providers')}</%def>
<%def name="block_content()">
-<script type="text/javascript">
- dojo.require("dijit.Dialog");
- dojo.require("dijit.form.FilteringSelect");
- dojo.require('dijit.form.Button');
- dojo.require('dojox.grid.Grid');
- dojo.require('openils.acq.CurrencyType');
- dojo.require('openils.Event');
- dojo.require('openils.acq.Provider');
- dojo.require("fieldmapper.OrgUtils");
-</script>
+<!-- load the page-specific JS -->
+<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/financial/list_providers.js'> </script>
<div id='oils-acq-list-header' class='container'>
<div id='oils-acq-list-header-label'>${_('Providers')}</div>
</div>
<!-- The main grid lives here -->
-<div jsId='providerListGrid' dojoType="dojox.Grid"></div>
-
<script>
-
- function loadProviderGrid() {
- new openils.User().getBySession();
-
- /** define how the primary grid is rendered */
-
- function getOrgInfo(rowIndex) {
- data = providerListGrid.model.getRow(rowIndex);
- if(!data) return;
- return fieldmapper.aou.findOrgUnit(data.owner).shortname();
- }
-
- function getName(rowIndex) {
- data = providerListGrid.model.getRow(rowIndex);
- if(!data) return;
- return '<a href="${c.oils.acq.prefix.value}/provider/view/'+data.id+'">'+data.name+'</a>';
- }
-
- var gridStructure = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Name")}', get:getName, width:'auto'},
- {name: '${_("Owner")}', get:getOrgInfo},
- {name: '${_("Currency Type")}', field: "currency_type"}
- ]]
- }];
-
- openils.acq.Provider.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:'*'}});
- providerListGrid.setStructure(gridStructure);
- providerListGrid.setModel(model);
- providerListGrid.update();
- }
- );
+ function getName(rowIndex) {
+ data = providerListGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return '<a href="${c.oils.acq.prefix.value}/provider/view/'+data.id+'">'+data.name+'</a>';
}
- dojo.addOnLoad(loadProviderGrid);
+ var providerGridStructure = [{
+ cells : [[
+ {name: '${_("ID")}', field: 'id'},
+ {name: '${_("Name")}', get:getName, width:'auto'},
+ {name: '${_("Owner")}', get:getOrgInfo},
+ {name: '${_("Currency Type")}', field: "currency_type"}
+ ]]
+ }];
</script>
+<div jsId='providerListGrid' dojoType="dojox.Grid" structure='providerGridStructure'></div>
</%def>
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_provider.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_provider.html 2008-05-12 20:18:01 UTC (rev 9560)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_provider.html 2008-05-12 20:24:31 UTC (rev 9561)
@@ -3,50 +3,11 @@
<%def name="page_title()">${_('View Provider')}</%def>
<%def name="block_content()">
-<script>
- dojo.require("dijit.Dialog");
- dojo.require('dijit.layout.TabContainer');
- dojo.require('dijit.layout.ContentPane');
- dojo.require('dojox.grid.Grid');
- dojo.require("fieldmapper.OrgUtils");
- dojo.require('openils.acq.Provider');
- dojo.require('openils.Event');
- dojo.require('openils.User');
+<script>var providerId = ${c.oils.acq.provider_id};</script>
+<!-- load the page-specific JS -->
+<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/financial/view_provider.js'> </script>
- var providerId = ${c.oils.acq.provider_id};
- var provider = null;
- function getOrgInfo(rowIndex) {
- data = providerGrid.model.getRow(rowIndex);
- if(!data) return;
- return fieldmapper.aou.findOrgUnit(data.owner).shortname();
- }
-
- function loadProviderGrid() {
- var store = new dojo.data.ItemFileReadStore({data:acqpro.toStoreData([provider])});
- var model = new dojox.grid.data.DojoData(
- null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- providerGrid.setModel(model);
- providerGrid.update();
- }
-
- function fetchProvider() {
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.provider.retrieve'],
- { async: true,
- params: [ openils.User.authtoken, providerId ],
- oncomplete: function(r) {
- provider = r.recv().content();
- loadProviderGrid(provider);
- }
- }
- );
- }
-
- dojo.addOnLoad(fetchProvider);
-</script>
-
-
<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
<div dojoType="dijit.layout.TabContainer">
<div dojoType="dijit.layout.ContentPane"
More information about the open-ils-commits
mailing list