Commit 9aa90dcd authored by Mayur Jadhav's avatar Mayur Jadhav

RG-104 added Previous Year's NEI Grant Program field on Grant Program Form and removed ~ file

parent ba113c45
......@@ -114,9 +114,9 @@ class CRM_Grant_BAO_GrantProgram extends CRM_Grant_DAO_GrantProgram {
}
static function grantPrograms($id = NULL) {
$where = '';
$where = 'WHERE is_active = 1';
if (!empty($id)) {
$where = "WHERE id = {$id}";
$where .= " AND id = {$id}";
}
$query = "SELECT id, label FROM civicrm_grant_program {$where}";
$dao = CRM_Core_DAO::executeQuery($query);
......
......@@ -114,6 +114,7 @@ class CRM_Grant_Form_GrantProgram extends CRM_Core_Form {
$this->applyFilter('__ALL__','trim');
$attributes = CRM_Core_DAO::getAttribute('CRM_Grant_DAO_GrantProgram');
$grantPrograms = CRM_Grant_BAO_GrantProgram::grantPrograms();
$this->add('text', 'label', ts('Label'),
$attributes['label'], TRUE);
......@@ -141,7 +142,10 @@ class CRM_Grant_Form_GrantProgram extends CRM_Core_Form {
$grantAlgorithm = CRM_Core_OptionGroup::values('allocation_algorithm');
$this->add('select', 'allocation_algorithm', ts('Allocation Algorithm'),
array('' => ts('- select -')) + $grantAlgorithm , TRUE);
$this->add('select', 'grant_program_id', ts("Previous Year's NEI Grant Program"),
array('' => ts('- select -')) + $grantPrograms, TRUE);
$this->addDate('allocation_date', ts('Allocation Date'), FALSE, array('formatType' => 'custom'));
$this->add('checkbox', 'is_active', ts('Enabled?'));
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment