<div dojoType="dijit.form.DropDownButton">
<span>[% l('Allocate to Fund') %]</span>
<div dojoType="dijit.TooltipDialog" execute="applyFSAllocation(arguments[0]);">
- <script type='dojo/connect' event='onOpen'>
- openils.acq.Fund.createStore(
- function(store) {
- fundingSourceFundSelector.store =
- new dojo.data.ItemFileReadStore({data:store});
- fundingSourceFundSelector.setValue(store.items[0].code);
- }, 'MANAGE_FUND'
- );
- </script>
<table class='dijitTooltipTable'>
<tr>
- <td><label for="amount">[% l('Fund: ') %]</label></td>
+ <td><label for="fund">[% l('Fund: ') %]</label></td>
<td>
- <input jsId='fundingSourceFundSelector' name="fund"
- dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
- </input>
+ <div id="oils-acq-funding-source-fund-allocate"></div>
</td>
</tr>
<tr>
</tr>
<!-- Percent-based allocations are not supported. Will implement or remove later.
<tr>
- <td><label for="amount">[% l('Percent: ') %]</label></td>
+ <td><label for="percent">[% l('Percent: ') %]</label></td>
<td>
<input
dojoType="dijit.form.NumberTextBox"
also_load_grid(true /* reset_first */);
}
req.send();
+
+ new openils.widget.AutoFieldWidget({
+ "fmField": "fund",
+ /* We're not really using LIDs here, we just need some class
+ * that has a fund field to take advantage of AutoFieldWidget's
+ * magic. */
+ "fmClass": "acqlid",
+ "labelFormat": ["${0} (${1})", "code", "year"],
+ "searchFormat": ["${0} (${1})", "code", "year"],
+ "searchFilter": {"active": "t"},
+ "searchOptions": {"order_by" : {"acqf":"year DESC, code"}},
+ "parentNode": dojo.byId("oils-acq-funding-source-fund-allocate"),
+ "orgLimitPerms": ["MANAGE_FUND"], //???
+ "dijitArgs": { "name" : "fund" }
+ }).build(function(w, ww) {});
}
/** Some grid rendering accessor functions ----- */