70 lines
2.6 KiB
Smarty
70 lines
2.6 KiB
Smarty
<div class="crm-content-block crm-block">
|
|
{* Check to see if this user can lock/unlock items *}
|
|
{if call_user_func(array('CRM_Core_Permission','check'), 'Administer CiviCRM')}
|
|
{assign var='canLock' value='crm-editable'}
|
|
{/if}
|
|
|
|
<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}Endowment{/ts}</th>
|
|
<th>{ts}Annual Budget{/ts}</th>
|
|
<th>{ts}Amount Awarded{/ts}</th>
|
|
<th>{ts}Amount Remaining{/ts}</th>
|
|
<th>{ts}Locked?{/ts}</th>
|
|
<th>{ts}Note{/ts}</th>
|
|
</thead>
|
|
{crmAPI var='result' entity='GrantBudget' action='getbudget' fiscal_year=$fiscalYear}
|
|
{crmAPI var='totals' entity='GrantBudget' action='getbudget' fiscal_year=$fiscalYear return_totals=1}
|
|
<tr id="GrantBudget-totals" class="crm-entity">
|
|
<td><strong>Totals:</strong></td>
|
|
{foreach from=$totals.values item=total}
|
|
<td><strong>{$total}</strong></td>
|
|
{/foreach}
|
|
</tr>
|
|
{foreach from=$result.values item=row}
|
|
{if $row.id}
|
|
{assign var='rowId' value=$row.id}
|
|
{if !$row.is_reserved}
|
|
{assign var='canEdit' value='crm-editable'}
|
|
{/if}
|
|
{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="{$canEdit}" data-field="budget" data-type="text">{$row.budget}</td>
|
|
<td>{$row.total_amount_granted}</td>
|
|
<td>{$row.balance_amount}</td>
|
|
<td class="{$canLock}" data-field="is_reserved" data-type="boolean">{if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
|
|
<td class="{$canEdit}" data-field="note" data-type="text">{$row.note}</td>
|
|
</tr>
|
|
{/foreach}
|
|
<tr id="GrantBudget-totals" class="crm-entity">
|
|
<td><strong>Totals:</strong></td>
|
|
{foreach from=$totals.values item=total}
|
|
<td><strong>{$total}</strong></td>
|
|
{/foreach}
|
|
</tr>
|
|
</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}
|