}
}
+ //CRM-16285 - Function to handle validation errors on form, for recurring contribution field.
+ public static function validateRecurContribution($fields, $files, $self, &$errors) {
+ if (!empty($fields['is_recur'])) {
+ if ($fields['frequency_interval'] <= 0) {
+ $errors['frequency_interval'] = ts('Please enter a number for how often you want to make this recurring contribution (EXAMPLE: Every 3 months).');
+ }
+ if ($fields['frequency_unit'] == '0') {
+ $errors['frequency_unit'] = ts('Please select a period (e.g. months, years ...) for how often you want to make this recurring contribution (EXAMPLE: Every 3 MONTHS).');
+ }
+ }
+ }
}
$errors['total_amount'] = ts('The sum of fee amount and net amount must be equal to total amount');
}
}
+
+ //CRM-16285 - Function to handle validation errors on form, for recurring contribution field.
+ CRM_Contribute_BAO_ContributionRecur::validateRecurContribution($fields, $files, $self, $errors);
+
// Form rule for status http://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+4.3+Data+Flow
if ($self->_id && $self->_values['contribution_status_id'] != $fields['contribution_status_id']) {
CRM_Contribute_BAO_Contribution::checkStatusValidation($self->_values, $fields, $errors);
}
}
- if (!empty($fields['is_recur'])) {
- if ($fields['frequency_interval'] <= 0) {
- $errors['frequency_interval'] = ts('Please enter a number for how often you want to make this recurring contribution (EXAMPLE: Every 3 months).');
- }
- if ($fields['frequency_unit'] == '0') {
- $errors['frequency_unit'] = ts('Please select a period (e.g. months, years ...) for how often you want to make this recurring contribution (EXAMPLE: Every 3 MONTHS).');
- }
- }
+ //CRM-16285 - Function to handle validation errors on form, for recurring contribution field.
+ CRM_Contribute_BAO_ContributionRecur::validateRecurContribution($fields, $files, $self, $errors);
if (!empty($fields['is_recur']) &&
CRM_Utils_Array::value('payment_processor', $fields) == 0