From 1bf65b67676c7ca56369f1d65037fd27cac0fd24 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Fri, 14 Nov 2014 23:55:22 +0530 Subject: [PATCH] CRM-15536 fixes - Scheduled reminders: Clarify "Limit to" and "Also include" UI to prevent user errors https://issues.civicrm.org/jira/browse/CRM-15536 --- CRM/Core/Smarty/plugins/function.help.php | 7 ++++++- templates/CRM/Admin/Form/ScheduleReminders.tpl | 17 +++++++++++------ templates/CRM/Admin/Page/ScheduleReminders.hlp | 6 +++++- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/CRM/Core/Smarty/plugins/function.help.php b/CRM/Core/Smarty/plugins/function.help.php index 857d0b7488..1946ee872f 100644 --- a/CRM/Core/Smarty/plugins/function.help.php +++ b/CRM/Core/Smarty/plugins/function.help.php @@ -71,6 +71,11 @@ function smarty_function_help($params, &$smarty) { $name = trim(strip_tags($params['title'])); } + $class = "helpicon"; + if (!empty($params['class'])) { + $class .= " {$params['class']}"; + } + // Escape for html $title = htmlspecialchars(ts('%1 Help', array(1 => $name))); // Escape for html and js @@ -81,5 +86,5 @@ function smarty_function_help($params, &$smarty) { foreach ($params as &$param) { $param = is_bool($param) || is_numeric($param) ? (int) $param : (string) $param; } - return ' '; + return ' '; } diff --git a/templates/CRM/Admin/Form/ScheduleReminders.tpl b/templates/CRM/Admin/Form/ScheduleReminders.tpl index d85e6720ec..f5324e265c 100644 --- a/templates/CRM/Admin/Form/ScheduleReminders.tpl +++ b/templates/CRM/Admin/Form/ScheduleReminders.tpl @@ -80,7 +80,7 @@ {$form.from_email.html}   - {$form.recipient.label}{$form.limit_to.html}  {$form.recipient.html}  {help id="recipient" title=$form.recipient.label} + {$form.recipient.label}{$form.limit_to.html} {help id="limit_to" class="limit_to" title=$form.recipient.label}{$form.recipient.html} {help id="recipient" class="recipient" title=$recipientLabels.activity} {$form.recipient_listing.label}{$form.recipient_listing.html} @@ -178,7 +178,7 @@ } }); if ($('#absolute_date_display', $form).val()) { - $('#relativeDate, #relativeDateRepeat, #repeatFields', $form).hide(); + $('#relativeDate, #relativeDateRepeat, #repeatFields, #OR', $form).hide(); } $('#entity_0', $form).change(buildSelects).change(showHideLimitTo); @@ -220,11 +220,12 @@ .done(function(result) { CRM.utils.setOptions($('#recipient_listing', $form), result.values); }); - $("#recipientList", $form).show(); + $("#recipientList, a.limit_to", $form).show(); + $("#recipient").css("margin-left", "12px"); } else { $("#recipientList", $form).hide(); if ($('#entity_0', $form).val() !== '1' && $('#limit_to').val() == '') { - $('tr.recipient:visible').hide(); + $('tr.recipient:visible, a.limit_to').hide(); } } } @@ -233,12 +234,16 @@ $('#limit_to', $form).toggle(!($('#entity_0', $form).val() == '1')); if ($('#entity_0', $form).val() != '1') { if ($('#limit_to', $form).val() == '') { - $('#recipient').hide(); + $('#recipient, a.limit_to').hide(); + } + else { + $('a.limit_to').show(); } $("label[for='recipient']").text('{/literal}{$recipientLabels.other}{literal}'); } else { - $('#recipient').show(); + $('#recipient').show().css("margin-left", "-2px"); + $('a.limit_to').hide(); $("label[for='recipient']").text('{/literal}{$recipientLabels.activity}{literal}'); } } diff --git a/templates/CRM/Admin/Page/ScheduleReminders.hlp b/templates/CRM/Admin/Page/ScheduleReminders.hlp index 370da0fae7..f607c7a831 100644 --- a/templates/CRM/Admin/Page/ScheduleReminders.hlp +++ b/templates/CRM/Admin/Page/ScheduleReminders.hlp @@ -23,11 +23,15 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{htxt id="recipient"} +{htxt id="limit_to"}

{ts}Select 'Limit to' if you want to only send reminders to contacts with the criteria selected above AND who ALSO match this criteria. If you select 'Choose Recipients' - only the chosen contacts will receive the reminder (AND only if they ALSO match the criteria above).{/ts}

{ts}Select 'Also include' if you want to also send reminders to contacts who match this criteria. If you select 'Choose Recipients' - the chosen contacts will also receive the reminder (in ADDITION TO the contacts who match the criteria above).{/ts} {/htxt} +{htxt id="recipient"} + {ts} ... {/ts} +{/htxt} + {htxt id="id-from_name_email-title"} {ts}Specify FROM Name and Email{/ts} {/htxt} -- 2.25.1