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';
52 $this->calendars = $a_calendar_ids;
70 $this->export_type = $a_type;
75 $this->appointments = $a_apps;
85 $this->calendars = $a_cal_ids;
100 $this->writer->addLine(
'BEGIN:VCALENDAR');
101 $this->writer->addLine(
'VERSION:2.0');
102 $this->writer->addLine(
'METHOD:PUBLISH');
103 $this->writer->addLine(
'PRODID:-//ilias.de/NONSGML ILIAS Calendar V4.1//EN');
108 case self::EXPORT_CALENDARS:
112 case self::EXPORT_APPOINTMENTS:
116 $this->writer->addLine(
'END:VCALENDAR');
126 $this->writer->addLine(
'X-WR-TIMEZONE:'.
$GLOBALS[
'ilUser']->getTimeZone());
128 include_once
'./Services/Calendar/classes/class.ilCalendarUtil.php';
130 if(!is_file($tzid_file))
134 $reader = fopen($tzid_file,
'r');
137 $line = str_replace(
"\n",
'', $line);
138 $this->writer->addLine($line);
144 foreach($this->calendars as $category_id)
164 if($app->isMilestone())
184 $this->writer->addLine(
'BEGIN:VEVENT');
187 $app->getEntryId().
'_'.CLIENT_ID.
'@'.ILIAS_HTTP_PATH));
190 #$last_mod = $app->getLastUpdate()->get(IL_CAL_FKT_DATE,'Ymd\THis\Z',$ilUser->getTimeZone());
191 $this->writer->addLine(
'LAST-MODIFIED:'.$last_mod);
194 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrences.php';
198 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php';
201 $pStart = $app->getStart();
202 $pEnd = clone $app->getStart();
205 $recs = $calc->calculateDateList($pStart, $pEnd);
206 foreach($recs as $dt)
209 $endInit = clone($dt);
217 $startInit = $app->getStart();
218 $endInit = $app->getEnd();
222 if($app->isFullday())
226 #$app->getEnd()->increment(IL_CAL_DAY,1);
229 #$start = $app->getStart()->get(IL_CAL_FKT_DATE,'Ymd\Z',ilTimeZone::UTC);
230 #$start = $app->getStart()->get(IL_CAL_FKT_DATE,'Ymd',$ilUser->getTimeZone());
231 $start = $startInit->get(
IL_CAL_FKT_DATE,
'Ymd',$ilUser->getTimeZone());
232 #$end = $app->getEnd()->get(IL_CAL_FKT_DATE,'Ymd\Z',ilTimeZone::UTC);
233 #$end = $app->getEnd()->get(IL_CAL_FKT_DATE,'Ymd',$ilUser->getTimeZone());
237 $this->writer->addLine(
'DTSTART;VALUE=DATE:' . $start);
238 $this->writer->addLine(
'DTEND;VALUE=DATE:'.$end);
246 $this->writer->addLine(
'DTSTART:'. $start);
247 $this->writer->addLine(
'DTEND:'.$end);
252 $start = $startInit->get(
IL_CAL_FKT_DATE,
'Ymd\THis',$ilUser->getTimeZone());
253 $end = $endInit->get(
IL_CAL_FKT_DATE,
'Ymd\THis',$ilUser->getTimeZone());
254 $this->writer->addLine(
'DTSTART;TZID='.$ilUser->getTimezone().
':'. $start);
255 $this->writer->addLine(
'DTEND;TZID='.$ilUser->getTimezone().
':'.$end);
263 if(strlen($app->getDescription()))
265 if(strlen($app->getLocation()))
271 $this->writer->addLine(
'END:VEVENT');
279 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrences.php';
284 $this->writer->addLine($excl->toICal());
286 $this->writer->addLine($rec->toICal($ilUser->getId()));
293 return $this->writer->__toString();
309 $this->writer->addLine(
'URL;VALUE=URI:'.ILIAS_HTTP_PATH);
315 include_once
'./Services/Link/classes/class.ilLink.php';
316 $this->writer->addLine(