Add time to repetition start date
authorunknown <priyanka.karan26@gmail.com>
Sun, 7 Sep 2014 22:34:04 +0000 (23:34 +0100)
committerdeepak-srivastava <deepak.srivastava.0303@gmail.com>
Fri, 3 Oct 2014 08:55:16 +0000 (09:55 +0100)
CRM/Core/BAO/RecurringEntity.php
CRM/Core/Form/RecurringEntity.php
CRM/Event/Form/ManageEvent/Repeat.php

index 4081df1674b7884d1d1493b8234b35daa1ee9fa8..328c30133478b21dbac49bc96a8cceb4bbc9778e 100644 (file)
@@ -231,8 +231,9 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
         $dbParams['entity_value'] = $formParams['parent_event_id'];
     }
     
-    if(CRM_Utils_Array::value('repetition_start_date', $formParams)){
-      $repetition_start_date = new DateTime($formParams['repetition_start_date']);
+    if(CRM_Utils_Array::value('repetition_start_date', $formParams) &&
+        CRM_Utils_Array::value('repetition_start_date_time', $formParams)){
+      $repetition_start_date = new DateTime($formParams['repetition_start_date']." ".$formParams['repetition_start_date_time']);
       $repetition_start_date->modify('+1 day');
       $dbParams['entity_status'] = CRM_Utils_Date::processDate($repetition_start_date->format('Y-m-d H:i:s'));
     }
index cf60a61f55a0979a59aab5eed61165912c041705..d57e35497b1ea7befdf51fbd866d75ca26addb9b 100644 (file)
@@ -67,7 +67,7 @@ class CRM_Core_Form_RecurringEntity {
     $form->add('select', 'repetition_frequency_unit', ts('Repeats:'), $freqUnitsDisplay, TRUE);
     $numericOptions = CRM_Core_SelectValues::getNumericOptions(1, 30);
     $form->add('select', 'repetition_frequency_interval', ts('Repeats every:'), $numericOptions, TRUE, array('style' => 'width:55px;'));
-    $form->addDate('repetition_start_date', ts('Repetition Start Date'), array(), FALSE);
+    $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."&nbsp;", 0, 3));
     }
index 8fa3eb0311bcb30527758e7309ee0bd563ff21fe..1334b8efcc22c8dc1b7ff99222a569b2bef52c1f 100644 (file)
@@ -129,10 +129,10 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent {
     
     //Set Schedule Reminder Id
     $this->_scheduleReminderId = $this->_scheduleReminderDetails->id;
-    list($defaults['repetition_start_date']) = CRM_Utils_Date::setDateDefaults($this->_parentEventStartDate);
+    list($defaults['repetition_start_date'], $defaults['repetition_start_date_time']) = CRM_Utils_Date::setDateDefaults($this->_parentEventStartDate, 'activityDateTime');
     // Check if there is id for this event in Reminder table
     if($this->_scheduleReminderId){
-      list($defaults['repetition_start_date']) = CRM_Utils_Date::setDateDefaults($this->_scheduleReminderDetails->entity_status);
+      list($defaults['repetition_start_date'], $defaults['repetition_start_date_time']) = CRM_Utils_Date::setDateDefaults($this->_scheduleReminderDetails->entity_status, 'activityDateTime');
       $defaults['repetition_frequency_unit'] = $this->_scheduleReminderDetails->repetition_frequency_unit;
       $defaults['repetition_frequency_interval'] = $this->_scheduleReminderDetails->repetition_frequency_interval;
       $defaults['start_action_condition'] = array_flip(explode(",",$this->_scheduleReminderDetails->start_action_condition));