added fiscal year select box
This commit is contained in:
parent
f702e0d15a
commit
61ae4f80ea
@ -39,6 +39,15 @@ class CRM_Grant_Page_AnnualBudgets extends CRM_Core_Page_Basic {
|
|||||||
if (empty($fiscalYear)) {
|
if (empty($fiscalYear)) {
|
||||||
$fiscalYear = date('Y');
|
$fiscalYear = date('Y');
|
||||||
}
|
}
|
||||||
|
$fiscalYearOptions = '';
|
||||||
|
foreach (CRM_Grant_BAO_GrantBudget::getFiscalyear() as $key => $value) {
|
||||||
|
$extra = '';
|
||||||
|
if ($key == $fiscalYear) {
|
||||||
|
$extra = 'selected="selected"';
|
||||||
|
}
|
||||||
|
$fiscalYearOptions .= "<option value='{$key}' {$extra}>{$value}</option>";
|
||||||
|
}
|
||||||
|
$this->assign('fiscal_year_options', $fiscalYearOptions);
|
||||||
$this->assign('fiscalYear', $fiscalYear);
|
$this->assign('fiscalYear', $fiscalYear);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
<div class="crm-content-block crm-block">
|
<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">
|
<table cellpadding="0" cellspacing="0" border="0" class="row-highlight">
|
||||||
<thead class="sticky">
|
<thead class="sticky">
|
||||||
<th>{ts}Endowement{/ts}</th>
|
<th>{ts}Endowement{/ts}</th>
|
||||||
@ -23,3 +28,17 @@
|
|||||||
</table>
|
</table>
|
||||||
{crmButton p="civicrm" q="reset=1" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton}
|
{crmButton p="civicrm" q="reset=1" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton}
|
||||||
</div>
|
</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}
|
||||||
|
Loading…
Reference in New Issue
Block a user