added validation

This commit is contained in:
Civiware Solutions 2018-11-01 22:59:22 +05:30
parent 2d8ca3f2a3
commit 9f05f9fb13

View File

@ -316,6 +316,22 @@ function ftoverride_civicrm_pre($op, $objectName, $id, &$params) {
}
}
/**
* Implements hook_civicrm_validateForm().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_validateForm
*/
function ftoverride_civicrm_validateForm($formName, &$fields, &$files, &$form, &$errors) {
if ('CRM_Contribute_Form_Contribution_Main' == $formName) {
if (!empty($fields['designation'])
&& $fields['designation'] == 'other_financial_type'
&& empty($fields['designation_note'])
) {
$errors['designation_note'] = ts('Please provide other information about designation.');
}
}
}
/**
* Implements hook_civicrm_buildAmount().
*