<td class="label">{$form.exclude_date_list.label} {help id="id-exclude-date" entityType=$entityType file="CRM/Core/Form/RecurringEntity.hlp"}</td>\r
<td>{$form.exclude_date_list.html}</td>\r
</tr>\r
- <tr>\r
- <td class="label bold">{ts}Summary:{/ts}</td>\r
- <td><span id="rec-summary"></span></td>\r
- </tr>\r
</table>\r
<div class="crm-submit-buttons">\r
{include file="CRM/common/formButtons.tpl" location="bottom"}\r
}\r
});\r
\r
- //Build Summary\r
- var finalSummary = '';\r
- var numberText = '';\r
- var interval = $('#repetition_frequency_interval').val() + ' ';\r
- if ($('#repetition_frequency_interval').val() == 1) {\r
- interval = '';\r
- } else {\r
- numberText = 's';\r
- }\r
- finalSummary = "Every " + interval + $('#repetition_frequency_unit option:selected').val() + numberText;\r
-\r
- //Case Week\r
- var dayOfWeek = [];\r
- if ($('#repetition_frequency_unit option:selected').val() == "week") {\r
- $("input[name^='start_action_condition']:checked").each(function() {\r
- var tempArray = [];\r
- var thisID = $(this).attr('id');\r
- tempArray = thisID.split('_');\r
- dayOfWeek.push(tempArray[3].substr(0, 1).toUpperCase() + tempArray[3].substr(1).toLowerCase());\r
- });\r
- finalSummary += ' on ' + dayOfWeek.join();\r
- }\r
-\r
- //Case Monthly\r
- if ($('#repetition_frequency_unit option:selected').val() == "month") {\r
- if ($('input:radio[name=repeats_by]:checked').val() == 1) {\r
- finalSummary += ' on day ' + $('#limit_to').val();\r
- }\r
- if ($('input:radio[name=repeats_by]:checked').val() == 2) {\r
- finalSummary += ' on ' + $('#entity_status_1').val().substr(0, 1).toUpperCase() + $('#entity_status_1').val().substr(1).toLowerCase() + ' ' + $('#entity_status_2').val().substr(0, 1).toUpperCase() + $('#entity_status_2').val().substr(1).toLowerCase();\r
- }\r
- }\r
-\r
- //Case Ends\r
- if ($('input:radio[name=ends]:checked').val() == 1) {\r
- var timeText = ''\r
- if ($('#start_action_offset').val() != 1) {\r
- timeText = $('#start_action_offset').val() + ' times';\r
- } else {\r
- timeText = ' once';\r
- }\r
- finalSummary += ', ' + timeText;\r
- }\r
- if ($('input:radio[name=ends]:checked').val() == 2) {\r
- var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];\r
- var date = new Date($('#repeat_absolute_date_display').val());\r
- function addOrdinal(d) {\r
- if (d>3 && d<21) return 'th';\r
- switch (d % 10) {\r
- case 1: return "st";\r
- case 2: return "nd";\r
- case 3: return "rd";\r
- default: return "th";\r
- }\r
- }\r
- var newDate = monthNames[(date.getMonth())] + ' ' + date.getDate()+ addOrdinal() + ' ' + date.getFullYear();\r
- finalSummary += ', untill '+ newDate;\r
- }\r
-\r
- //Build/Attach final Summary\r
- $('#rec-summary').html(finalSummary);\r
-\r
});\r
\r
</script>\r
{/literal}\r
-{*Hide Summary*}\r
-{if empty($scheduleReminderId)}\r
-{literal}\r
- <script type="text/javascript">\r
- CRM.$(function($) {\r
- if ($('#rec-summary').length) {\r
- $('#rec-summary').parent().parent().hide();\r
- }\r
- });\r
- </script>\r
-{/literal}\r
-{/if}\r