- //Set for repeat configuration in create mode
- $params['entity_id'] = $this->_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) {
- $params['parent_entity_id'] = $checkParentExistsForThisId;
- $scheduleReminderDetails = CRM_Core_BAO_RecurringEntity::getReminderDetailsByEntityId($checkParentExistsForThisId, $params['entity_table']);
- }
- else {
- $params['parent_entity_id'] = $params['entity_id'];
- $scheduleReminderDetails = CRM_Core_BAO_RecurringEntity::getReminderDetailsByEntityId($params['entity_id'], $params['entity_table']);
+ $activityIds = empty($this->_activityIds) ? array($this->_activityId) : $this->_activityIds;
+ foreach ($activityIds as $activityId) {
+ // set params for repeat configuration in create mode
+ $params['entity_id'] = $activityId;
+ $params['entity_table'] = 'civicrm_activity';
+ if (!empty($params['entity_id']) && !empty($params['entity_table'])) {
+ $checkParentExistsForThisId = CRM_Core_BAO_RecurringEntity::getParentFor($params['entity_id'], $params['entity_table']);
+ if ($checkParentExistsForThisId) {
+ $params['parent_entity_id'] = $checkParentExistsForThisId;
+ $scheduleReminderDetails = CRM_Core_BAO_RecurringEntity::getReminderDetailsByEntityId($checkParentExistsForThisId, $params['entity_table']);
+ }
+ else {
+ $params['parent_entity_id'] = $params['entity_id'];
+ $scheduleReminderDetails = CRM_Core_BAO_RecurringEntity::getReminderDetailsByEntityId($params['entity_id'], $params['entity_table']);
+ }
+ if (property_exists($scheduleReminderDetails, 'id')) {
+ $params['schedule_reminder_id'] = $scheduleReminderDetails->id;
+ }