// set params for repeat configuration in create mode
$params['entity_id'] = $activityId;
$params['entity_table'] = 'civicrm_activity';
- $scheduleReminderDetails = array();
if (!empty($params['entity_id']) && !empty($params['entity_table'])) {
$checkParentExistsForThisId = CRM_Core_BAO_RecurringEntity::getParentFor($params['entity_id'], $params['entity_table']);
if ($checkParentExistsForThisId) {
}
$params['dateColumns'] = array('activity_date_time');
+ // Set default repetition start if it was not provided.
+ if (empty($params['repetition_start_date'])) {
+ $params['repetition_start_date'] = $params['activity_date_time'];
+ }
+
// unset activity id
unset($params['id']);
$linkedEntities = array(
.parent().find('button[data-op=yes]').prop('disabled', true)\r
}\r
\r
- $('#crm-main-content-wrapper').on('click', '.crm-form-submit.validate', function(e) {\r
+ // Intercept form submissions and check if they will impact the recurring entity\r
+ // This ought to attach the handler to the the dialog if we're in a popup, or the page wrapper if we're not\r
+ $('#recurring-dialog-tpl').closest('.crm-container').on('click', '.crm-form-submit.validate', function(e) {\r
$form = $(this).closest('form');\r
var className = ($form.attr('class') || '').match(/CRM_\S*/);\r
formClass = className && className[0];\r