]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/templates/default/acq/financial/list_funds.tt2
added delete-selected buttons
[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                 <button dojoType='dijit.form.Button' onClick='lfGrid.deleteSelected()'>Delete Selected</button>
41             </div>
42         </div>
43         <label>Year</label>
44         <select dojoType='dijit.form.FilteringSelect' onchange='filterGrid();' style='width:100px;'
45                 jsId='fundFilterYearSelect' labelAttr='year' searchAttr='year'> </select>
46
47
48         <table  jsId="lfGrid"
49                 dojoType="openils.widget.AutoGrid"
50                 fieldOrder="['id', 'name', 'code', 'year', 'org', 'currency_type', 'combined_balance']"
51                 query="{id: '*'}"
52                 defaultCellWidth='20'
53                 fmClass='acqf'
54                 editOnEnter='true'>
55             <thead>
56                 <tr><th field='owner' get='getOrgInfo'/>
57                 </tr>
58             </thead>
59         </table>
60     </div>
61 </div>
62
63
64 [% END %]
65