From 83f3c8a3a554055bc019f8253b4454839e9789e7 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 2 Mar 2015 21:57:59 -0500 Subject: [PATCH] CRM-15932 - Additional QA fixes --- CRM/Activity/Form/Activity.php | 6 +++++- templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CRM/Activity/Form/Activity.php b/CRM/Activity/Form/Activity.php index 14db8696de..facd92491d 100644 --- a/CRM/Activity/Form/Activity.php +++ b/CRM/Activity/Form/Activity.php @@ -961,7 +961,6 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { // 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) { @@ -978,6 +977,11 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { } $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( diff --git a/templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl b/templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl index 9f43bdaddd..aeeedba5bd 100644 --- a/templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl +++ b/templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl @@ -71,7 +71,9 @@ .parent().find('button[data-op=yes]').prop('disabled', true) } - $('#crm-main-content-wrapper').on('click', '.crm-form-submit.validate', function(e) { + // Intercept form submissions and check if they will impact the recurring entity + // This ought to attach the handler to the the dialog if we're in a popup, or the page wrapper if we're not + $('#recurring-dialog-tpl').closest('.crm-container').on('click', '.crm-form-submit.validate', function(e) { $form = $(this).closest('form'); var className = ($form.attr('class') || '').match(/CRM_\S*/); formClass = className && className[0]; -- 2.25.1