Skip to content
Snippets Groups Projects
Commit b66f5f5d authored by Pradeep Nayak's avatar Pradeep Nayak
Browse files

--worked on RG-108

parent 607c9ba8
No related branches found
No related tags found
No related merge requests found
......@@ -357,18 +357,6 @@ class CRM_Grant_BAO_Query {
$form->addYesNo('grant_report_received', ts('Grant report received?'));
// Added by JMA FIXME
$form->add('text', 'grant_amount_total_low', ts('From'), array('size' => 8, 'maxlength' => 8));
$form->addRule('grant_amount_total_low', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
$form->add('text', 'grant_amount_total_high', ts('To'), array('size' => 8, 'maxlength' => 8));
$form->addRule('grant_amount_total_high', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
$form->add('text', 'grant_amount_low', ts('From'), array('size' => 8, 'maxlength' => 8));
$form->addRule('grant_amount_low', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
$form->add('text', 'grant_amount_high', ts('To'), array('size' => 8, 'maxlength' => 8));
$form->addRule('grant_amount_high', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
// add all the custom searchable fields
$grant = array('Grant');
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $grant);
......
......@@ -179,6 +179,27 @@ function grantprograms_civicrm_buildForm($formName, &$form) {
ts('To'),
array('size' => 9, 'maxlength' => 9)
);
$form->add('text',
'grant_amount_low',
ts('From'),
array('size' => 8, 'maxlength' => 8)
);
$form->addRule('grant_amount_low',
ts('Please enter a valid money value (e.g. %1).',
array(1 => CRM_Utils_Money::format('9.99', ' '))),
'money'
);
$form->add('text',
'grant_amount_high',
ts('To'),
array('size' => 8, 'maxlength' => 8)
);
$form->addRule('grant_amount_high',
ts('Please enter a valid money value (e.g. %1).',
array(1 => CRM_Utils_Money::format('99.99', ' '))),
'money'
);
}
}
......@@ -221,4 +242,8 @@ function grantprograms_civicrm_validate($formName, &$fields, &$files, &$form) {
}
}
return empty($errors) ? TRUE : $errors;
}
function grantprograms_civicrm_pre( $op, $objectName, $id, &$params ) {
}
\ No newline at end of file
......@@ -178,18 +178,15 @@ INSERT IGNORE INTO `civicrm_option_group` (`id`, `name`, `title`, `description`,
SELECT @opGId := id FROM civicrm_option_group WHERE name = 'grant_thresholds';
-- option values
SET @opv1 := '';
SET @opv2 := '';
SET @opv3 := '';
SET @opv4 := '';
SELECT @opv1 := id FROM civicrm_option_value WHERE name = 'Funding factor' AND option_group_id = @opGId;
SELECT @opv2 := id FROM civicrm_option_value WHERE name = 'Fixed Percentage Of Grant' AND option_group_id = @opGId;
SELECT @opv3 := id FROM civicrm_option_value WHERE name = 'Maximum Grant' AND option_group_id = @opGId;
SELECT @opv4 := id FROM civicrm_option_value WHERE name = 'Minimum Score For Grant Award' AND option_group_id = @opGId;
INSERT IGNORE INTO `civicrm_option_value` (`id`, `option_group_id`, `label`, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `description`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `domain_id`, `visibility_id`)
VALUES
(@opv1, @opGId, 'Funding factor', '85', NULL, NULL, 0, 0, 4, NULL, 0, 0, 1, NULL, NULL, NULL),
(@opv2, @opGId, 'Fixed Percentage Of Grant', '80', 'Fixed Percentage Of Grant', NULL, 0, 0, 3, NULL, 0, 1, 1, NULL, NULL, NULL),
(@opv3, @opGId, 'Maximum Grant', '1500', 'Maximum Grant', NULL, 0, 0, 1, NULL, 0, 1, 1, NULL, NULL, NULL),
(@opv4, @opGId, 'Minimum Score For Grant Award', '73', 'Minimum Score For Grant Award', NULL, 0, 0, 2, NULL, 0, 1, 1, NULL, NULL, NULL);
......
......@@ -107,7 +107,7 @@ cj("#download").hide();
window.location.href = cj(".download").attr('href');
}
cj(function() {
cj().crmaccordions();
cj().crmAccordions();
});
</script>
{/literal}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment