ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCalendarExport Class Reference

Export calendar(s) to ical format More...

+ Collaboration diagram for ilCalendarExport:

Public Member Functions

 __construct ($a_calendar_ids)
 export ()
 getExportString ()

Protected Member Functions

 addTimezone ()
 addCategories ()
 createVTODO ($app)
 createVEVENT ($app)
 createRecurrences ($app)

Protected Attributes

 $calendars = array()
 $writer = null

Detailed Description

Export calendar(s) to ical format

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 36 of file class.ilCalendarExport.php.

Constructor & Destructor Documentation

ilCalendarExport::__construct (   $a_calendar_ids)

Definition at line 41 of file class.ilCalendarExport.php.

{
$this->calendars = $a_calendar_ids;
$this->writer = new ilICalWriter();
}

Member Function Documentation

ilCalendarExport::addCategories ( )
protected

Definition at line 64 of file class.ilCalendarExport.php.

References ilCalendarCategoryAssignments\_getAssignedAppointments(), ilCalendarCategories\_getInstance(), createVEVENT(), and createVTODO().

Referenced by export().

{
foreach($this->calendars as $category_id)
{
ilCalendarCategories::_getInstance()->getSubitemCategories($category_id)
) as $app_id)
{
$app = new ilCalendarEntry($app_id);
if($app->isMilestone())
{
$this->createVTODO($app);
}
else
{
$this->createVEVENT($app);
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarExport::addTimezone ( )
protected

Definition at line 59 of file class.ilCalendarExport.php.

Referenced by export().

{
// TODO
}

+ Here is the caller graph for this function:

ilCalendarExport::createRecurrences (   $app)
protected

Definition at line 136 of file class.ilCalendarExport.php.

References ilCalendarRecurrences\_getRecurrences().

Referenced by createVEVENT().

{
include_once './Services/Calendar/classes/class.ilCalendarRecurrences.php';
foreach(ilCalendarRecurrences::_getRecurrences($app->getEntryId()) as $rec)
{
$this->writer->addLine($rec->toICal());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarExport::createVEVENT (   $app)
protected

Definition at line 91 of file class.ilCalendarExport.php.

References $start, createRecurrences(), ilICalWriter\escapeText(), and IL_CAL_FKT_DATE.

Referenced by addCategories().

{
global $ilUser;
$this->writer->addLine('BEGIN:VEVENT');
// TODO only domain
$this->writer->addLine('UID:'.ilICalWriter::escapeText(
$app->getEntryId().'_'.CLIENT_ID.'@'.ILIAS_HTTP_PATH));
#$last_mod = $app->getLastUpdate()->get(IL_CAL_FKT_DATE,'Ymd\THis\Z',ilTimeZone::UTC);
$last_mod = $app->getLastUpdate()->get(IL_CAL_FKT_DATE,'Ymd\THis\Z',$ilUser->getTimeZone());
$this->writer->addLine('LAST-MODIFIED:'.$last_mod);
if($app->isFullday())
{
#$start = $app->getStart()->get(IL_CAL_FKT_DATE,'Ymd\Z',ilTimeZone::UTC);
$start = $app->getStart()->get(IL_CAL_FKT_DATE,'Ymd',$ilUser->getTimeZone());
#$end = $app->getEnd()->get(IL_CAL_FKT_DATE,'Ymd\Z',ilTimeZone::UTC);
$end = $app->getEnd()->get(IL_CAL_FKT_DATE,'Ymd',$ilUser->getTimeZone());
}
else
{
#$start = $app->getStart()->get(IL_CAL_FKT_DATE,'Ymd\THis\Z',ilTimeZone::UTC);
$start = $app->getStart()->get(IL_CAL_FKT_DATE,'Ymd\THis',$ilUser->getTimeZone());
#$end = $app->getEnd()->get(IL_CAL_FKT_DATE,'Ymd\THis\Z',ilTimeZone::UTC);
$end = $app->getEnd()->get(IL_CAL_FKT_DATE,'Ymd\THis',$ilUser->getTimeZone());
}
$this->writer->addLine('DTSTART:'.$start);
$this->createRecurrences($app);
$this->writer->addLine('DTEND:'.$end);
$this->writer->addLine('SUMMARY:'.ilICalWriter::escapeText($app->getPresentationTitle()));
if(strlen($app->getDescription()))
$this->writer->addLine('DESCRIPTION:'.ilICalWriter::escapeText($app->getDescription()));
if(strlen($app->getLocation()))
$this->writer->addLine('LOCATION:'.ilICalWriter::escapeText($app->getLocation()));
// TODO: URL
$this->writer->addLine('URL:'.ILIAS_HTTP_PATH);
$this->writer->addLine('END:VEVENT');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarExport::createVTODO (   $app)
protected

Definition at line 85 of file class.ilCalendarExport.php.

Referenced by addCategories().

{
// TODO
return true;
}

+ Here is the caller graph for this function:

ilCalendarExport::export ( )

Definition at line 47 of file class.ilCalendarExport.php.

References addCategories(), and addTimezone().

Referenced by ilCalendarRemoteAccessHandler\handleRequest().

{
$this->writer->addLine('BEGIN:VCALENDAR');
$this->writer->addLine('PRODID:-//ilias.de/NONSGML ILIAS Calendar V4.0//EN');
$this->writer->addLine('VERSION:2.0');
$this->addTimezone();
$this->addCategories();
$this->writer->addLine('END:VCALENDAR');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarExport::getExportString ( )

Definition at line 146 of file class.ilCalendarExport.php.

{
return $this->writer->__toString();
}

Field Documentation

ilCalendarExport::$calendars = array()
protected

Definition at line 38 of file class.ilCalendarExport.php.

ilCalendarExport::$writer = null
protected

Definition at line 39 of file class.ilCalendarExport.php.


The documentation for this class was generated from the following file: