/** * Saves recurring records if needed. Flushes existing recurrences if needed. */ protected function processRecurring(Meeting $focus) { require_once "modules/Calendar/CalendarUtils.php"; if (!empty($_REQUEST['edit_all_recurrences'])) { // flush existing recurrence CalendarUtils::markRepeatDeleted($focus); } if (count($this->repeatDataArray) > 0) { // prevent sending invites for recurring activities unset($_REQUEST['send_invites'], $_POST['send_invites']); $this->recurringCreated = CalendarUtils::saveRecurring($focus, $this->repeatDataArray); } }
/** * @param SugarBean $parentBean * @param array $repeatDateTimeArray * @return array events saved */ protected function saveRecurring(SugarBean $parentBean, array $repeatDateTimeArray) { // Load the user relationship so the child events that are created will // have the users added via bean->save (which has special auto-accept // logic) if ($parentBean->load_relationship('users')) { $parentBean->users_arr = $parentBean->users->get(); } return CalendarUtils::saveRecurring($parentBean, $repeatDateTimeArray); }