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.4//EN');
109 case self::EXPORT_CALENDARS:
113 case self::EXPORT_APPOINTMENTS:
117 $this->writer->addLine(
'END:VCALENDAR');
127 $this->writer->addLine(
'X-WR-TIMEZONE:'.
$GLOBALS[
'ilUser']->getTimeZone());
129 include_once
'./Services/Calendar/classes/class.ilCalendarUtil.php';
131 if(!is_file($tzid_file))
135 $reader = fopen($tzid_file,
'r');
138 $line = str_replace(
"\n",
'', $line);
139 $this->writer->addLine($line);
145 foreach($this->calendars as $category_id)
165 if($app->isMilestone())
185 $this->writer->addLine(
'BEGIN:VEVENT');
188 $app->getEntryId().
'_'.CLIENT_ID.
'@'.ILIAS_HTTP_PATH));
191 #$last_mod = $app->getLastUpdate()->get(IL_CAL_FKT_DATE,'Ymd\THis\Z',$ilUser->getTimeZone()); 192 $this->writer->addLine(
'LAST-MODIFIED:'.$last_mod);
195 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrences.php';
199 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php';
202 $pStart = $app->getStart();
203 $pEnd = clone $app->getStart();
206 $recs = $calc->calculateDateList($pStart, $pEnd);
209 $startInit = $app->getStart();
210 $endInit = $app->getEnd();
211 foreach($recs as $dt)
214 $endInit = clone($dt);
222 $startInit = $app->getStart();
223 $endInit = $app->getEnd();
227 if($app->isFullday())
231 #$app->getEnd()->increment(IL_CAL_DAY,1); 234 #$start = $app->getStart()->get(IL_CAL_FKT_DATE,'Ymd\Z',ilTimeZone::UTC); 235 #$start = $app->getStart()->get(IL_CAL_FKT_DATE,'Ymd',$ilUser->getTimeZone()); 236 $start = $startInit->get(
IL_CAL_FKT_DATE,
'Ymd',$ilUser->getTimeZone());
237 #$end = $app->getEnd()->get(IL_CAL_FKT_DATE,'Ymd\Z',ilTimeZone::UTC); 238 #$end = $app->getEnd()->get(IL_CAL_FKT_DATE,'Ymd',$ilUser->getTimeZone()); 242 $this->writer->addLine(
'DTSTART;VALUE=DATE:' . $start);
243 $this->writer->addLine(
'DTEND;VALUE=DATE:'.$end);
251 $this->writer->addLine(
'DTSTART:'. $start);
252 $this->writer->addLine(
'DTEND:'.$end);
257 $start = $startInit->get(
IL_CAL_FKT_DATE,
'Ymd\THis',$ilUser->getTimeZone());
258 $end = $endInit->get(
IL_CAL_FKT_DATE,
'Ymd\THis',$ilUser->getTimeZone());
259 $this->writer->addLine(
'DTSTART;TZID='.$ilUser->getTimezone().
':'. $start);
260 $this->writer->addLine(
'DTEND;TZID='.$ilUser->getTimezone().
':'.$end);
268 if(strlen($app->getDescription()))
270 if(strlen($app->getLocation()))
276 $this->writer->addLine(
'END:VEVENT');
284 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrences.php';
289 $this->writer->addLine($excl->toICal());
291 $this->writer->addLine($rec->toICal($ilUser->getId()));
298 return $this->writer->__toString();
314 $this->writer->addLine(
'URL;VALUE=URI:'.ILIAS_HTTP_PATH);
320 include_once
'./Services/Link/classes/class.ilLink.php';
321 $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
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="")