From: erickson Date: Thu, 11 Dec 2008 16:12:54 +0000 (+0000) Subject: move to 1.2 markup grid X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5fe08d37b46817ef88f4306b1051b5e9d18d5abd;p=Evergreen.git move to 1.2 markup grid git-svn-id: svn://svn.open-ils.org/ILS/trunk@11523 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/ui/default/acq/financial/view_fund.js b/Open-ILS/web/js/ui/default/acq/financial/view_fund.js index 1f73b44154..7f8bb86c49 100644 --- a/Open-ILS/web/js/ui/default/acq/financial/view_fund.js +++ b/Open-ILS/web/js/ui/default/acq/financial/view_fund.js @@ -2,8 +2,9 @@ dojo.require("dijit.Dialog"); dojo.require('dijit.form.FilteringSelect'); dojo.require('dijit.layout.TabContainer'); dojo.require('dijit.layout.ContentPane'); -dojo.require('dojox.grid.Grid'); - +dojo.require('dojox.grid.DataGrid'); +dojo.require('dijit.form.CurrencyTextBox'); +dojo.require('dojo.data.ItemFileReadStore'); dojo.require("fieldmapper.OrgUtils"); dojo.require('openils.acq.Fund'); dojo.require('openils.acq.FundingSource'); @@ -13,7 +14,8 @@ dojo.require('openils.Util'); var fund = null; -function getSummaryInfo(rowIndex) { +function getSummaryInfo(rowIndex, item) { + if(!item) return''; return new String(fund.summary()[this.field]); } @@ -21,48 +23,42 @@ function createAllocation(fields) { fields.fund = fundID; if(isNaN(fields.percent)) fields.percent = null; if(isNaN(fields.amount)) fields.amount = null; - //openils.acq.Fund.createAllocation(fields, resetPage); openils.acq.Fund.createAllocation(fields, function(r){location.href = location.href;}); } +function getOrgInfo(rowIndex, item) { + if(!item) return ''; + var owner = this.grid.store.getValue(item, 'org'); + return fieldmapper.aou.findOrgUnit(owner).shortname(); -function getOrgInfo(rowIndex) { - data = fundGrid.model.getRow(rowIndex); - if(!data) return; - return fieldmapper.aou.findOrgUnit(data.org).shortname(); } -function getXferDest(rowIndex) { - data = this.grid.model.getRow(rowIndex); - if(!(data && data.xfer_destination)) return ''; - return data.xfer_destination; +function getXferDest(rowIndex, item) { + if(!item) return ''; + var xfer_destination = this.grid.store.getValue(item, 'xfer_destination'); + if(!(item && xfer_destination)) return ''; + return xfer_destination; } function loadFundGrid() { var store = new dojo.data.ItemFileReadStore({data:acqf.toStoreData([fund])}); - var model = new dojox.grid.data.DojoData( - null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}}); - fundGrid.setModel(model); - fundGrid.update(); + fundGrid.setStore(store); + fundGrid.render(); } function loadAllocationGrid() { if(fundAllocationGrid.isLoaded) return; var store = new dojo.data.ItemFileReadStore({data:acqfa.toStoreData(fund.allocations())}); - var model = new dojox.grid.data.DojoData( - null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}}); - fundAllocationGrid.setModel(model); - fundAllocationGrid.update(); + fundAllocationGrid.setStore(store); + fundAllocationGrid.render(); fundAllocationGrid.isLoaded = true; } function loadDebitGrid() { if(fundDebitGrid.isLoaded) return; var store = new dojo.data.ItemFileReadStore({data:acqfa.toStoreData(fund.debits())}); - var model = new dojox.grid.data.DojoData( - null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}}); - fundDebitGrid.setModel(model); - fundDebitGrid.update(); + fundDebitGrid.setStore(store); + fundDebitGrid.render(); fundDebitGrid.isLoaded = true; } diff --git a/Open-ILS/web/templates/default/acq/financial/view_fund.tt2 b/Open-ILS/web/templates/default/acq/financial/view_fund.tt2 index 5c805df2d0..8435604f65 100644 --- a/Open-ILS/web/templates/default/acq/financial/view_fund.tt2 +++ b/Open-ILS/web/templates/default/acq/financial/view_fund.tt2 @@ -1,12 +1,11 @@ [% WRAPPER 'default/base.tt2' %] @@ -24,10 +23,10 @@
@@ -36,7 +35,7 @@ + dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'> @@ -51,10 +50,10 @@ + dojoType="dijit.form.NumberTextBox" + constraints="{min:0,max:100}" + promptMessage="Please enter an amount between 0 and 100" + name="percent"> @@ -66,7 +65,7 @@ - + @@ -78,67 +77,79 @@
- -
+ class='oils-acq-detail-content-pane' title="Summary" selected='true'> + +
+
+ + + + + + + + + + + + + + + + +
IDNameCodeCurrency TypeOwnerBalanceTotal AllocatedSpent BalanceTotal DebitsTotal SpentTotal Encumbered
+ + +
+
+
- -
+ +
+
+ + + + + + + + + + + +
IDFunding SourceAmountPercentAllocated ByNote
+
+
+
- -
+ +
+
+ + + + + + + + + + + + +
IDOrigin AmountOrigin Currency TypeAmountEncumbranceDebit TypeTransfer Destination
+
+