31cb284db277ad7068efc2aaa2279fe36fd08749
[working/Evergreen.git] / Open-ILS / web / templates / default / acq / financial / list_funds.tt2
1 [% WRAPPER 'default/base.tt2' %]
2
3 <!-- load the page-specific JS -->
4 <script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/list_funds.js'> </script>
5
6 <script type="text/javascript">
7     function createFund(fields) {
8         /** Creates a new fund source */
9         openils.acq.Fund.create(
10             fields, 
11             function(fundId) {
12                 var evt = openils.Event.parse(fundId);
13                 if(evt) {
14                     alert(evt); /* XXX */
15                     return;
16                 } else {
17                     location.href =  /* go to the details page for this fund */
18                     '[% ctx.base_uri %]/acq/fund/view/'+fundId;
19                 }
20             }
21         );
22     }
23 </script>
24
25   <!-- The main grid lives here -->
26 <script>
27     function getName(rowIndex, item) {
28         if(!item) return;
29         var name = this.grid.store.getValue(item, 'name');
30         var id = this.grid.store.getValue(item, 'id');
31         return '<a href="[% ctx.base_uri %]/acq/fund/view/'+id+'">'+name+'</a>';
32     }
33 </script> 
34
35 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
36         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
37             <div>Funding Types</div>
38             <div>
39                 <button dojoType='dijit.form.Button' onClick='lfGrid.showCreateDialog()'>New Fund</button>
40             </div>
41         </div>
42         <label>Year</label>
43         <select dojoType='dijit.form.FilteringSelect' onchange='filterGrid();' style='width:100px;'
44                 jsId='fundFilterYearSelect' labelAttr='year' searchAttr='year'> </select>
45
46
47         <table  jsId="lfGrid"
48                 dojoType="openils.widget.AutoGrid"
49                 fieldOrder="['id', 'name', 'code', 'year', 'org', 'currency_type', 'combined_balance']"
50                 query="{id: '*'}"
51                 defaultCellWidth='20'
52                 fmClass='acqf'
53                 editOnEnter='true'>
54             <thead>
55                 <tr><th field='owner' get='getOrgInfo'/>
56                 </tr>
57             </thead>
58         </table>
59     </div>
60 </div>
61
62
63 [% END %]
64