CRM-15932 - Additional QA fixes
authorColeman Watts <coleman@civicrm.org>
Tue, 3 Mar 2015 02:57:59 +0000 (21:57 -0500)
committerColeman Watts <coleman@civicrm.org>
Tue, 3 Mar 2015 02:57:59 +0000 (21:57 -0500)
CRM/Activity/Form/Activity.php
templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl

index 14db8696de41780b640908555016d581a4332c86..facd92491db6b9ef7a9efb5ecea087b889ba0170 100644 (file)
@@ -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(
index 9f43bdadddefd387644aa2641bd35b5f8ccc4c20..aeeedba5bdcc14dd5ac1b00f1a9e8f45b621d7bc 100644 (file)
@@ -71,7 +71,9 @@
           .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