$surveysData[$sid]['campaign'] = CRM_Utils_Array::value($campaignId, $campaigns);
$surveysData[$sid]['activity_type'] = $surveyType[$survey['activity_type_id']];
if (!empty($survey['release_frequency'])) {
- $surveysData[$sid]['release_frequency'] = $survey['release_frequency'] . ' Day(s)';
+ $surveysData[$sid]['release_frequency'] = $survey['release_frequency'] . ' ' . ts('Day(s)');
}
$action = array_sum(array_keys(self::surveyActionLinks($surveysData[$sid]['activity_type'])));
self::$_scheduleReminderID = self::$_scheduleReminderDetails->id;
}
}
- if ($entityTable) {
- CRM_Core_OptionValue::getValues(array('name' => $entityTable . '_repeat_exclude_dates_' . self::$_parentEntityId), $optionValue);
- $excludeOptionValues = array();
- if (!empty($optionValue)) {
- foreach ($optionValue as $key => $val) {
- $excludeOptionValues[$val['value']] = CRM_Utils_Date::customFormat($val['value']);
- }
- self::$_excludeDateInfo = $excludeOptionValues;
+ CRM_Core_OptionValue::getValues(array('name' => $entityTable . '_repeat_exclude_dates_' . self::$_parentEntityId), $optionValue);
+ $excludeOptionValues = array();
+ if (!empty($optionValue)) {
+ foreach ($optionValue as $key => $val) {
+ $excludeOptionValues[$val['value']] = CRM_Utils_Date::customFormat($val['value']);
}
+ self::$_excludeDateInfo = $excludeOptionValues;
}
+
+ // Assign variables
+ $entityType = CRM_Core_DAO_AllCoreTables::getBriefName(CRM_Core_DAO_AllCoreTables::getClassForTable($entityTable));
+ $tpl = CRM_Core_Smarty::singleton();
+ $tpl->assign('recurringEntityType', ts($entityType));
+ $tpl->assign('currentEntityId', self::$_entityId);
+ $tpl->assign('entityTable', self::$_entityTable);
+ $tpl->assign('scheduleReminderId', self::$_scheduleReminderID);
+ $tpl->assign('hasParent', self::$_hasParent);
}
/**
* @param CRM_Core_Form $form
*/
public static function buildQuickForm(&$form) {
- if (self::$_entityTable) {
- $entityType = explode("_", self::$_entityTable);
- if ($entityType[1]) {
- $form->assign('entityType', ucwords($entityType[1]));
- }
- }
- $form->assign('currentEntityId', self::$_entityId);
- $form->assign('entityTable', self::$_entityTable);
- $form->assign('scheduleReminderId', self::$_scheduleReminderID);
- $form->assign('hasParent', self::$_hasParent);
- $form->_freqUnits = array('hour' => 'hour') + CRM_Core_OptionGroup::values('recur_frequency_units');
- foreach ($form->_freqUnits as $val => $label) {
- if ($label == "day") {
- $label = "dai";
- }
- $freqUnitsDisplay[$val] = ts('%1ly', array(1 => $label));
- }
- // echo "<pre>";print_r($freqUnitsDisplay);
+ $freqUnitsDisplay = array('hour' => ts('hour')) + CRM_Core_OptionGroup::values('recur_frequency_units');
+
+ // For some reason this is using the following as keys rather than the standard numeric keys returned by CRM_Utils_Date
$dayOfTheWeek = array(
- 'monday' => 'Monday',
- 'tuesday' => 'Tuesday',
- 'wednesday' => 'Wednesday',
- 'thursday' => 'Thursday',
- 'friday' => 'Friday',
- 'saturday' => 'Saturday',
- 'sunday' => 'Sunday',
+ 'sunday',
+ 'monday',
+ 'tuesday',
+ 'wednesday',
+ 'thursday',
+ 'friday',
+ 'saturday',
);
- $form->add('select', 'repetition_frequency_unit', ts('Repeats:'), $freqUnitsDisplay);
+ $dayOfTheWeek = array_combine($dayOfTheWeek, CRM_Utils_Date::getAbbrWeekdayNames());
+ $form->add('select', 'repetition_frequency_unit', ts('Repeats every'), $freqUnitsDisplay);
$numericOptions = CRM_Core_SelectValues::getNumericOptions(1, 30);
- $form->add('select', 'repetition_frequency_interval', ts('Repeats every:'), $numericOptions, '', array('style' => 'width:55px;'));
+ $form->add('select', 'repetition_frequency_interval', NULL, $numericOptions);
$form->addDateTime('repetition_start_date', ts('Repetition Start Date'), FALSE, array('formatType' => 'activityDateTime'));
foreach ($dayOfTheWeek as $key => $val) {
- $startActionCondition[] = $form->createElement('checkbox', $key, NULL, substr($val . " ", 0, 3));
+ $startActionCondition[] = $form->createElement('checkbox', $key, NULL, $val);
}
$form->addGroup($startActionCondition, 'start_action_condition', ts('Repeats on'));
$roptionTypes = array(
'1' => ts('day of the month'),
'2' => ts('day of the week'),
);
- $form->addRadio('repeats_by', ts("Repeats By:"), $roptionTypes, array(), NULL);
+ $form->addRadio('repeats_by', ts("Repeats By"), $roptionTypes, array(), NULL);
$getMonths = CRM_Core_SelectValues::getNumericOptions(1, 31);
- $form->add('select', 'limit_to', '', $getMonths, FALSE, array('style' => 'width:55px;'));
+ $form->add('select', 'limit_to', '', $getMonths);
$dayOfTheWeekNo = array(
- 'first' => 'First',
- 'second' => 'Second',
- 'third' => 'Third',
- 'fourth' => 'Fourth',
- 'last' => 'Last',
+ 'first' => ts('First'),
+ 'second' => ts('Second'),
+ 'third' => ts('Third'),
+ 'fourth' => ts('Fourth'),
+ 'last' => ts('Last'),
);
- $form->add('select', 'entity_status_1', ts(''), $dayOfTheWeekNo);
- $form->add('select', 'entity_status_2', ts(''), $dayOfTheWeek);
+ $form->add('select', 'entity_status_1', '', $dayOfTheWeekNo);
+ $form->add('select', 'entity_status_2', '', $dayOfTheWeek);
$eoptionTypes = array(
'1' => ts('After'),
'2' => ts('On'),
);
- $form->addRadio('ends', ts("Ends:"), $eoptionTypes, array(), NULL);
+ $form->addRadio('ends', ts("Ends"), $eoptionTypes, array(), NULL);
$form->add('text', 'start_action_offset', ts(''), array('size' => 3, 'maxlength' => 2));
$form->addFormRule(array('CRM_Core_Form_RecurringEntity', 'formRule'));
$form->addDate('repeat_absolute_date', ts('On'), FALSE, array('formatType' => 'mailing'));
}
//Set type for API
- $apiEntityType = array();
$apiEntityType = explode("_", $type);
if (!empty($apiEntityType[1])) {
$apiType = $apiEntityType[1];
$recursion->linkedEntities = $linkedEntities;
}
- $recurResult = $recursion->generate();
+ $recursion->generate();
$status = ts('Repeat Configuration has been saved');
CRM_Core_Session::setStatus($status, ts('Saved'), 'success');
foreach ($dates as $key => &$value) {
if ($startDateColumnName) {
- $value['start_date'] = date('M d, Y h:i:s A \o\n l', strtotime($value[$startDateColumnName]));
+ $value['start_date'] = CRM_Utils_Date::customFormat($value[$startDateColumnName]);
}
if ($endDateColumnName && !empty($value[$endDateColumnName])) {
- $value['end_date'] = date('M d, Y h:i:s A \o\n l', strtotime($value[$endDateColumnName]));
+ $value['end_date'] = CRM_Utils_Date::customFormat($value[$endDateColumnName]);
$endDates = TRUE;
}
}
if (in_array('CiviEvent', $config->enableComponents)) {
$this->assign('CiviEvent', TRUE);
}
+ CRM_Core_Form_RecurringEntity::preProcess('civicrm_event');
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add', 'REQUEST');
public function preProcess() {
parent::preProcess();
- CRM_Core_Form_RecurringEntity::preProcess('civicrm_event');
$this->assign('currentEventId', $this->_id);
$checkParentExistsForThisId = CRM_Core_BAO_RecurringEntity::getParentFor($this->_id, 'civicrm_event');
{ts}Repeats{/ts}
{/htxt}
{htxt id="id-repeats"}
- {ts 1=$entityType}Access the drop-down menu here to select how frequently your %1 occurs. Options are:{/ts}
- <ul>
- <li>{ts}Hourly: repeats hourly or after every few hours{/ts}</li>
- <li>{ts 1=$entityType}Daily: repeats daily or after every few days{/ts}</li>
- <li>{ts 1=$entityType}Weekly: repeats on one or more days every week{/ts}</li>
- <li>{ts 1=$entityType}Monthly: repeats on one or more days every month{/ts}</li>
- <li>{ts 1=$entityType}Yearly: repeats yearly or after every few years{/ts}</li>
- </ul>
- {ts 1=$entityType}Example: You would select option "monthly", if your %1 occurs every month.{/ts}
-{/htxt}
-
-{htxt id="id-repeats-every-title"}
- {ts}Repeats every{/ts}
-{/htxt}
-{htxt id="id-repeats-every"}
- {ts}This option decides the repetition interval.{/ts}<br/>
- {ts 1=$entityType}Example: If your %1 repeats every 5 months, then you would select option 5.{/ts}
+ {ts 1=$entityType}Access the drop-down menus here to select how frequently your %1 occurs.{/ts}
+ {ts 1=$entityType}Example: You would select options "1 month", if your %1 occurs every month.{/ts}
{/htxt}
{htxt id="id-repeats-on-title"}
{/htxt}
{htxt id="id-ends-after"}
{ts 1=$entityType}Use this field to limit/end the repetition of the %1.{/ts}<br/>
- {ts 1=$entityType}Example: If you want to repeat an %1 for six months (i.e it repeats 6 times), then set 6 as a value for this field.{/ts}
+ {ts 1=$entityType}Example: If you want to repeat an %1 6 times, then set 6 as a value for this field.{/ts}
{/htxt}
{htxt id="id-ends-on-title"}
\r
<div class="crm-core-form-recurringentity-block crm-accordion-wrapper" id="recurring-entity-block">\r
<div class="crm-accordion-header">\r
- Repeat {if $entityType}{$entityType}{/if}\r
+ {ts 1=$recurringEntityType}Repeat %1{/ts}\r
</div>\r
<div class="crm-accordion-body">\r
<div class="crm-submit-buttons">\r
<td class="label">{$form.repetition_start_date.label}</td>\r
<td>{include file="CRM/common/jcalendar.tpl" elementName=repetition_start_date}</td>\r
</tr>\r
- <tr class="crm-core-form-recurringentity-block-repetition_frequency_unit">\r
- <td class="label">{$form.repetition_frequency_unit.label} <span class="crm-marker" title="This field is required.">*</span> {help id="id-repeats" entityType=$entityType file="CRM/Core/Form/RecurringEntity.hlp"}</td>\r
- <td>{$form.repetition_frequency_unit.html}</td>\r
- </tr>\r
- <tr class="crm-core-form-recurringentity-block-repetition_frequency_interval">\r
- <td class="label">{$form.repetition_frequency_interval.label} <span class="crm-marker" title="This field is required.">*</span> {help id="id-repeats-every" entityType=$entityType file="CRM/Core/Form/RecurringEntity.hlp"}</td>\r
- <td>{$form.repetition_frequency_interval.html} <span id="repeats-every-text">hour(s)</span>\r
- </td>\r
+ <tr class="crm-core-form-recurringentity-block-repetition_frequency">\r
+ <td class="label">{$form.repetition_frequency_unit.label} <span class="crm-marker">*</span> {help id="id-repeats" entityType=$recurringEntityType file="CRM/Core/Form/RecurringEntity.hlp"}</td>\r
+ <td>{$form.repetition_frequency_interval.html} {$form.repetition_frequency_unit.html}</td>\r
</tr>\r
<tr class="crm-core-form-recurringentity-block-start_action_condition">\r
<td class="label">\r
- <label for="repeats_on">{$form.start_action_condition.label} {help id="id-repeats-on" entityType=$entityType file="CRM/Core/Form/RecurringEntity.hlp"}</label>\r
+ <label for="repeats_on">{$form.start_action_condition.label} {help id="id-repeats-on" entityType=$recurringEntityType file="CRM/Core/Form/RecurringEntity.hlp"}</label>\r
</td>\r
<td>\r
{$form.start_action_condition.html}\r
</td>\r
</tr>\r
<tr class="crm-core-form-recurringentity-block-repeats_by">\r
- <td class="label">{$form.repeats_by.label}</td>\r
- <td>{$form.repeats_by.1.html} {$form.limit_to.html} {help id="id-repeats-by-month" entityType=$entityType file="CRM/Core/Form/RecurringEntity.hlp"}\r
+ <td class="label">{$form.repeats_by.label} {help id="id-repeats-by-month" entityType=$recurringEntityType file="CRM/Core/Form/RecurringEntity.hlp"}</td>\r
+ <td>{$form.repeats_by.1.html} {$form.limit_to.html}\r
</td>\r
</tr>\r
<tr class="crm-core-form-recurringentity-block-repeats_by">\r
- <td class="label">{help id="id-repeats-by-week" entityType=$entityType file="CRM/Core/Form/RecurringEntity.hlp"}</td>\r
+ <td class="label">{help id="id-repeats-by-week" entityType=$recurringEntityType file="CRM/Core/Form/RecurringEntity.hlp"}</td>\r
<td>{$form.repeats_by.2.html} {$form.entity_status_1.html} {$form.entity_status_2.html}\r
</td>\r
</tr>\r
<tr class="crm-core-form-recurringentity-block-ends">\r
- <td class="label">{$form.ends.label} <span class="crm-marker" title="This field is required.">*</span> {help id="id-ends-after" entityType=$entityType file="CRM/Core/Form/RecurringEntity.hlp"}</td>\r
- <td>{$form.ends.1.html} {$form.start_action_offset.html} occurrences </td>\r
+ <td class="label">{$form.ends.label} <span class="crm-marker" title="This field is required.">*</span> {help id="id-ends-after" entityType=$recurringEntityType file="CRM/Core/Form/RecurringEntity.hlp"}</td>\r
+ <td>{$form.ends.1.html} {$form.start_action_offset.html} {ts}occurrences{/ts}</td>\r
</tr>\r
<tr class="crm-core-form-recurringentity-block-absolute_date">\r
- <td class="label"> {help id="id-ends-on" entityType=$entityType file="CRM/Core/Form/RecurringEntity.hlp"}</td>\r
+ <td class="label"> {help id="id-ends-on" entityType=$recurringEntityType file="CRM/Core/Form/RecurringEntity.hlp"}</td>\r
<td>{$form.ends.2.html} {include file="CRM/common/jcalendar.tpl" elementName=repeat_absolute_date}\r
</td>\r
</tr>\r
<tr class="crm-core-form-recurringentity-block-exclude_date">\r
- <td class="label">{$form.exclude_date_list.label} {help id="id-exclude-date" entityType=$entityType file="CRM/Core/Form/RecurringEntity.hlp"}</td>\r
+ <td class="label">{$form.exclude_date_list.label} {help id="id-exclude-date" entityType=$recurringEntityType file="CRM/Core/Form/RecurringEntity.hlp"}</td>\r
<td>{$form.exclude_date_list.html}</td>\r
</tr>\r
</table>\r
$('.crm-core-form-recurringentity-block-repeats_by td').hide();\r
break;\r
}\r
- $("#repeats-every-text").html($('#repetition_frequency_unit').val()+'(s)');\r
\r
/***********On Load Set Ends Value (Edit Mode) **********/\r
switch ($('input:radio[name=ends]:checked').val()) {\r
$('#repetition_frequency_unit').change(function () {\r
switch ($(this).val()) {\r
case 'hour':\r
- $('#repeats-every-text').html($(this).val()+'(s)');\r
$('.crm-core-form-recurringentity-block-start_action_condition').hide();\r
$('.crm-core-form-recurringentity-block-repeats_by td').hide();\r
break;\r
case 'day':\r
- $('#repeats-every-text').html($(this).val()+'(s)');\r
$('.crm-core-form-recurringentity-block-start_action_condition').hide();\r
$('.crm-core-form-recurringentity-block-repeats_by td').hide();\r
break;\r
case 'week':\r
- $('#repeats-every-text').html($(this).val()+'(s)');\r
//Show "Repeats On" block when week is selected\r
$('.crm-core-form-recurringentity-block-start_action_condition').show();\r
$('.crm-core-form-recurringentity-block-repeats_by td').hide();\r
break;\r
case 'month':\r
- $('#repeats-every-text').html($(this).val()+'(s)');\r
$('.crm-core-form-recurringentity-block-start_action_condition').hide();\r
//Show "Repeats By" block when month is selected\r
$('.crm-core-form-recurringentity-block-repeats_by td').show();\r
break;\r
case 'year':\r
- $('#repeats-every-text').html($(this).val()+'(s)');\r
$('.crm-core-form-recurringentity-block-start_action_condition').hide();\r
$('.crm-core-form-recurringentity-block-repeats_by td').hide();\r
break;\r
+--------------------------------------------------------------------+\r
*}\r
{if $hasParent || $isRepeatingEntity || $scheduleReminderId}\r
+ {capture assign='entity_type'}{$recurringEntityType|lower}{/capture}\r
<script type="text/template" id="recurring-dialog-tpl">\r
- <div class="crm-form-block recurring-dialog">\r
- <h4>{ts}How would you like this change to affect other entities in the repetition set?{/ts}</h4>\r
- <div class="crm-block">\r
+ <div class="recurring-dialog">\r
+ <h4>{ts}How should this change affect others in the series?{/ts}</h4>\r
+ <div>\r
<input type="radio" id="recur-only-this-entity" name="recur_mode" value="1">\r
- <label for="recur-only-this-entity">{ts}Only this entity{/ts}</label>\r
- <div class="description">{ts}All other entities in the series will remain unchanged.{/ts}</div>\r
+ <label for="recur-only-this-entity">{ts 1=$entity_type}Only this %1{/ts}</label>\r
+ <div class="description">{ts}All others in the series will remain unchanged.{/ts}</div>\r
\r
<input type="radio" id="recur-this-and-all-following-entity" name="recur_mode" value="2">\r
- <label for="recur-this-and-all-following-entity">{ts}This and Following entities{/ts}</label>\r
- <div class="description">{ts}Change applies to this and all the following entities.{/ts}</div>\r
+ <label for="recur-this-and-all-following-entity">{ts 1=$entity_type}This %1 onwards{/ts}</label>\r
+ <div class="description">{ts 1=$entity_type}Change applies to this %1 and all that come after it.{/ts}</div>\r
\r
<input type="radio" id="recur-all-entity" name="recur_mode" value="3">\r
- <label for="recur-all-entity">{ts}All the entities{/ts}</label>\r
- <div class="description">{ts}Change applies to all the entities in the series.{/ts}</div>\r
+ <label for="recur-all-entity">{ts 1=$entity_type}Every %1{/ts}</label>\r
+ <div class="description">{ts 1=$entity_type}Change applies to every %1 in the series.{/ts}</div>\r
</div>\r
- <div class="status help"><div class="icon ui-icon-lightbulb"></div>{ts}Changes to date or time will NOT be applied to other entities in the series.{/ts}</div>\r
+ <div class="status help"><div class="icon ui-icon-lightbulb"></div>{ts}Changes to date or time will <em>not</em> be applied to others in the series.{/ts}</div>\r
</div>\r
</script>\r
{literal}\r
\r
function cascadeChangesDialog() {\r
CRM.confirm({\r
+ title: "{/literal}{ts escape='js' 1=$entity_type}Update recurring %1{/ts}{literal}",\r
message: $('#recurring-dialog-tpl').html()\r
})\r
.on('crmConfirm:yes', updateMode)\r
if (result.status != "" && result.status == 'Done') {\r
$form.submit();\r
} else if (result.status != "" && result.status == 'Error') {\r
- if (confirm(ts("Mode could not be updated, save only this event?"))) {\r
+ if (confirm("{/literal}{ts escape='js' 1=$entity_type}Mode could not be updated, save only this %1?{/ts}{literal}")) {\r
$form.submit();\r
}\r
}\r
<div class="crm-block crm-form-block crm-event-manage-repeat-form-block">
{include file="CRM/Core/Form/RecurringEntity.tpl"}
{if $rows}
-<div id="event_status_id" class="crm-block crm-manage-events crm-accordion-wrapper">
+<div class="crm-block crm-manage-events crm-accordion-wrapper">
<div class="crm-accordion-header">{ts}Connected Repeating Events{/ts}</div>
<div class="crm-accordion-body">
{strip}
{else}
{assign var="highlight" value=""}
{/if}
- <tr id="row_{$row.id}" class="{if NOT $row.is_active} disabled{/if}">
+ <tr class="row_{$row.id}{if NOT $row.is_active} disabled{/if}">
<td class="crm-event_{$row.id}{$highlight}">
<a href="{crmURL p='civicrm/event/info' q="id=`$row.id`&reset=1"}"
title="{ts}View event info page{/ts}" class="bold">{$row.title}</a> ({ts}ID:{/ts} {$row.id})
{if $row.is_active eq 1}{ts}Yes{/ts} {else} {ts}No{/ts} {/if}
</td>
<td class="{$highlight}">
- <a href="{crmURL p="civicrm/event/manage/settings" q="reset=1&action=update&id=`$row.id`"}">Manage Event</a>
+ <a class="action-item no-popup crm-hover-button" href="{crmURL p="civicrm/event/manage/settings" q="reset=1&action=update&id=`$row.id`"}">{ts}Settings{/ts}</a>
</td>
<td class="crm-event-start_date hiddenElement">{$row.start_date|crmDate}</td>
<td class="crm-event-end_date hiddenElement">{$row.end_date|crmDate}</td>
{/if}
{/foreach}
</table>
- {include file="CRM/common/pager.tpl" location="bottom"}
{/strip}
</div>
</div>