From 95f4b4d8f8f90d029ea624a2e89abbedd0e45cd4 Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Tue, 5 Apr 2022 17:31:47 -0400 Subject: [PATCH] core#1836 - restrict scheduled reminder 'Also Include' to non-events --- templates/CRM/Admin/Form/ScheduleReminders.tpl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/templates/CRM/Admin/Form/ScheduleReminders.tpl b/templates/CRM/Admin/Form/ScheduleReminders.tpl index 95d5cefe17..25fb8e16fd 100644 --- a/templates/CRM/Admin/Form/ScheduleReminders.tpl +++ b/templates/CRM/Admin/Form/ScheduleReminders.tpl @@ -228,8 +228,17 @@ // CRM-14070 Hide limit-to when entity is activity function showHideLimitTo() { + // '1' is the value of "Activity" in the entity select box. $('#limit_to', $form).toggle(!($('#entity_0', $form).val() == '1')); if ($('#entity_0', $form).val() != '1' || !($('#entity_0').length)) { + // Some Event entity is selected. + if (['2', '3', '5'].includes($('#entity_0', $form).val())) { + $('#limit_to option[value="0"]', $form).attr('disabled','disabled').removeAttr('selected'); + } + else { + $('#limit_to option[value="0"]', $form).removeAttr('disabled'); + } + // Anything but Activity is selected. if ($('#limit_to', $form).val() == '') { $('tr.recipient:visible, #recipientList, #recipient, a.recipient').hide(); $('a.limit_to').show(); @@ -241,6 +250,7 @@ $("label[for='recipient']").text('{/literal}{$recipientLabels.other}{literal}'); } else { + // Activity is selected. $('#recipient, a.recipient').show() $('#recipient').css("margin-left", "-2px"); $('a.limit_to').hide(); -- 2.25.1