From: erickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4> Date: Tue, 30 Mar 2010 16:15:47 +0000 (+0000) Subject: reinstated the links for funding_source code in the fund allocations grid X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0ba6ff39675b3bf235555524eb1bce99af8e79b9;p=evergreen%2Fmasslnc.git reinstated the links for funding_source code in the fund allocations grid git-svn-id: svn://svn.open-ils.org/ILS/trunk@16057 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 0813a59245..8a30a6c162 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 @@ -37,6 +37,20 @@ function getOrgInfo(rowIndex, item) { } + +function getFundingSource(rowIndex, item) { + if(item) { + var fsId = this.grid.store.getValue(item, 'funding_source'); + return openils.acq.FundingSource.retrieve(fsId); + } +} + +function formatFundingSource(fs) { + if(fs) { + return '<a href="' + oilsBasePath + '/acq/funding_source/view/'+fs.id()+'">'+fs.code()+'</a>'; + } +} + function getXferDest(rowIndex, item) { if(!item) return ''; var xfer_destination = this.grid.store.getValue(item, 'xfer_destination'); 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 836ca7241a..a692cde141 100644 --- a/Open-ILS/web/templates/default/acq/financial/view_fund.tt2 +++ b/Open-ILS/web/templates/default/acq/financial/view_fund.tt2 @@ -1,13 +1,5 @@ [% WRAPPER 'default/base.tt2' %] -<script> - var fundID = [% ctx.page_args.0 %] - function getFundingSource(rowIndex, item) { - if(!item) return ''; - var fs_id = this.grid.store.getValue(item, 'funding_source'); - var fs = openils.acq.FundingSource.retrieve(fs_id); - return '<a href="[% ctx.base_path %]/acq/funding_source/view/'+fs.id()+'">'+fs.name()+'</a>'; - } -</script> +<script> var fundID = [% ctx.page_args.0 %] </script> <!-- load the page-specific JS --> <script src="[% ctx.media_prefix %]/js/ui/default/acq/common/tag_manager.js"> </script> @@ -44,8 +36,7 @@ <tr> <td><label for="amount">Amount: </label></td> <td> - <!-- XXX get currency from funding source ... --> - <input dojoType="dijit.form.CurrencyTextBox" name="amount" currency='USD'> </input> + <input dojoType="dijit.form.CurrencyTextBox" name="amount"> </input> </td> </tr> @@ -205,6 +196,12 @@ fmClass="acqfa" query="{id: '*'}" showPaginator='true'> + + <thead> + <tr> + <th field='funding_source' get='getFundingSource' formatter='formatFundingSource'/> + </tr> + </thead> </table> </div> </div>