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, item) {
82 var name = this.grid.store.getValue(item, 'name');
83 var id = this.grid.store.getValue(item, 'id');
84 return '<a href="[% ctx.base_uri %]/acq/funding_source/view/'+id+'">'+name+'</a>';
87 <div dojoType="dijit.layout.ContentPane" layoutAlign="top">
88 <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
89 <table jsId="fundingSourceListGrid" dojoType="dojox.grid.DataGrid" query="{id: '*'}" rowSelector='20px'>
92 <th field="id">ID</th>
93 <th field="name" width='auto' get='getName'>Name</th>
94 <th field="owner" width='auto'get='getOrgInfo'>Owner</th>
95 <th field="code" width='auto'>Code</th>
96 <th field="currency_type" width='auto'>Currency Type</th>
97 <th field="balance" width='auto' get='getBalanceInfo'>Balance</th>