1 [% WRAPPER 'default/base.tt2' %]
3 <div id='oils-acq-list-header' class='container'>
4 <div id='oils-acq-list-header-label'>Funds</div>
7 <!-- load the page-specific JS -->
8 <script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/list_funds.js'> </script>
10 <script type="text/javascript">
11 function createFund(fields) {
12 /** Creates a new fund source */
13 openils.acq.Fund.create(
16 var evt = openils.Event.parse(fundId);
21 location.href = /* go to the details page for this fund */
22 '[% ctx.base_uri %]/acq/fund/view/'+fundId;
29 <div class='oils-acq-actions-div'>
30 <div dojoType="dijit.form.DropDownButton">
33 <div dojoType="dijit.TooltipDialog" execute="createFund(arguments[0]);">
34 <script type='dojo/connect' event='onOpen'>
35 openils.acq.CurrencyType.loadSelectWidget(fundCurrencySelector);
36 new openils.User().buildPermOrgSelector('ADMIN_FUND', fundOwnerSelect);
39 <table class='dijitTooltipTable'>
41 <td><label for="name">Name: </label></td>
42 <td><input dojoType="dijit.form.TextBox" name="name"></td>
45 <td><label for="name">Code: </label></td>
46 <td><input dojoType="dijit.form.TextBox" name="code"></td>
49 <td><label for="year">Year: </label></td>
50 <td><input dojoType="dijit.form.TextBox" name="year"></td>
53 <td><label for="currency_type">Currency Type: </label></td>
55 <input jsId='fundCurrencySelector' name="currency_type"
56 dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
61 <td valign='top'><label for="org">Owning Location: </label></td>
63 <input dojoType="openils.widget.OrgUnitFilteringSelect" jsId='fundOwnerSelect'
64 searchAttr="shortname" name="org" autocomplete="true" labelAttr='shortname'> </input>
68 <td colspan='2' align='center'>
69 <button dojoType=dijit.form.Button type="submit">Create</button>
76 <button dojoType="dijit.form.Button"
77 onclick="openils.acq.Fund.deleteFromGrid(
78 fundListGrid, function(){location.href = location.href})">
83 <select dojoType='dijit.form.FilteringSelect' onchange='filterGrid();' style='width:100px;'
84 jsId='fundFilterYearSelect' labelAttr='year' searchAttr='year'> </select>
87 <!-- The main grid lives here -->
89 function getName(rowIndex) {
90 data = fundListGrid.model.getRow(rowIndex);
92 return '<a href="[% ctx.base_uri %]/acq/fund/view/'+data.id+'">'+data.name+'</a>';
95 var fundListGridStructure = [{
97 {name: 'ID', field: 'id'},
98 {name: 'Name', width:'auto', get:getName},
99 {name: 'Code', field:'code'},
100 {name: 'Year', field: "year"},
101 {name: 'Location', get:getOrgInfo},
102 {name: 'Currency Type', field: "currency_type"},
103 {name: 'Combined Balance', get:getBalanceInfo}
107 <div jsId='fundListGrid' dojoType="dojox.Grid" structure='fundListGridStructure'></div>