org.agbu.annualgrantbudgets/templates/CRM/Grant/Page/AnnualBudgets.tpl

45 lines
1.5 KiB
Smarty

<div class="crm-content-block crm-block">
<label>{ts}Fiscal Year: {/ts}</label>
<select name="fiscal_year" type="text" id="fiscal_year" class="crm-form-select required crm-select2 six">
{$fiscal_year_options}
</select>
</br></br>
<table cellpadding="0" cellspacing="0" border="0" class="row-highlight">
<thead class="sticky">
<th>{ts}Endowement{/ts}</th>
<th>{ts}Annual Budget{/ts}</th>
<th>{ts}Amount Awarded{/ts}</th>
<th>{ts}Amound Remaining{/ts}</th>
</thead>
{crmAPI var='result' entity='GrantBudget' action='getbudget' fiscal_year=$fiscalYear}
{foreach from=$result.values item=row}
{if $row.id}
{assign var='rowId' value=$row.id}
{else}
{capture assign=rowId}{$row.financial_type_id}_{$fiscalYear}{/capture}
{/if}
<tr id="GrantBudget-{$rowId}" class="crm-entity {cycle values="odd-row,even-row"}">
<td>{$row.name}</td>
<td class="crm-editable" data-field="budget" data-type="text">{$row.budget}</td>
<td>{$row.total_amount_granted}</td>
<td>{$row.balance_amount}</td>
</tr>
{/foreach}
</table>
{crmButton p="civicrm" q="reset=1" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton}
</div>
{literal}
<script type="text/javascript">
CRM.$(function($) {
$('#fiscal_year').change(loadPage);
function loadPage() {
window.location.href = CRM.url('civicrm/grant/annual/budgets', {
reset: '1',
fiscalYear: $('#fiscal_year').val()
});
}
});
</script>
{/literal}