]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/templates/default/acq/financial/list_funds.tt2
78bf2a46594846c648eb2011713212df08d860f4
[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_path %]/acq/fund/view/'+fundId;
19                 }
20             }
21         );
22     }
23
24     function getName(rowIndex, item) {
25         if(!item) return;
26         var name = this.grid.store.getValue(item, 'name');
27         var id = this.grid.store.getValue(item, 'id');
28         return '<a href="[% ctx.base_path %]/acq/fund/view/'+id+'">'+name+'</a>';
29     }
30 </script>
31
32
33 <div class='oils-header-panel' dojoType="dijit.layout.ContentPane" layoutAlign="client">
34     <div>Funds</div>
35     <div>
36         <button dojoType='dijit.form.Button' onClick='lfGrid.showCreateDialog()'>New Fund</button>
37         <button dojoType='dijit.form.Button' onClick='lfGrid.deleteSelected()'>Delete Selected</button>
38     </div>
39 </div>
40
41 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
42     Year <select dojoType='dijit.form.FilteringSelect' onchange='filterGrid();'
43         jsId='fundFilterYearSelect' labelAttr='year' searchAttr='year'> </select>
44 </div>
45
46 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
47     <table  jsId="lfGrid"
48             autoHeight='true'
49             dojoType="openils.widget.AutoGrid"
50             fieldOrder="['id', 'name', 'code', 'year', 'org', 'currency_type', 'combined_balance']"
51             query="{id: '*'}"
52             defaultCellWidth='"auto"'
53             fmClass='acqf'
54             editOnEnter='true'>
55         <thead>
56             <tr>
57                 <th field='combined_balance' get='getBalanceInfo'></th>
58             </tr>
59         </thead>
60     </table>
61     <div/>
62 </div>
63
64
65 [% END %]
66