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[
'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()) {
239 $start = $startInit->get(
IL_CAL_FKT_DATE,
'Ymd', $ilUser->getTimeZone());
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);
251 $start = $startInit->get(
IL_CAL_FKT_DATE,
'Ymd\THis', $ilUser->getTimeZone());
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(
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
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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.
Create styles array
The data for the language used.
static _getAssignedAppointments($a_cat_id)
Get assigned apointments.
setCalendarIds($a_cal_ids)
static getExclusionDates($a_cal_id)
Read exclusion dates.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static escapeText($a_text)
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")