24 include_once
'./Services/Calendar/classes/class.ilCalendarUserSettings.php';
25 include_once
'./Services/Calendar/classes/iCal/class.ilICalWriter.php';
26 include_once
'./Services/Calendar/classes/class.ilCalendarCategory.php';
27 include_once
'./Services/Calendar/classes/class.ilCalendarEntry.php';
28 include_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');
116 case self::EXPORT_CALENDARS:
120 case self::EXPORT_APPOINTMENTS:
124 $this->writer->addLine(
'END:VCALENDAR');
133 $this->writer->addLine(
'X-WR-TIMEZONE:' .
$GLOBALS[
'DIC'][
'ilUser']->getTimeZone());
135 include_once
'./Services/Calendar/classes/class.ilCalendarUtil.php';
137 if (!is_file($tzid_file)) {
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()) {
190 if (!$app->getStart() instanceof
ilDateTime) {
191 $this->logger->notice(
'Cannot create appointment for app_id: ' . $app->getEntryId());
195 $this->writer->addLine(
'BEGIN:VEVENT');
201 $app->getEntryId() .
'_' . CLIENT_ID .
'@' . ILIAS_HTTP_PATH
206 #$last_mod = $app->getLastUpdate()->get(IL_CAL_FKT_DATE,'Ymd\THis\Z',$ilUser->getTimeZone()); 207 $this->writer->addLine(
'LAST-MODIFIED:' . $last_mod);
210 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrences.php';
213 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php';
216 $pStart = $app->getStart();
217 $pEnd = clone $app->getStart();
220 $recs = $calc->calculateDateList($pStart, $pEnd);
223 $startInit = $app->getStart();
224 $endInit = $app->getEnd();
225 foreach ($recs as $dt) {
227 $endInit = clone($dt);
232 $startInit = $app->getStart();
233 $endInit = $app->getEnd();
237 if ($app->isFullday()) {
245 $this->writer->addLine(
'DTSTART;VALUE=DATE:' .
$start);
246 $this->writer->addLine(
'DTEND;VALUE=DATE:' .
$end);
251 $this->writer->addLine(
'DTSTART:' .
$start);
252 $this->writer->addLine(
'DTEND:' .
$end);
256 $this->writer->addLine(
'DTSTART;TZID=' .
$ilUser->getTimezone() .
':' .
$start);
257 $this->writer->addLine(
'DTEND;TZID=' .
$ilUser->getTimezone() .
':' .
$end);
265 if (strlen($app->getDescription())) {
268 if (strlen($app->getLocation())) {
275 $this->writer->addLine(
'END:VEVENT');
284 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrences.php';
287 $this->writer->addLine($excl->toICal());
289 $this->writer->addLine($rec->toICal(
$ilUser->getId()));
296 return $this->writer->__toString();
311 $this->writer->addLine(
'URL;VALUE=URI:' . ILIAS_HTTP_PATH);
315 include_once
'./Services/Link/classes/class.ilLink.php';
316 $this->writer->addLine(
static _getRecurrences($a_cal_id)
get all recurrences of an appointment
Model for a calendar entry.
getUserSettings()
Get user settings.
const EXPORT_APPOINTMENTS
createVEVENT($app)
Create VEVENT entry ilObjUser $ilUser.
static _getInstanceByUserId($a_user_id)
get singleton instance
static _getFirstRecurrence($a_cal_id)
get first recurrence
static getZoneInfoFile($a_tz)
static _lookupCategories($a_cal_id)
lookup categories
__construct($a_calendar_ids=array())
addAppointment($a_app_id)
static _getAllReferences($a_id)
get all reference ids of object
Calculates an ilDateList for a given calendar entry and recurrence rule.
buildAppointmentUrl(ilCalendarEntry $entry)
Build url from calendar entry.
Export calendar(s) to ical format
static getInstanceByCategoryId($a_cat_id)
Get instance by category id.
static _getAssignedAppointments($a_cat_id)
Get assigned apointments.
setCalendarIds($a_cal_ids)
static getExclusionDates($a_cal_id)
Read exclusion dates.
static escapeText($a_text)
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.