From: unknown Date: Sun, 7 Sep 2014 22:34:04 +0000 (+0100) Subject: Add time to repetition start date X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=66f66040307ad62cf53fac3c8657a91938247c32;p=civicrm-core.git Add time to repetition start date --- diff --git a/CRM/Core/BAO/RecurringEntity.php b/CRM/Core/BAO/RecurringEntity.php index 4081df1674..328c301334 100644 --- a/CRM/Core/BAO/RecurringEntity.php +++ b/CRM/Core/BAO/RecurringEntity.php @@ -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')); } diff --git a/CRM/Core/Form/RecurringEntity.php b/CRM/Core/Form/RecurringEntity.php index cf60a61f55..d57e35497b 100644 --- a/CRM/Core/Form/RecurringEntity.php +++ b/CRM/Core/Form/RecurringEntity.php @@ -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." ", 0, 3)); } diff --git a/CRM/Event/Form/ManageEvent/Repeat.php b/CRM/Event/Form/ManageEvent/Repeat.php index 8fa3eb0311..1334b8efcc 100644 --- a/CRM/Event/Form/ManageEvent/Repeat.php +++ b/CRM/Event/Form/ManageEvent/Repeat.php @@ -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));