24include_once
'./Services/Calendar/classes/class.ilCalendarUserSettings.php';
25include_once
'./Services/Calendar/classes/iCal/class.ilICalWriter.php';
26include_once
'./Services/Calendar/classes/class.ilCalendarCategory.php';
27include_once
'./Services/Calendar/classes/class.ilCalendarEntry.php';
28include_once
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
57 $this->logger =
$GLOBALS[
'DIC']->logger()->cal();
60 $this->calendars = $a_calendar_ids;
83 $this->appointments = $a_apps;
93 $this->calendars = $a_cal_ids;
108 $this->writer->addLine(
'BEGIN:VCALENDAR');
109 $this->writer->addLine(
'VERSION:2.0');
110 $this->writer->addLine(
'METHOD:PUBLISH');
111 $this->writer->addLine(
'PRODID:-//ilias.de/NONSGML ILIAS Calendar V4.4//EN');
124 $this->writer->addLine(
'END:VCALENDAR');
133 $this->writer->addLine(
'X-WR-TIMEZONE:' .
$GLOBALS[
'ilUser']->getTimeZone());
135 include_once
'./Services/Calendar/classes/class.ilCalendarUtil.php';
137 if (!is_file($tzid_file)) {
140 $reader = fopen($tzid_file,
'r');
141 while ($line = fgets(
$reader)) {
142 $line = str_replace(
"\n",
'', $line);
143 $this->writer->addLine($line);
149 foreach ($this->calendars as $category_id) {
166 if ($app->isMilestone()) {
188 if (!$app->getStart() instanceof
ilDateTime) {
189 $this->logger->notice(
'Cannot create appointment for app_id: ' . $app->getEntryId());
192 $this->writer->addLine(
'BEGIN:VEVENT');
198 $app->getEntryId() .
'_' . CLIENT_ID .
'@' . ILIAS_HTTP_PATH
203 #$last_mod = $app->getLastUpdate()->get(IL_CAL_FKT_DATE,'Ymd\THis\Z',$ilUser->getTimeZone());
204 $this->writer->addLine(
'LAST-MODIFIED:' . $last_mod);
207 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrences.php';
210 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php';
213 $pStart = $app->getStart();
214 $pEnd = clone $app->getStart();
217 $recs = $calc->calculateDateList($pStart, $pEnd);
220 $startInit = $app->getStart();
221 $endInit = $app->getEnd();
222 foreach ($recs as $dt) {
224 $endInit = clone($dt);
229 $startInit = $app->getStart();
230 $endInit = $app->getEnd();
234 if ($app->isFullday()) {
242 $this->writer->addLine(
'DTSTART;VALUE=DATE:' . $start);
243 $this->writer->addLine(
'DTEND;VALUE=DATE:' .
$end);
248 $this->writer->addLine(
'DTSTART:' . $start);
249 $this->writer->addLine(
'DTEND:' .
$end);
253 $this->writer->addLine(
'DTSTART;TZID=' .
$ilUser->getTimezone() .
':' . $start);
254 $this->writer->addLine(
'DTEND;TZID=' .
$ilUser->getTimezone() .
':' .
$end);
262 if (strlen($app->getDescription())) {
265 if (strlen($app->getLocation())) {
272 $this->writer->addLine(
'END:VEVENT');
279 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrences.php';
282 $this->writer->addLine($excl->toICal());
284 $this->writer->addLine($rec->toICal(
$ilUser->getId()));
291 return $this->writer->__toString();
306 $this->writer->addLine(
'URL;VALUE=URI:' . ILIAS_HTTP_PATH);
310 include_once
'./Services/Link/classes/class.ilLink.php';
311 $this->writer->addLine(
An exception for terminatinating execution or to throw for unit testing.
static _getAssignedAppointments($a_cat_id)
Get assigned apointments.
static _lookupCategories($a_cal_id)
lookup categories
static getInstanceByCategoryId($a_cat_id)
Get instance by category id.
Model for a calendar entry.
@classDescription Export calendar(s) to ical format
setCalendarIds($a_cal_ids)
__construct($a_calendar_ids=array())
buildAppointmentUrl(ilCalendarEntry $entry)
Build url from calendar entry.
addAppointment($a_app_id)
const EXPORT_APPOINTMENTS
getUserSettings()
Get user settings.
createVEVENT($app)
Create VEVENT entry @global ilObjUser $ilUser.
Calculates an ilDateList for a given calendar entry and recurrence rule.
static getExclusionDates($a_cal_id)
Read exclusion dates.
static _getRecurrences($a_cal_id)
get all recurrences of an appointment
static _getFirstRecurrence($a_cal_id)
get first recurrence
static _getInstanceByUserId($a_user_id)
get singleton instance
static getZoneInfoFile($a_tz)
@classDescription Date and time handling
static escapeText($a_text)
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static _getAllReferences($a_id)
get all reference ids of object
$GLOBALS['loaded']
Global hash that tracks already loaded includes.