Skip to content

Commit

Permalink
CRM-21523 add form rule for repetition fields in scheduled reminder form
Browse files Browse the repository at this point in the history
  • Loading branch information
lcdservices committed Dec 5, 2017
1 parent bc09c0a commit 9971679
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CRM/Admin/Form/ScheduleReminders.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,13 @@ public static function formRule($fields, $files, $self) {
$errors[$recipientKind[$fields['recipient']]['target_id']] = ts('If "Also include" or "Limit to" are selected, you must specify at least one %1', array(1 => $recipientKind[$fields['recipient']]['name']));
}

//CRM-21523
if (!empty($fields['is_repeat']) &&
(empty($fields['repetition_frequency_interval']) || ($fields['end_frequency_interval'] == NULL))
) {
$errors['is_repeat'] = ts('If you are enabling repetition you must indicate the frequency and ending term.');
}

$actionSchedule = $self->parseActionSchedule($fields);
if ($actionSchedule->mapping_id) {
$mapping = CRM_Core_BAO_ActionSchedule::getMapping($actionSchedule->mapping_id);
Expand Down

0 comments on commit 9971679

Please sign in to comment.