Commit fbdee7b7 authored by unknown's avatar unknown

postprocess maintain standards for Recursion engine

parent 6266861e
......@@ -950,7 +950,8 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
// save activity
$activity = $this->processActivity($params);
$params['parent_entity_start_date'] = $this->_parentActivityStartDate;
$params['start_date_column_name'] = 'activity_date_time';
$params['dateColumns'] = array('activity_date_time');
$params['excludeDateRangeColumns'] = array('activity_date_time');
$params['entity_table'] = 'civicrm_activity';
//Unset activity id
unset($params['id']);
......
......@@ -250,7 +250,7 @@ class CRM_Core_Form_RecurringEntity {
$entityStartDate = CRM_Utils_Date::processDate($values['repetition_start_date']);
$end = CRM_Utils_Date::processDate($values['repeat_absolute_date']);
if (($end < $entityStartDate) && ($end != 0)) {
$errors['repeat_absolute_date'] = ts('End date should be after event\'s start date');
$errors['repeat_absolute_date'] = ts('End date should be after current entity\'s start date');
}
}
else {
......@@ -407,28 +407,14 @@ class CRM_Core_Form_RecurringEntity {
}
$recursion = new CRM_Core_BAO_RecurringEntity();
if (CRM_Utils_Array::value('start_date_column_name', $params)) {
$recursion->dateColumns = array($params['start_date_column_name']);
}
$recursion->dateColumns = $params['dateColumns'];
$recursion->scheduleId = $actionScheduleObj->id;
if (!empty($excludeDateList)) {
$recursion->excludeDates = $excludeDateList;
$excludeDateRangeColumns = array();
if (CRM_Utils_Array::value('start_date_column_name', $params)) {
$excludeDateRangeColumns[] = $params['start_date_column_name'];
}
if (CRM_Utils_Array::value('end_date_column_name', $params)) {
$excludeDateRangeColumns[] = $params['end_date_column_name'];
}
$recursion->excludeDateRangeColumns = $excludeDateRangeColumns;
$recursion->excludeDateRangeColumns = $params['excludeDateRangeColumns'];
}
if ($params['parent_entity_end_date']) {
$interval = $recursion->getInterval($params['parent_entity_start_date'], $params['parent_entity_end_date']);
$recursion->intervalDateColumns = array('end_date' => $interval);
}
$recursion->intervalDateColumns = $params['intervalDateColumns'];
$recursion->entity_id = $params['entity_id'];
$recursion->entity_table = $params['entity_table'];
if (!empty($linkedEntities)) {
......@@ -450,7 +436,7 @@ class CRM_Core_Form_RecurringEntity {
* @access public
*/
public function getTitle() {
return ts('Repeat Event');
return ts('Repeat Entity');
}
}
......@@ -99,10 +99,12 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent {
public function postProcess() {
if ($this->_id) {
$params = $this->controller->exportValues($this->_name);
$params['parent_entity_start_date'] = $this->_parentEventStartDate;
$params['parent_entity_end_date'] = $this->_parentEventEndDate;
$params['start_date_column_name'] = 'start_date';
$params['end_date_column_name'] = 'end_date';
if ($this->_parentEventStartDate && $this->_parentEventEndDate) {
$interval = CRM_Core_BAO_RecurringEntity::getInterval($this->_parentEventStartDate, $this->_parentEventEndDate);
$params['intervalDateColumns'] = array('end_date' => $interval);
}
$params['dateColumns'] = array('start_date');
$params['excludeDateRangeColumns'] = array('start_date', 'end_date');
$params['entity_table'] = 'civicrm_event';
//Unset event id
unset($params['id']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment