protected function createRecurrences($app) { global $ilUser; include_once './Services/Calendar/classes/class.ilCalendarRecurrences.php'; foreach (ilCalendarRecurrences::_getRecurrences($app->getEntryId()) as $rec) { foreach (ilCalendarRecurrenceExclusions::getExclusionDates($app->getEntryId()) as $excl) { $this->writer->addLine($excl->toICal()); } $this->writer->addLine($rec->toICal($ilUser->getId())); } }
/** * Read entry * * @access private * */ private function read() { global $ilDB; $query = "SELECT * FROM cal_recurrence_rules " . "WHERE rule_id = " . $this->db->quote($this->recurrence_id, 'integer') . " "; $res = $this->db->query($query); while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $this->cal_id = $row->cal_id; $this->recurrence_type = $row->cal_recurrence; $this->freq_type = $row->freq_type; if ($row->freq_until_date != null) { $this->freq_until_date = new ilDateTime($row->freq_until_date, IL_CAL_DATETIME, 'UTC'); } $this->freq_until_count = $row->freq_until_count; $this->interval = $row->intervall; $this->byday = $row->byday; $this->byweekno = $row->byweekno; $this->bymonth = $row->bymonth; $this->bymonthday = $row->bymonthday; $this->byyearday = $row->byyearday; $this->bysetpos = $row->bysetpos; $this->weekstart = $row->week_start; } $this->exclusion_dates = ilCalendarRecurrenceExclusions::getExclusionDates($this->cal_id); }