1 [% WRAPPER 'default/base.tt2' %]
2 <div id='oils-acq-list-header' class='container'>
3 <div id='oils-acq-list-header-label'>Funding Sources</div>
6 <!-- load the page-specific JS -->
7 <script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/list_funding_sources.js'> </script>
9 <script type="text/javascript">
10 function createFS(fields) {
11 /** Creates a new funding source */
12 openils.acq.FundingSource.create(
15 var evt = openils.Event.parse(fsId);
20 location.href = /* go to the details page for this fs */
21 '[% ctx.base_uri %]/acq/funding_source/view/'+fsId;
28 <div class='oils-acq-actions-div'>
29 <div dojoType="dijit.form.DropDownButton">
30 <span>New Funding Source</span>
32 <div dojoType="dijit.TooltipDialog" execute="createFS(arguments[0]);">
33 <script type='dojo/connect' event='onOpen'>
34 openils.acq.CurrencyType.loadSelectWidget(fsCurrencySelector);
35 new openils.User().buildPermOrgSelector('ADMIN_FUNDING_SOURCE', fsOwnerSelect);
38 <table class='dijitTooltipTable'>
40 <td><label for="name">Name: </label></td>
41 <td><input dojoType="dijit.form.TextBox" name="name"></td>
44 <td><label for="name">Code: </label></td>
45 <td><input dojoType="dijit.form.TextBox" name="code"></td>
48 <td><label for="currency_type">Currency Type:</label></td>
50 <input jsId='fsCurrencySelector' name="currency_type"
51 dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
56 <td valign='top'><label for="owner">Owning Location:</label></td>
58 <input dojoType="openils.widget.OrgUnitFilteringSelect" jsId='fsOwnerSelect'
59 searchAttr="shortname" name="owner" autocomplete="true" labelAttr='shortname'> </input>
63 <td colspan='2' align='center'>
64 <button dojoType=dijit.form.Button type="submit">Create</button>
71 <button dojoType="dijit.form.Button"
72 onclick="openils.acq.FundingSource.deleteFromGrid(
73 fundingSourceListGrid, function(){location.href = location.href})">
78 <!-- The main grid lives here -->
80 function getName(rowIndex) {
81 data = fundingSourceListGrid.model.getRow(rowIndex);
83 return '<a href="[% ctx.base_uri %]/acq/funding_source/view/'+data.id+'">'+data.name+'</a>';
86 var fsGridStructure = [{
88 {name: 'ID', field: 'id'},
89 {name: 'Name', width:'auto', get:getName},
90 {name: 'Code', field:'code'},
91 {name: 'Owner', width:'auto', get:getOrgInfo},
92 {name: 'Currency Type', field: "currency_type"},
93 {name: 'Balance', get:getBalanceInfo}
97 <div id="oils-acq-funding-source-list-grid" jsId='fundingSourceListGrid' dojoType="dojox.Grid" structure='fsGridStructure'></div>