From c828f12af427ecdc7bcc63734d90d1d1df23760c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Sep 2014 15:53:57 +0100 Subject: [PATCH] Ajax validation where ocurrences should not be more than 30, help text for help icons --- CRM/Core/BAO/RecurringEntity.php | 3 ++ templates/CRM/Core/Form/RecurringEntity.tpl | 7 ++- .../CRM/Event/Form/ManageEvent/Repeat.hlp | 45 +++++++++++++++---- 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/CRM/Core/BAO/RecurringEntity.php b/CRM/Core/BAO/RecurringEntity.php index 5703dc98f6..bdfae9f077 100644 --- a/CRM/Core/BAO/RecurringEntity.php +++ b/CRM/Core/BAO/RecurringEntity.php @@ -361,6 +361,9 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { //Ends if($scheduleReminderDetails['start_action_offset']){ + if($scheduleReminderDetails['start_action_offset'] > 30){ + $r->errors[] = 'Occurrences should be less than or equal to 30'; + } $r->count($scheduleReminderDetails['start_action_offset']); } diff --git a/templates/CRM/Core/Form/RecurringEntity.tpl b/templates/CRM/Core/Form/RecurringEntity.tpl index e15adae26c..4b38d67fbd 100644 --- a/templates/CRM/Core/Form/RecurringEntity.tpl +++ b/templates/CRM/Core/Form/RecurringEntity.tpl @@ -64,7 +64,7 @@ *} {$form.ends.label} - {$form.ends.1.html} {$form.start_action_offset.html} occurrences{help id="id-ends-after"} + {$form.ends.1.html} {$form.start_action_offset.html} occurrences {help id="id-ends-after"} @@ -88,9 +88,9 @@ -