reinstated the links for funding_source code in the fund allocations grid
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 30 Mar 2010 16:15:47 +0000 (16:15 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 30 Mar 2010 16:15:47 +0000 (16:15 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16057 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/acq/financial/view_fund.js
Open-ILS/web/templates/default/acq/financial/view_fund.tt2

index 0813a59..8a30a6c 100644 (file)
@@ -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');
index 836ca72..a692cde 100644 (file)
@@ -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>
 
                         fmClass="acqfa"
                         query="{id: '*'}"
                         showPaginator='true'>
+
+                        <thead>
+                            <tr>
+                                <th field='funding_source' get='getFundingSource' formatter='formatFundingSource'/>
+                            </tr>
+                        </thead>
                     </table>
                 </div> 
             </div>