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');
117 case self::EXPORT_CALENDARS:
121 case self::EXPORT_APPOINTMENTS:
125 $this->writer->addLine(
'END:VCALENDAR');
135 $this->writer->addLine(
'X-WR-TIMEZONE:'.
$GLOBALS[
'ilUser']->getTimeZone());
137 include_once
'./Services/Calendar/classes/class.ilCalendarUtil.php';
139 if(!is_file($tzid_file))
143 $reader = fopen($tzid_file,
'r');
146 $line = str_replace(
"\n",
'', $line);
147 $this->writer->addLine($line);
153 foreach($this->calendars as $category_id)
173 if($app->isMilestone())
200 $this->logger->notice(
'Cannot create appointment for app_id: ' . $app->getEntryId());
203 $this->writer->addLine(
'BEGIN:VEVENT');
209 $app->getEntryId().
'_'.CLIENT_ID.
'@'.ILIAS_HTTP_PATH));
213 #$last_mod = $app->getLastUpdate()->get(IL_CAL_FKT_DATE,'Ymd\THis\Z',$ilUser->getTimeZone()); 214 $this->writer->addLine(
'LAST-MODIFIED:'.$last_mod);
217 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrences.php';
221 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php';
224 $pStart = $app->getStart();
225 $pEnd = clone $app->getStart();
228 $recs = $calc->calculateDateList($pStart, $pEnd);
231 $startInit = $app->getStart();
232 $endInit = $app->getEnd();
233 foreach($recs as $dt)
236 $endInit = clone($dt);
244 $startInit = $app->getStart();
245 $endInit = $app->getEnd();
249 if($app->isFullday())
253 #$app->getEnd()->increment(IL_CAL_DAY,1); 256 #$start = $app->getStart()->get(IL_CAL_FKT_DATE,'Ymd\Z',ilTimeZone::UTC); 257 #$start = $app->getStart()->get(IL_CAL_FKT_DATE,'Ymd',$ilUser->getTimeZone()); 259 #$end = $app->getEnd()->get(IL_CAL_FKT_DATE,'Ymd\Z',ilTimeZone::UTC); 260 #$end = $app->getEnd()->get(IL_CAL_FKT_DATE,'Ymd',$ilUser->getTimeZone()); 264 $this->writer->addLine(
'DTSTART;VALUE=DATE:' .
$start);
265 $this->writer->addLine(
'DTEND;VALUE=DATE:'.$end);
273 $this->writer->addLine(
'DTSTART:'.
$start);
274 $this->writer->addLine(
'DTEND:'.$end);
280 $end = $endInit->get(
IL_CAL_FKT_DATE,
'Ymd\THis',$ilUser->getTimeZone());
281 $this->writer->addLine(
'DTSTART;TZID='.$ilUser->getTimezone().
':'.
$start);
282 $this->writer->addLine(
'DTEND;TZID='.$ilUser->getTimezone().
':'.$end);
290 if(strlen($app->getDescription()))
292 if(strlen($app->getLocation()))
298 $this->writer->addLine(
'END:VEVENT');
306 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrences.php';
311 $this->writer->addLine($excl->toICal());
313 $this->writer->addLine($rec->toICal($ilUser->getId()));
320 return $this->writer->__toString();
336 $this->writer->addLine(
'URL;VALUE=URI:'.ILIAS_HTTP_PATH);
342 include_once
'./Services/Link/classes/class.ilLink.php';
343 $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="")