dojo.require("dijit.Dialog");
+dojo.require('dijit.form.FilteringSelect');
dojo.require('dijit.layout.TabContainer');
dojo.require('dijit.layout.ContentPane');
dojo.require('dojox.grid.Grid');
}
}
+function createAllocation(fields) {
+ fields.fund = fundID;
+ if(isNaN(fields.percent)) fields.percent = null;
+ if(isNaN(fields.amount)) fields.amount = null;
+ //openils.acq.Fund.createAllocation(fields, resetPage);
+ openils.acq.Fund.createAllocation(fields,
+ function(r){location.href = location.href;});
+}
+
function getOrgInfo(rowIndex) {
data = fundGrid.model.getRow(rowIndex);
if(!data) return;
<div id='oils-acq-list-header-label'>${_('Fund Details')}</div>
</div>
+<div class='oils-acq-actions-div' style='margin:8px;'> <!-- XXX CSS -->
+ <!-- Dropdown menu for creating a new funding source credit -->
+ <div dojoType="dijit.form.DropDownButton">
+ <span>${('Create Allocation')}</span>
+ <div dojoType="dijit.TooltipDialog" execute="createAllocation(arguments[0]);">
+ <script type='dojo/connect' event='onOpen'>
+ openils.acq.FundingSource.createStore(
+ function(store) {
+ fundingSourceSelector.store =
+ new dojo.data.ItemFileReadStore({data:store});
+ fundingSourceSelector.setValue(store.items[0].id);
+ }, 'MANAGE_FUNDING_SOURCE'
+ );
+ </script>
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td><label for="amount">${_('Funding Source:')} </label></td>
+ <td>
+ <input jsId='fundingSourceSelector' name="funding_source"
+ dojoType="dijit.form.FilteringSelect" searchAttr='name' labelAttr='name'>
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="amount">${_('Amount:')} </label></td>
+ <td>
+ <!-- XXX get currency from funding source ... -->
+ <input dojoType="dijit.form.CurrencyTextBox" name="amount" currency='USD'> </input>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="amount">${_('Percent:')} </label></td>
+ <td>
+ <input
+ dojoType="dijit.form.NumberTextBox"
+ constraints="{min:0,max:100}"
+ promptMessage="${_('Please enter an amount between 0 and 100')}"
+ name="percent">
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="note">${_('Note:')} </label></td>
+ <td>
+ <input dojoType="dijit.form.TextBox" name="note"> </input>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">${_('Apply')}</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+
+
<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
<div dojoType="dijit.layout.TabContainer">
<div dojoType="dijit.layout.ContentPane"