iCalcreator 2.4.3

iCalcreator class v2.4.3
copyright (c) 2007-2008 Kjell-Inge Gustafsson, kigkonsult
www.kigkonsult.se/iCalcreator
ical@kigkonsult.se

Description:

iCalcreator is a PHP implementation of RFC2445/RFC2446 to manage iCal/xCal formatted files.

1. INTRO

iCalcreator is a PHP class managing iCal formatted files for non-calendar systems like CMS, project management systems and other applications able to process calendar information like agendas, tasks, reports, totos, journaling data and for communication with calendar systems and applications.

iCalcreator features create, parse, edit and select calendar and calendar components.

iCalcreator is built of a single class file with a simple interface and are calendar component property oriented. Development environment is PHP version 5.x but coding is done to meet 4.x backward compability.

Ical

A short iCal description is found at Wikipedia. If You are not familiar with iCal, read this first!
Knowledge of calendar protocol rfc2445/rfc2446 is to recommend;
rfc2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar)
rfc2446 - iCalendar Transport-Independent Interoperability Protocol (iTIP) Scheduling Events, BusyTime, To-dos and Journal Entries
All functions calls are made as simple as possible BUT (, !!!,) read these rfc's properly!

Get RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) at text and HTML format, RFC2446 - iCalendar Transport-Independent Interoperability Protocol (iTIP) Scheduling Events, BusyTime, To-dos and Journal Entries in text format.

xCal (iCal xml) output format is supported but still experimental.

Addendum

Download iCalcreator coding samples.
Examples how to employ iCalcreator in software development:
The iCal file event editor
Create complex iCal file on-the-fly

There are free iCal/xCal icons in the images directory, to use as buttons on a webpage.

In this manual

this font and background is used for PHP format and coding examples

// this font is used for format/example details and comments

The command coding examples are only examples, recommendation is to use a coding standard, the following, incomplete, list is a good start; http://www.dagbladet.no/development/phpcodingstandard/ http://ez.no/ezpublish/documentation/development/standards/php http://framework.zend.com/manual/en/coding-standard.html http://gforge.org/docman/view.php/1/2/coding-standards.html http://pear.php.net/manual/en/standards.php

1.1 INDEX

1. INTRO
1.1 INDEX
1.2 INSTALL

2. Calendar Component list
2.1 VCALENDAR
2.2 VEVENT
2.3 VTODO
2.4 VJOURNAL
2.5 VFREEBUSY
2.6 VALARM
2.7 VTIMEZONE

3. Function list
3.1 Calendar object functions
3.1.1 Calendar object constructors
3.1.1.1 vevent
3.1.1.2 vtodo
3.1.1.3 vjournal
3.1.1.4 vfreebusy
3.1.1.5 valarm
3.1.1.6 vtimezone

3.1.2 Calendar property functions
3.1.2.1 deleteProperty
3.1.2.2 getProperty
3.1.2.3 setProperty
3.1.2.4 CALSCALE
3.1.2.5 METHOD
3.1.2.6 VERSION
3.1.2.7 X-PROPERTY

3.1.3 Calendar component functions
3.1.3.1 deleteComponent
3.1.3.2 getComponent
3.1.3.3 selectComponents
3.1.3.4 setComponent

3.1.4 Calendar input/output functions
3.1.4.1 parse and merge
3.1.4.2 createCalendar
3.1.4.3 returnCalendar
3.1.4.4 saveCalendar
3.1.4.5 sort
3.1.4.6 useCachedCalendar

3.1.5 Calendar configuration functions
3.1.5.1 Allow empty components
3.1.5.2 Component information
3.1.5.3 Delimiter
3.1.5.4 Directory
3.1.5.5 Fileinfo
3.1.5.6 Filename
3.1.5.7 Filesize
3.1.5.8 Format
3.1.5.9 Language
3.1.5.10 NewlineChar
3.1.5.11 Unique_id
3.1.5.12 URL

3.1.6 Calendar misc. functions
3.1.6.1 validDate


3.2 Calendar component/object property function list
3.2.1 deleteProperty
3.2.2 getProperty
3.2.3 parse
3.2.4 setProperty
3.2.5 ACTION
3.2.6 ATTACH
3.2.7 ATTENDEE
3.2.8 CATEGORIES
3.2.9 CLASS
3.2.10 COMMENT
3.2.11 COMPLETED
3.2.12 CONTACT
3.2.13 CREATED
3.2.14 DESCRIPTION
3.2.15 DTEND
3.2.16 DTSTAMP
3.2.17 DTSTART
3.2.18 DUE
3.2.19 DURATION
3.2.20 EXDATE
3.2.22 EXRULE
3.2.22 FREEBUSY
3.2.23 GEO
3.2.24 LAST-MODIFIED
3.2.25 LOCATION
3.2.26 ORGANIZER
3.2.27 PERCENTCOMPLETE
3.2.28 PRIORITY
3.2.29 RDATE
3.2.30 RECURRENCE-ID
3.2.31 RELATED-TO
3.2.32 REPEAT
3.2.33 REQUEST-STATUS
3.2.34 RESOURCES
3.2.35 RRULE
3.2.36 SEQUENCE
3.2.37 STATUS
3.2.38 SUMMARY
3.2.39 TRANSP
3.2.40 TRIGGER
3.2.41 TZID
3.2.42 TZNAME
3.2.43 TZOFFSETFROM
3.2.44 TZOFFSETTO
3.2.45 TZURL
3.2.46 UID
3.2.47 URL
3.2.48 X-PROPERTY

3.3 Calendar Component configuration functions
3.3.1 Language

3.4 Calendar component object misc. functions
3.4.1 deleteComponent
3.4.2 getComponent
3.4.3 setComponent

4. COPYRIGHT AND LICENSE

[index]

1.2 INSTALL

Unpack to any folder
- add this folder to your include-path
- or unpack to your application-(include)-folder
Add "require_once [folder/]iCalcreator.class.php;" to your php-script.

If using phpversion 5.x, the default timezone need to be set/altered, now "Europe/Stockholm", line 47 in the class file.

When creating a new calendar object, review config settings.

[index]

2. Calendar Component list

Quote from rfc2445! (Described in iCal output format, content corresponds to xCal format.)

2.1 VCALENDAR

icalobject = 1*("BEGIN" ":" "VCALENDAR" CRLF

icalbody

"END" ":" "VCALENDAR" CRLF)


icalbody = calprops component
calprops = 2*(

"prodid" and "version" are both REQUIRED, but MUST NOT occur more than once

prodid / version /

"calscale"and "method"are optional, but MUST NOT occur more than once

calscale / method /

x-prop

)

component = 1*(eventc / todoc / journalc / freebusyc / timezonec / iana-comp* / x-comp*)

iana-comp = "BEGIN" ":" iana-token CRLF

1*contentline

"END" ":" iana-token CRLF

x-comp = "BEGIN" ":" x-name CRLF

1*contentline

"END" ":" x-name CRLF

*) not supported by iCalcreator


[index]

2.2 VEVENT

"BEGIN" ":" "VEVENT" CRLF

eventprop *alarmc

"END" ":" "VEVENT" CRLF

eventprop = *(

the following are optional,but MUST NOT occur more than once

class / created / description / dtstart /

geo / last-mod / location / organizer / priority /

dtstamp / seq / status / summary /

transp / uid / url / recurid /

either "dtend" or "duration" may appear in a "eventprop",

but "dtend" and "duration" MUST NOT occur in the same "eventprop"

dtend / duration /

the following are optional, and MAY occur more than once

attach / attendee / categories / comment /

contact / exdate / exrule / rstatus /

related / resources / rdate / rrule / x-prop

)
[index]

2.3 VTODO

"BEGIN" ":" "VTODO" CRLF

todoprop *alarmc

"END" ":" "VTODO" CRLF

todoprop = *(

the following are optional, but MUST NOT occur more than once

class / completed / created / description / dtstamp / dtstart /

geo / last-mod / location / organizer / percent / priority /

recurid / seq / status / summary /uid / url /

either "due" or "duration" may appear in a "todoprop",

but "due" and "duration" MUST NOT occur in the same "todoprop"

due / duration /

the following are optional,and MAY occur more than once

attach / attendee / categories / comment /

contact / exdate / exrule / rstatus /

related / resources / rdate / rrule / x-prop

)
[index]

2.4 VJOURNAL

journalc = "BEGIN" ":" "VJOURNAL" CRLF

jourprop

"END" ":" "VJOURNAL" CRLF

jourprop = *(

the following are optional, but MUST NOT occur more than once

class / created / description / dtstart /

dtstamp / last-mod / organizer / recurid /

seq / status / summary /uid / url /

the following are optional,and MAY occur more than once

attach / attendee / categories / comment /

contact / exdate / exrule / related /

rdate / rrule / rstatus / x-prop

)
[index]

2.5 VFREEBUSY

"BEGIN" ":" "VFREEBUSY" CRLF

fbprop

"END" ":" "VFREEBUSY" CRLF

fbprop = *(

the following are optional, but MUST NOT occur more than once

contact / dtstart / dtend / duration /

dtstamp / organizer / uid / url /

the following are optional,and MAY occur more than once

attendee / comment / freebusy / rstatus / x-prop

)
[index]

2.6 VALARM

"BEGIN" ":" "VALARM" CRLF

(audioprop / dispprop / emailprop / procprop)

"END" ":" "VALARM" CRLF

audioprop = 2*(

"action" and "trigger" are both REQUIRED, but MUST NOT occur more than once

action / trigger /

"duration" and "repeat" are both optional,and MUST NOT occur more than once each,

but if one occurs, so MUST the other

duration / repeat /

the following is optional, but MUST NOT occur more than once

attach /

the following is optional, and MAY occur more than once

x-prop

)
dispprop = 3*(

the following are all REQUIRED, but MUST NOT occur more than once

action / description / trigger /

"duration" and "repeat" are both optional,and MUST NOT occur more than once each,

but if one occurs, so MUST the other

duration / repeat /

the following is optional, and MAY occur more than once

x-prop

)
emailprop = 5*(

the following are all REQUIRED, but MUST NOT occur more than once

action / description / trigger / summary

the following is REQUIRED, and MAY occur more than once

attendee /

"duration" and "repeat" are both optional, and MUST NOT occur more than once each,

but if one occurs, so MUST the other

duration / repeat /

the following are optional, and MAY occur more than once

attach / x-prop

)
procprop = 3*(

the following are all REQUIRED, but MUST NOT occur more than once

action / attach / trigger /

"duration" and "repeat" are both optional, and MUST NOT occur more than once each,

but if one occurs, so MUST the other

duration / repeat /

"description" is optional, and MUST NOT occur more than once

description /

the following is optional, and MAY occur more than once

x-prop

)
[index]

2.7 VTIMEZONE

"BEGIN" ":" "VTIMEZONE" CRLF

2*(

"tzid" is required, but MUST NOT occur more than once

tzid /

"last-mod" and "tzurl" are optional, but MUST NOT occur more than once

last-mod / tzurl /

one of "standardc" or "daylightc" MUST occur and each MAY occur more than once.

standardc / daylightc /

the following is optional, and MAY occur more than once

x-prop

)

"END" ":" "VTIMEZONE" CRLF

standardc = "BEGIN" ":" "STANDARD" CRLF

tzprop

"END" ":" "STANDARD" CRLF

daylightc = "BEGIN" ":" "DAYLIGHT" CRLF

tzprop

"END" ":" "DAYLIGHT" CRLF


tzprop = 3*(

the following are each REQUIRED, but MUST NOT occur more than once

dtstart / tzoffsetto / tzoffsetfrom /

the following are optional, and MAY occur more than once

comment /rdate / rrule / tzname / x-prop

)
[index]

3. Function list

3.1 Calendar object functions

3.1.1 Calendar object constructors

Initiate new CALENDAR.

Format

vcalendar()

Example

$calendar = new vcalendar();// initiate new CALENDAR

[index]

3.1.1.1 vevent

Initiate calendar component EVENT.

Format

vevent()

Example

$vevent = new vevent(); // initiate EVENT

[index]

3.1.1.2 vtodo

Initiate calendar component TODO.

Format

vtodo()

Example

$vtodo = new vtodo(); // initiate TODO

[index]

3.1.1.3 vjournal

Initiate calendar component JOURNAL.

Format

vjournal()

Example

$vjournal = new vjournal(); // initiate JOURNAL

[index]

3.1.1.4 vfreebusy

Initiate calendar component FREEBUSY.

Format

vfreebusy()

Example

$vfreebusy = new vfreebusy(); // initiate FREEBUSY

[index]

3.1.1.5 valarm

Initiate calendar component ALARM.

Format

valarm()

Example

$valarm = new valarm(); // initiate ALARM

[index]

3.1.1.6 vtimezone

Initiate calendar component TIMEZONE.

Format

vtimezone()

Example

$vtimezone = new vtimezone(); // initiate TIMEZONE

[index]

3.1.2 Calendar property functions

3.1.2.1 deleteProperty

General calendar deleteProperty function,simplifying calendar property delete.

Format

deleteProperty( [ string PropName [, int order=1 ] )

Propname - case independent, strict rfc2445 component property names, unknown/missing Propname will be regarded as X-property. order - if missing 1st/next occurence, used with multiply (property) occurences

FALSE is returned if no property exists or at end-of-properties with consecutive function calls.

Example 1

$v = new vcalendar(); $v->setConfig( "filename", "file.ics" ); $v->parse(); if( !$v->deleteProperty( "method" ))   echo "error when deleting property.. . .. .

[index]

3.1.2.2 getProperty

General calendar getProperty function,simplifying calendar property getting.

Format

getProperty( [ string PropName [, int order=1 [, bool complete=FALSE ]]] )

Propname - case independent, strict rfc2445 component property names, unknown/missing Propname will be regarded as X-property. order - if missing 1st/next occurence, used with multiply (property) occurences complete - FALSE (default) : output only property value - TRUE : output = array("value"=> <value> ,"params" => <parameter array>)

FALSE is returned if no property exists or at end-of-properties with consecutive function calls.

Example 1

$v = new vcalendar(); $v->setConfig( "filename", "file.ics" ); $v->parse(); $calscale = $v->getProperty( "calscale" ); .. .

Example 2

$v = new vcalendar(); $v->setConfig( "filename", "file.ics" ); $v->parse(); while( $xprop = $v->getProperty( )) { // get x-properties in order.. . .. .

[index]

3.1.2.3 setProperty

General calendar setProperty function,simplifying calendar property setting.

Format

setProperty( string PropName, mixed Proparg_1 *[, mixed Proparg_n] )

Propname case independent, strict rfc2445 calendar property names, unknown Propname will be regarded as X-property.

Example

$calendar = new vcalendar(); // initiate new CALENDAR $calendar->setProperty( "calscale", "GREGORIAN" );

[index]

3.1.2.4 CALSCALE

This property defines the calendar scale used for the calendar information specified in the iCalendar object.

The default value is "GREGORIAN", implied when missing.
Get Calscale

Format

getProperty( "calscale" )

Example

$v = new vcalendar(); $v->setConfig( "filename", "file.ics" ); $v->parse(); $calscale = $v->getProperty( "calscale" ); .. .

Set Calscale

Format

setProperty( "calscale", string value )

Example

$calendar = new vcalendar(); // initiate new CALENDAR $calendar->setProperty( "calscale", "GREGORIAN" );

[index]

3.1.2.5 METHOD

This property defines the iCalendar object method associated with the calendar object.

METHOD property (value PUBLISH etc.) may be required when importing iCal files into MS Outlook 2003, as well as (auto created) component properties DTSTAMP and UID.
Get Method

Format

getProperty( "method" );

Example

$v = new vcalendar(); $v->setConfig( "filename", "file.ics" ); $v->parse(); $method = $v->getProperty( "method" ) .. .

Set Method

Format

setProperty( "method", string value )

Example

$calendar = new vcalendar(); // initiate new CALENDAR $calendar->setProperty( "method", "PUBLISH" )

[index]

3.1.2.6 VERSION

This property specifies the identifier corresponding to the highest version number or the minimum and maximum range of the iCalendar specification that is required in order to interpret the iCalendar object.
Get Version

Format

getProperty( "version" )

Example

$v = new vcalendar(); $v->setConfig( "filename", "file.ics" ); $v->parse(); $version = $v->getProperty( "version" ) .. .

Set Version
Only version 2.0 valid, version is AUTO generated at calendar creation.

Format

setProperty( "version", string version )

Example

$calendar = new vcalendar(); // initiate new CALENDAR $calendar->setProperty( "version", "2.0" )

[index]

3.1.2.7 X-PROPERTY

Any calendar component property name with a "X-" prefix and text value. If x-prop with the same name exists, it will be replaced.
Get X-property

Format

getProperty()

output = array( propertyName1, propertyData2 )

getProperty( FALSE, int propOrderNo/FALSE, TRUE )

output = array( propertyName1 , array( "value" => propertyData2 ) , "params" => params 3))

Example 1

$v = new vcalendar(); $v->setConfig( "filename", "file.ics" ); $v->parse(); while( $xprop = $v->getProperty( )) { // read all x-props in a loop .. .

$xprop = array( propertyName1, propertyData2 )

Example 2

$v = new vcalendar(); $v->setConfig( "filename", "file.ics" ); $v->parse(); if( $xprop = $v->getProperty( "X-WR-TIMEZONE" )) { //if exists, read X-WR-TIMEZONE x-prop .. .

$xprop = array( "X-WR-TIMEZONE", propertyData2 )

Example 3

$v = new vcalendar(); $v->setConfig( "filename", "file.ics" ); $v->parse(); while( $xprop = $v->getProperty( FALSE, FALSE, TRUE )) { .. .

$xprop = array( propertyName1 , array( "value " => propertyData2 ) , "params "=> params 3 )

Set X-property

Format

setProperty( propertyName, propertyData [, params ] )

propertyName1 = Any property name with a "X-" prefix propertyData2 = Value type TEXT params 3 = array( ["LANGUAGE" => "<lang>"] [, xparam] ) xparam = *[ xparamkey => xparamvalue ]

Example

$calendar = new vcalendar(); // initiate new CALENDAR // set some X-properties.. . $calendar->setProperty( "X-WR-CALNAME", "Calendar Sample" ) $calendar->setProperty( "X-WR-CALDESC", "Calendar Description" ); $calendar->setProperty( "X-WR-TIMEZONE", "Europe/Stockholm" );


[index]

3.1.3 Calendar component functions

3.1.3.1 deleteComponent

Remove component from calendar.

format 1

Remove component with order number (1st=1, 2nd=2.. .).

deleteComponent( int orderNumber )

format 2

Remove component with component type (e.g. "vevent") and order 1 alt. suborder number.

deleteComponent( string componentType [, int componentSuborderNumber])

format 3

Remove component with UID. N.B UID is NOT set for ALARM / TIMEZONE components.

deleteComponent( string UID )

Example

$v = new vcalendar();$v->setConfig( "filename", "file.ics" ); $v->parse(); $v->deleteComponent( 1 ); $v->deleteComponent( "vtodo", 2 ); $v->deleteComponent( "20070803T194810CEST-0123U3PXiX@domain.com"); .. .

[index]

3.1.3.2 getComponent

Get component from calendar.

format 1

Get next component, until end-of-components.

getComponent()

format 2

Get component with order number (1st=1, 2nd=2.. .).

getComponent( int orderNumber )

format 3

Get (next) component with component type (until end-of-components) alt. get component with component type and suborder number (1st=1, 2nd=2.. .).

getComponent( string componentType [, int componentSuborderNumber])

format 4

Get component with UID as key. N.B UID is NOT set for ALARM / TIMEZONE components.

getComponent( string UID )

Example 1

$v = new vcalendar(); $v->setConfig( "filename", "file.ics" ); $v->parse(); while( $comp = $v->getComponent()) { .. . } .. .

Example 2

$v = new vcalendar(); $v->setConfig( "filename", "file.ics" ); $v->parse(); if( $comp = $v->getComponent( 1 )) { .. . } .. .

Example 3

$v = new vcalendar(); $v->setConfig( "filename", "file.ics" ); $v->parse(); if( $comp = $v->getComponent( "vtodo", 2 ) { .. . } .. .

Example 4

$v = new vcalendar(); $v->setConfig( "filename", "file.ics" ); $v->parse(); if($comp = $v->getComponent( "20070803T194810CEST-0123U3PXiX@domain.com"){ .. . } .. .

[index]

3.1.3.3 selectComponents

Select components from calendar on date basis (notice date restriction), based on the initial DTSTART property along with the RRULE, RDATE, EXDATE and EXRULE properties contained within the iCalendar object.

Format

selectComponents([int startYear, int startMonth, int startDay [, int endYear, int endMonth, int endDay [, mixed cType [, bool flat [, bool any [, bool split]]]]]])

Returns an array with components (events.. .). For all recurrence instances for a calendar component, an x-property, "x-current-dtstart" and opt. also "x-current-dtend" alt. "x-current-due", has been created with a TEXT content, "Y-m-d [H:i:s][timezone/GMT offset]" showing the current start and opt. also end alt. due date.

startYear : start year of date period (4*digit), default current year startMonth : start month of date period (digit / 2*digit), default current month startDay : start day of date period (digit / 2*digit), default current day endYear : end year of date period (4*digit), default startYear endMonth : end month of date period (digit / 2*digit), default startMonth endDay : end day of date period (digit / 2*digit), default StartDay cType : calendar component type(-s), default (FALSE) all else string/array type(-s) (vevent, vtodo, vjournal, vfreebusy) flat : FALSE (default) => output : array[Year][Month][Day][] TRUE => output : array[] (ignores split) any : TRUE (default) - select component that occurs within period FALSE - only components that starts (DTSTART) within period split : TRUE - (default) one component copy for every day it occurs within the period (implies flat=FALSE) FALSE - one occurance of component in output array, start date/recurrent date

Example

$v = new vcalendar(); $v->setConfig( "unique_id", "domain.com" ); $v->setConfig( "directory", "import" ); $v->setConfig( "filename", "file.ics" ); $v->parse(); $v->sort(); $events_arr = $v->selectComponents( 2007, 11, 1, 2007, 11, 30, 'vevent' ); // select all events occuring 1-30 nov. 2007 foreach( $events_arr as $year => $year_arr ) { foreach( $year_arr as $month => $month_arr ) { foreach( $month_arr as $day => $day_arr ) { foreach( $day_arr as $event ) { $currddate = $event->getProperty( 'x-current-dtstart' ); // if member of a recurrence set, // returns array('x-current-dtstart' // , <(string) date("Y-m-d [H:i:s][timezone/GMT offset]")>) $startdate = $event->getProperty( 'dtstart' ); $summary = $event->getProperty( 'summary' ); $description = $event->getProperty( 'description' ); .. .

[index]

3.1.3.4 setComponent

Add calendar component to calendar or replace/update component in calendar.

format 1

Insert last in component chain.

setComponent( component ) addComponent( component ) // alias

addComponent, may be removed i future versions.

format 2

Replace component with order number (1st=1, 2nd=2.. .). If orderNumber is not found, component is inserted last in chain.

setComponent( component, int orderNumber )

format 3

Replace component with component type and 1st alt. component order number. If orderNumber is not found, component is inserted last in chain.

setComponent( component, string componentType [, component suborder number])

format 4

Replace component with UID. N.B UID is NOT set for ALARM / TIMEZONE components. If UID is not found, component is inserted last in chain.

setComponent( component, string UID )

Example

$calendar = new vcalendar(); //initiate new CALENDAR .. . $vevent = new vevent(); //initiate EVENT $vevent->setProperty( "dtstart" //add some EVENT properties , 2006, 12, 24, 19, 30, 00 ); $vevent->setProperty(.. . .. . $calendar->setComponent( $vevent ); //add EVENT to calendar .. .

[index]

3.1.4 Calendar input/output functions

3.1.4.1 parse and merge

Parse iCal file(-s) into a single vcalendar object (components, properties and parameters), including multiple vcalendars (within a single ICS file) parse, e.g. Oracle Calendar exports.

As long as php.ini directive "allow_url_fopen" is enabled, remote files, URLs; protocol "http" ("webcal"), are supported. A remote file, URL, MUST be prefixed by "http://" ("webcal://") and suffixed by a valid filename.! Recommendation is to download (cache) remote file before parsing, due to execution time and control.

If missing, component property UID is created when parsing. For that reason UNIQUE_ID might need to be set before parsing, se examples below.

Notice date restriction!

If parse error occurs (like file access error, invalid calendar file or calendar file without components), FALSE is returned.

The php.ini directive "auto_detect_line_endings" (default OFF) will examine the data read by fgets() and file() to see if it is using Unix, MS-Dos or Macintosh line-ending conventions. This enables PHP to interoperate with Macintosh systems, but defaults to Off, as there is a very small performance penalty when detecting the EOL conventions for the first line, and also because people using carriage-returns as item separators under Unix systems would experience non-backwards-compatible behaviour. (This configuration option was introduced in PHP 4.3.0) (From php manual)

Format

parse( [ string filename ] )

Parameter for filename (including path/directory(!)), may be removed in future versions. Recommendation is to use setConfig, se example below.

parse example 1

$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); .. .

parse example 2

$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig("url", "http://www.ical.net/calendars/calendar.ics"); $vcalendar->parse(); .. .

merge example

$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "directory", "import" ); $vcalendar->setConfig( "filename",  "file1.ics" ); $vcalendar->parse(); $vcalendar->setConfig( "filename",  "file2.ics" ); $vcalendar->parse(); $vcalendar->sort(); $vcalendar->setConfig( "directory", "export" ); $vcalendar->setConfig( "filename",  "icalmerge.ics" ); $vcalendar->saveCalendar(); .. .

[index]

3.1.4.2 createCalendar

Generate and return calendar in a string, testing.. .?

Format

createCalendar()

Example

.. . $str = $calendar->createCalendar(); echo $str;

[index]

3.1.4.3 returnCalendar

Redirect calendar content to user browser. Filenamn, addressed to browser, is auto generated if missing/not set;
$filename = date( "YmdHis" ).".ics"

Format

returnCalendar()

Example 1

$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); .. . $vevent = new vevent(); $vevent->setProperty( "dtstart", array( "year" => 2007 , "month" => 4 , "day" => 1 , "hour" => 19 )); $vevent->setProperty( "duration", 0, 0, 3 )); $vevent->setProperty( "LOCATION", "Central Placa" ); $vevent->setProperty( "summary", "PHP summit" ); .. . $vcalendar->setComponent( $vevent ); .. . $vcalendar->returnCalendar();

Example 2

$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "directory", "depot" ); $vcalendar->setConfig( "filename", "calendar.ics" ); $vcalendar->parse(); $vcalendar->returnCalendar();

[index]

3.1.4.4 saveCalendar

Save ical calendar in a file, uses present directory if directory not set, filenamn is auto generated if missing/not set;
$filename = date( "YmdHis" ).".ics"
Directory/filename must be writeable, delimiter default PHP constant DIRECTORY_SEPARATOR.

As long as php.ini directive "allow_url_fopen" is enabled, remote files, URLs; protocol "http" ("webcal"), are supported. Recommendation is to save to a local file and upload later, due to execution time and control.

If file error occurs, FALSE is returned.

Format

saveCalendar ( string directory/FALSE [, string filename/FALSE [, string delimiter/FALSE ]] )

Parameters for directory/filename/delimeter, kept for backward compatibility, may be removed i future versions. Recommendation is to use setConfig, se example below.

Example

.. . $calendar->setConfig( "directory", "depot" ); $calendar->setConfig( "filename", "calendar.ics" ); $result = $calendar->saveCalendar(); if( !$result )   echo "error when saving.. ."

[index]

3.1.4.5 sort

Sort created/parsed calendar components in ascending order
Keys:
1 - DTSTART - DTEND alt. DURATION (VEVENT and VFREEBUSY components)
1 - DTSTART - DUE alt. DURATION (VTODO components)
1 - DTSTART (VJOURNAL components)
2 - CREATED / DTSTAMP
3 - UID
Any VTIMEZONE component is always sorted first in chain.

Format

sort()

Example

$calendar = new vcalendar(); $calendar->setConfig( "directory", "depot" ); $calendar->setConfig( "filename", "calendar.ics" ); $calendar->parse(); $calendar->sort(); $calendar->returnCalendar();

[index]

3.1.4.6 useCachedCalendar

If recent version of local (nonempty) calendar file exists, an HTTP redirect header is sent otherwise FALSE is returned.

Format

useCachedCalendar( [ int timeout ] ) useCachedCalendar( string directory/FALSE , string filename/FALSE , string delimiter/FALSE [, int timeout ] )

timeout : default 3600 sec Second format with parameters for directory/filename/delimeter, kept for backward compatibility, may be removed i future versions. Recommendation is to use setConfig, se example below.

Example

.. . $calendar->setConfig( "directory", "depot" ); $calendar->setConfig( "filename", "calendar.ics" ); $calendar->useCachedCalendar();

[index]

3.1.5 Calendar configuration functions

All configuration controls (allowEmpty, cOmPsInFo etc.) case independent.

3.1.5.1 Allow empty components

Allow or reject empty calendar properties, default allow (TRUE). Used in input function setProperty().
Set allowEmpty

Format

setConfig( "allowEmpty", bool <directive> )

Example

$calendar->setConfig( "allowEmpty", TRUE );

[index]

3.1.5.2 Component information

Get information about calendar components. Returns array with basic information about all components (in array format) within calendar.

Format

getConfig( "compsinfo" )

Output = array ( *compinfo ) compinfo = array ( "ordno" => int ordno, // order number (1st=1, 2nd=2..) , "type" => string type // component type (vevent, vtodo.. . , "uid" => string uid // component UID (not for ALARM / TIMEZONE) , "props" => array( *[ propertyName => Property count ]) // for every set property , "sub" => array( *compinfo )) // if subcomponents exists, an array for each subcomponent

Example

$v = new vcalendar(); $v->parse( "file.ics" ); $compsinfo = $v->getConfig( "compsinfo" ); foreach( $compsinfo as compinfo) {  echo " order number : ".$compinfo["ordno"];  echo " type : ".$compinfo["type"];  echo " UID : ".$compinfo["uid"];  foreach( $compinfo["props"] as $propertyName => $propertyCount )   echo " $propertyName = $propertyCount";  if( is_array( $compinfo["sub"] )) {   foreach( $compinfo["sub"] as $subcompinfo ) {    echo " order number : ".$subcompinfo["ordno"];    /* .. dito if subcomponents exists .. . */   }  } }

[index]

3.1.5.3 Delimiter

Directory/filename delimiter.
Get delimiter

Format

getConfig( "delimiter" )

Example

$del = $calendar->getConfig( "delimiter" );

Set delimiter
Default PHP constant DIRECTORY_SEPARATOR. If used, must be set BEFORE filename!

Format

setConfig( "delimiter", string <delimiter> )

Example

$calendar->setConfig( "delimiter", "/" );

[index]

3.1.5.4 Directory

Local directory to store/read iCal files, default ".".
Get directory

Format

getConfig( "directory" )

Example

$folder = $calendar->getConfig( "directory" );

Set directory
Directory must be set BEFORE filename and must exist and be writeable otherwise FALSE is returned. When setting Directory any previously set URL is removed.

Format

setConfig( "directory", string <directory> )

Example

$calendar->setConfig( "directory", "depot" );

[index]

3.1.5.5 Fileinfo

Information about directory, filename and filesize. Notice filesize.
Get fileinfo

Format

getConfig( "fileinfo" )

Example

$fileinfo = $calendar->getConfig( "fileinfo" );

output = array( <directory>, <filename>, <filesize> )


[index]

3.1.5.6 Filename

iCal local file name, default created, if not set;
$filename = date( "YmdHis" ).".ics"
$filename = date( "YmdHis" ).".xml" if format set to "xcal".
Get filename

Format

getConfig( "filename" )

Example

$filename = $calendar->getConfig( "filename" );

Set filename
Local filename must be set AFTER setting directory (and ev. delimiter)! Filename (and opt. directory) must be readable/writeable otherwise FALSE is returned.

Format

setConfig( "filename", string <filename> )

Example

$calendar->setConfig( "filename", "calendar.ics" );

[index]

3.1.5.7 Filesize

Get filesize
Returns the size of the file in bytes, to be called
- after "saveCalendar()"
or
- after a "setConfig( "directory" / "filename" )" and before/after "parse()".
Getting the filesize for a remote file (URL) will always return zero.

Format

getConfig( "filesize" )

Example

$filesize = $calendar->getConfig( "filesize" );

[index]

3.1.5.8 Format

Format for calendar output, "iCal"/"xCal".
Get format
If format was set to "xcal" , "xcal" is returned.

Format

getConfig( "format" )

Example

$format = $calendar->getConfig( "format" );

Set format
"iCal" is preset, default (rfc2445), "xCal" force xml formatted output-

Format

setConfig( "format", string <format> )

Example

$calendar->setConfig( "format", "xcal" );

[index]

3.1.5.9 Language

Language for calendar and component properties as defined in [RFC 1766].
Get language
Language for calendar (only if language is set at calendar level).

Format

getConfig( "language" )

Example

$lang = $calendar->getConfig( "language" );

Set language
Set language for whole calendar, will be used everywhere its apropriate. Language set at calendar level can be overridden by "setConfig( "language", .." at component level or in specific component property parameter.

Format

setConfig( "language", string <lang> )

Example

$calendar->setConfig( "lang", "en" );

[index]

3.1.5.10 NewlineChar

Character(s) used for carriage return + line feed (CR+LF), default "\n".
Get Newlinechar
Get character(s) used for carriage return + line feed (CR+LF).

Format

getConfig( "newlinechar" ) getConfig( "nl" ) // alias

Example

$nl = $calendar->getConfig( "nl" );

Set Newlinechar
Set character(s) used for carriage return + line feed (CR+LF).

Format

setConfig( "newlinechar", string <char> ) setConfig( "nl", string <char> ) // alias

Example

$calendar->setConfig( "nl", "\n" );

[index]

3.1.5.11 Unique_id

Unique_id is used when creating property PRODID (default auto created) at calendar level and UID at component level.
(rfc2445:)"
* The identifier is RECOMMENDED to be the identical syntax to the
* [RFC 822] addr-spec. A good method to assure uniqueness is to put the
* domain name or a domain literal IP address of the host on which.. ."
Default AUTO generated ( gethostbyname( $_SERVER["SERVER_NAME"] )). Can to be used to set other domain name than server name.
Get unique id

Format

getConfig( "unique_id" )

Example

$id = $calendar->getConfig( "unique_id" );

Set unique id
Recommendation to set unique_id just after creating a new vcalendar object, to ensure accurate setting of component UID.

Format

setConfig( "unique_id", string <unique-Id> )

Example

$calendar = new vcalendar(); // initiate new CALENDAR $calendar->setConfig( "unique_id", "domain.com" );

[index]

3.1.5.12 URL

Managing remote files, used with writing; "saveCalendar()", or reading; "parse()", only protocol "http" ("webcal") supported. If URL is set, setConfig directory (+filename) is ignored when using parse or saveCalendar functions.
Get URL
The URL filename part can be retrieved by "getConfig( 'filename' )".

Format

getConfig( "url" )

Example

$url = $calendar->getConfig( "URL" );

Set URL
A remote file, URL, MUST be prefixed by "http://" ("webcal://") and suffixed by a valid filename. When setting URL any previously set Directory is removed. When storing a remote iCal file localy, only directory need to be set, filename remains unchanged.

Format

setConfig( "URL", string <url> )

Example

$calendar->setConfig( "url", "http://www.iCal.net/depot/calendar.ics" );

[index]

3.1.6 Calendar misc. functions

3.1.6.1 validDate

Check and convert input parameter date (different formats), return date in iCalcreator (internal) date format.

Format

validDate( date [, bool utc/FALSE ] )

date = int year, int month, int day [, int hour, int min, int sec, mixed tz ]] date = array( int year, int month, int day [, int hour, int min, int sec, mixed tz ]] ) date = array("year" => int year, "month" => int month, "day" => int day [,"hour" => int hour, "min" => int min, "sec" => int sec ,"tz" => mixed tz ] ) date = array( "timestamp" => int timestamp [, "tz" => mixed tz ] ) date = string datestring // string date, acceptable by strtotime-command, e.g.  "14 august 2006 16.00.00" (notice date restriction) tz = timezone / offset offset = (+/-)HHmm[ss] utc = TRUE and if tz = UTC offset then input local date + UTC offset => UTC DATE-TIME

Example

$c = new vcalendar (); $today = date("M d Y H:i:s"); $UTCoffset = date( "Z"); // offset in seconds if( "-" == substr( $UTCoffset, 0, 1 )) {   $UTCoffset = substr( $UTCoffset, 1 );   $sign = "-"; } else {   $sign = "+"; } $UTCoffsetHour = $UTCoffset / 3600; $UTCoffsetMod = $UTCoffset % 3600; $UTCoffsetMin = $UTCoffsetMod / 60; $UTCoffsetSec = $UTCoffsetMod % 60; $UTCoffset = sprintf( $sign."%02d%02d%02d" , $UTCoffsetHour , $UTCoffsetMin , $UTCoffsetSec ); $today .= " ".$UTCoffset; // UTC offset in accepted format, (+/-)HHMM[SS] $date = $c->validDate( $today ); if( FALSE == $date ) {   echo "unvalid date $today"; } else {   $e = new vevent();   $e->setProperty( "dtstart", $date );   .. .

[index]

3.2 Calendar component object property function list

All calendar component property functions for get/set data.
For property format in detail, see RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.

Notice: for properties and DATE-TIME WITH UTC TIME.
The date with UTC time, or absolute time, is identified by a LATIN CAPITAL LETTER Z suffix character (US-ASCII decimal 90), the UTC designator, appended to the time value. For example, the following represents January 19, 1998, at 0700 UTC:

DTSTART:19980119T070000Z

The TZID property parameter MUST NOT be applied to DATE-TIME properties whose time values are specified in UTC. (quote from rfc2445)

Notice: date limitation.
Due to limitation in PHP date commands, e.g. mktime, strtotime, a date (e.g. while setting DTSTART property) before "January 1 1970 00:00:00 GMT" can force a PHP date command to generate an error or set date to "January 1 1970".

3.2.1 deleteProperty

General calendar delete property function,simplifying calendar property delete.

Format

deleteProperty( [ string PropName [, int order=1 ] )

Propname - case independent, strict rfc2445 component property names, unknown/missing Propname will be regarded as X-property. order - if missing 1st/next occurence, used with multiply (property) occurences

FALSE is returned if no property exists or at end-of-properties with consecutive function calls.

Example 1

$v = new vcalendar(); $v->parse( "file.ics" ); $e = $v->getComponent( "vevent" ); while( FALSE !== $e->deleteProperty( "comment" ))   continue; // remove all COMMENT properties .. .

[index]

3.2.2 getProperty

General get property function,simplifying component property getting.

Format

getProperty( string PropName [, int order=1 [, bool complete=FALSE ]] )

Propname - case independent, strict rfc2445 component property names, unknown/missing Propname will be regarded as X-property. order - if missing/FALSE 1st/next occurence, otherwise with multiply occurences (1st=1, 2nd=2.. .) complete - FALSE (default) : output only property value TRUE : output = array("value" => <value> ,"params"=> <parameter array>)

Example

$v = new vcalendar(); $v->parse( "file.ics" ); while( $vevent = $v->getComponent( "vevent" )) {  $dtstart = $vevent->getProperty( "dtstart" ); // one occurence  $description = $vevent->getProperty( "description" ); // one occurence  while( $comment = $vevent->getProperty( "comment" )) { // MAY occur more than once  .. .  } .. .

[index]

3.2.3 parse

Parse strict rfc2445 property text and/or ALARMs.

Any rfc2445 strict formatted property text, in string or array format.
Complete ALARMs, all properties included, in array format and first array row as "BEGIN:VALARM", last as "END:VALARM".

Format

parse( mixed propertyText )

propertyText = string/array, strict rcf2445 formatted property/properties property name MUST begin line, can span several lines

example

.. . $e = new vevent(); $e->parse( 'DTSTAMP:19970324T1200Z' ); $e->parse( 'SEQUENCE:0' ); $e->parse( 'ORGANIZER:MAILTO:jdoe@host1.com' ); $e->parse( array( 'ATTENDEE;RSVP=TRUE:MAILTO:jsmith@host1.com', 'ATTENDEE;RSVP=TRUE:MAILTO:jsmith@host2.com', 'ATTENDEE;RSVP=TRUE:MAILTO:jsmith@host3.com', 'ATTENDEE;RSVP=TRUE:MAILTO:jsmith@host4.com' )); $e->parse( 'DTSTART:19970324T123000Z' ); $e->parse( 'DTEND:19970324T210000Z' ); $e->parse( 'CATEGORIES:MEETING,PROJECT' ); $e->parse( 'CLASS:PUBLIC' ); $e->parse( 'SUMMARY:Calendaring Interoperability Planning Meeting' ); $e->parse( 'STATUS:DRAFT' ); $e->parse( array( 'DESCRIPTION:Project xyz Review Meeting Minutes\n', ' Agenda\n1. Review of project version 1.0 requirements.\n2.', 'Definition', ' of project processes.\n3. Review of project schedule.\n', 'Participants: John Smith, Jane Doe, Jim Dandy\n-It was', ' decided that the requirements need to be signed off by', ' product marketing.\n-Project processes were accepted.\n ', '-Project schedule needs to account for scheduled holidays', ' and employee vacation time. Check with HR for specific', ' dates.\n-New schedule will be distributed by Friday.\n-', ' Next weeks meeting is cancelled. No meeting until 3/23.' )); $e->parse( 'LOCATION:LDB Lobby' ); $e->parse( 'ATTACH;FMTTYPE=application/postscript:ftp://xyz.com/pub/conf/bkgrnd.ps' ); $e->parse( array( 'BEGIN:VALARM', 'ACTION:AUDIO', 'TRIGGER;VALUE=DATE-TIME:19970224T070000Z', 'ATTACH;FMTTYPE=audio/basic:http://host.com/pub/audio-files/ssbanner.aud', 'REPEAT:4', 'DURATION:PT1H', 'X-alarm:non-standard ALARM property', 'END:VALARM' )); $e->parse( 'X-xomment:non-standard property will be displayed, with a comma escaped'); $calendar->setComponent( $e ); .. .

[index]

3.2.4 setProperty

General set property function,simplifying component property setting.

Format

setProperty( string PropName, mixed Proparg_1 *[, mixed Proparg_n] )

Propname case independent, strict rfc2445 component property names, unknown Propname will be regarded as X-property.

Example

$vevent = new vevent(); $vevent->setProperty( "dtstart" , array("year"=>2007,"month"=>4,"day"=>1,"hour"=>19)); $vevent->setProperty( "duration", 0, 0, 3 )); $vevent->setProperty( "LOCATION", "Central Placa" ); $vevent->setProperty( "summary", "PHP summit" ); .. .

[index]

3.2.5 ACTION

This property defines the action to be invoked when an ALARM is triggered,
"AUDIO" / "DISPLAY" / "EMAIL" / "PROCEDURE".
get ACTION

Format

getProperty( "Action" )

output = actionValue 1

getProperty( "Action", FALSE , TRUE )

output = array( "value" => actionValue1 , "params" => xparam2 )

Example

$action = $valarm->getProperty( "action" );

set ACTION

Format

setProperty( "Action", actionValue [, xparam ] )

actionValue1 = one of "AUDIO" / "DISPLAY" / "EMAIL" / "PROCEDURE" xparam2 = array( *[ xparamkey => xparamvalue ] )

Example

$valarm->setProperty( "action", "DISPLAY" );

[index]

3.2.6 ATTACH

The property provides the capability to associate a document object with a calendar component.

The default value type for ATTACH is URI. The value type can also be set to BINARY to indicate inline binary encoded content information (params 2).
get ATTACH

Format

getProperty( "Attach" )

output = attachValue 1

getProperty( "ATTACH", FALSE , TRUE )

output = array( "value" => attachValue1 , "params" => params2 )

Example

$attach = $valarm->getProperty( "attach" );

Set ATTACH

Format

setProperty( "attach", attachValue 1 [, params ] )

attachValue1 = URI / inline binary encoded content information. params2 = array( [ "ENCODING" => "BASE64", "VALUE" => "BINARY" ] [, "FMTTYPE" => contentType ] [, xparam ] ) contentType = The parameter value MUST be the TEXT for either an IANA registered content type or a non-standard content type. xparam = *[ xparamkey => xparamvalue ]

Example

$vevent->setProperty( "attach" , "ftp://domain.com/pub/docs/agenda.doc" , array( "FMTTYPE" => "application/binary" ));

[index]

3.2.7 ATTENDEE

The property defines an "Attendee" within a calendar component.

This value type for ATTENDEE is URI, a calendar user address.
get ATTENDEE

Format

getProperty( "Attendee" )

output = attendeeValue 1

getProperty( "ATTENDEE", int propOrderNo/FALSE , TRUE )

output = array( "value" => attendeeValue1 , "params" => array( params2 ))

Example

$attendee = $valarm->getProperty( "attendee" );

Set ATTENDEE
If exist, default parameter values are removed after input (params2).

Format

setProperty( "attendee", attendeeValue [, params ] )

attendeeValue1 = a calendar user address, a URI as defined by [RFC 1738] or any other IANA registered form for a URI. params2 = array( [CUTYPE] [,MEMBER] [,ROLE] [,PARTSTAT] [,RVSP] [,DELEGATED-TO] [,DELEGATED-FROM] [,SENT-BY] [,CN] [,DIR] [,LANGUAGE] [,xparams] ) CUTYPE = "CUTYPE" => "INDIVIDUAL" (An individual, Default) / "GROUP" (A group of individuals) / "RESOURCE" (A physical resource) / "ROOM" (A room resource) / "UNKNOWN" (Otherwise not known) / x-name (Experimental type) / iana-token (Other IANA registered type) MEMBER = "MEMBER" => array( *[ "single member of the group or list membership"]) ROLE = "ROLE" => "CHAIR" (Indicates chair of the calendar entity) / "REQ-PARTICIPANT" (required participation, Default) / "OPT-PARTICIPANT" (optional participation) / "NON-PARTICIPANT" (information purposes only) / x-name (Experimental role) / iana-token (Other IANA role) PARTSTAT = "PARTSTAT" => "NEEDS-ACTION" (Event needs action, Default) / "ACCEPTED" (Event accepted) / "DECLINED" (Event declined) / "TENTATIVE" (Event tentatively accepted) / "DELEGATED" (Event delegated) / "NEEDS-ACTION" (To-do needs action, Default) / "ACCEPTED" (To-do accepted) / "DECLINED" (To-do declined) / "TENTATIVE" (To-do tentatively accepted) / "DELEGATED" (To-do delegated) / "COMPLETED" (To-do completed. COMPLETED property has date/time completed) / "IN-PROCESS" (To-do in process of being completed) / "NEEDS-ACTION" (Journal needs action, Default) / "ACCEPTED" (Journal accepted) / "DECLINED" (Journal declined) / x-name (Experimental status) / iana-token (Other IANA registered status) RSVP = "RSVP" => "TRUE" / "FALSE", Default (reply expectation) DELEGATED-TO = "DELEGATED-TO" => array(*["single calendar user to whom the calendar user specified by the property has delegated participation"]) DELEGATED-FROM = "DELEGATED-FROM" => array( *[ "single calendar user that have delegated their participation to the calendar user specified by the property" ] ) SENT-BY = "SENT-BY" => single calendar user that is acting on behalf of the calendar user specified by the property" LANGUAGE = "LANGUAGE" => language for text values in CN parameter" CN = "CN" => "common name to be associated with the calendar user specified by the property" DIR = "DIR" => "reference to a directory entry associated with the calendar user specified by the property" xparam = *[ xparamkey => xparamvalue ]

See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.

Example

$vevent->setProperty( "attendee" , "attendee1@ical.net" $vevent->setProperty( "attendee" , "attendee2@ical.net" , array( "cutype" => "INDIVIDUAL" , "member" => array( "member1@ical.net" , "member2@ical.net" , "member3@ical.net" ) , "role" => "CHAIR" , "PARTSTAT" => "ACCEPTED" , "RSVP" => "TRUE" , "DELEgated-to" => array( "part1@ical.net" , "part2@ical.net" , "part3@ical.net" ) , "delegateD-FROM" => array( "part4@ical.net" , "part5@ical.net" , "part6@ical.net" ) , "SENT-BY" => "part7@ical.net" , "LANGUAGE" => "us-EN" , "CN" => "John Doe" , "DIR" => "http://www.ical.net/doc/info.doc" , "x-agenda" => "status report" // xparam , "x-length" => "15 min" )); // xparam

[index]

3.2.8 CATEGORIES

This property defines the categories for a calendar component.

The value type for CATEGORIES is TEXT.
get CATEGORIES

Format

getProperty( "CATEGORIES" )

output = categoryValue1

getProperty( "CATEGORIES", int propOrderNo/FALSE , TRUE )

output = array( "value" => categories1 , "params" => params2 )

Example

$categories = $valarm->getProperty( "categories" );

Set CATEGORIES

Format

setProperty( "categories", mixed categories [, params ] )

categories1 = string categoryValue / array( *categoryValue ) categoryValue = textual categories or subtypes of the calendar component, can be specified as a list of categories separated by the COMMA character params2 = array( ["LANGUAGE" => "<lang>"][, xparam] ) xparam = *[ xparamkey => xparamvalue ]

Example

$vevent->setProperty( "categories", "project_x" );

[index]

3.2.9 CLASS

This property defines the access classification for a calendar component.
get CLASS

Format

getProperty( "CLASS" )

output = classValue1

getProperty( "CLASS", FALSE , TRUE )

output = array "value" => classValue1 , "params" => xparam2 )

Example

$class = $valarm->getProperty( "class" );

set CLASS

Format

setProperty( "class", string classvalue [, xparam ] )

classvalue1 = "PUBLIC" / "PRIVATE" / "CONFIDENTIAL" / iana-token / x-name xparam2 = array( *[ xparamkey => xparamvalue ] )

Example

$vevent->setProperty( "class", "CONFIDENTIAL" );

[index]

3.2.10 COMMENT

This property specifies non-processing information intended to provide a comment to the calendar user.

The value type for COMMENT is TEXT.
get COMMENT

Format

getProperty( "COMMENT" )

output = commentValue1

getProperty( "COMMENT", int propOrderNo/FALSE , TRUE )

output = array( "value" => commentValue1 , "params" => params2 )

Example

$comment = $vevent->getProperty( "comment" );

Set COMMENT

Format

setProperty( "comment", commentValue [, params ] )

commentValue1 = Value type Text params2 = array( ["LANGUAGE" => "<lang>"] [, "ALTREP" => "<an alternate text representation, URI>"] [, xparam] ) xparam = *[ xparamkey => xparamvalue ]

Example

$vevent->setProperty( "comment", "this is a comment" );

[index]

3.2.11 COMPLETED

This property defines the date and time that a to-do was actually completed.

The value type for COMPLETED is DATE-TIME, UTC.
get COMPLETED

Format

getProperty( "COMPLETED" )

output = completedDate1

getProperty( "COMPLETED", FALSE , TRUE )

output = array( "value" => completedDate1 , "params" => xparam2 )

Example

$completed = $vtodo->getProperty( "completed" );

Set COMPLETED

Format

setProperty( "completed", mixed completedDate [, xparam ] )

completedDate is Always UTC format! completedDate1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec] ) completedDate = int year , int month , int day [, int hour , int min , int sec ] completedDate = array( int year , int month , int day [, int hour , int min , int sec ] ) completedDate = array ( "timestamp" => int timestamp ) completedDate = string datestring // string date, acceptable by strtotime-command, ex.  "14 august 2006 16.00.00" (notice date restriction) xparam2 = array( *[ xparamkey => xparamvalue ] )

Example 1

$vtodo->setProperty( "completed", 2006, 8, 10 ); // 10 august 2006 UTC

Example 2

$vcalendar = new vcalendar(); $vtodo = new vtodo(); .. . $date = array("year" => 2006, "month" => 10, "day" => 10, "tz" => "+0200"); $date = $vcalendar->validDate( $date, TRUE );
// local date + UTC offset => UTC DATE-TIME $vtodo->setProperty( "completed", $date ); .. .

[index]

3.2.12 CONTACT

The property is used to represent textual contact information or alternately a reference to textual contact information associated with the calendar component.

The value type for CONTACT is TEXT.
get CONTACT

Format

getProperty( "CONTACT" )

output = contactValue1

getProperty( "CONTACT", int propOrderNo/FALSE , TRUE )

output = array( "value" => contactValue1 , "params" => params2 )

Example

$contact = $vevent->getProperty( "contact" );

Set CONTACT

Format

setproperty( "contact", contactValue [, params] )

contactValue1 = Value type TEXT params2 = array ( ["LANGUAGE" => "<lang>"] [, "ALTREP" => "<an alternate text representation, URI>"] [, xparam] ) xparam = *[ xparamkey => xparamvalue ]

Example

$c->setProperty( "contact", "tel 012-34 56 789" )

[index]

3.2.13 CREATED

This property specifies the date and time that the calendar information was created by the calendar user agent in the calendar store. Note: This is analogous to the creation date and time for a file in the file system.

The value type for CREATED is DATE-TIME, UTC.
get CREATED

Format

getProperty( "CREATED" )

output = createdDate1

getProperty( "CREATED", FALSE , TRUE )

output = array( "value" => createdDate1 , "params" => xparam2 )

Example

$created = $vevent->getProperty( "CREATED" );

Set CREATED
Input date is always considered as DATE-TIME.

Format

setProperty( "created", [ createdDate [, xparam ]] )

createdDate is Always UTC format! createdDate1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec ) createdDate = int year , int month , int day [, int hour , int min , int sec ]] createdDate = array( int year , int month , int day [, int hour , int min , int sec] ) createdDate = array ( "timestamp" => int timestamp ) createdDate = string datestring, // string date, acceptable by strtotime-command, ex. 14 august 2006 16.00.00" (notice date restriction) xparam2 = array( *[ xparamkey => xparamvalue ] )

Example 1

$vevent->setProperty( "created", 2006, 8, 11, 14, 30, 35 ); // 11 august 2006 14.30.35 UTC

Example 2

$vcalendar = new vcalendar(); $vtodo = new vtodo(); .. . $date = array("year" => 2006, "month" => 10, "day" => 10, "tz" => "+0200"); $date = $vcalendar->validDate( $date, TRUE ); // local date + UTC offset => UTC DATE-TIME $vtodo->setProperty( "created", $date ); .. .

Example 3

$vevent->setProperty( "created" ); // current UTC date-time is set if called without parameters

[index]

3.2.14 DESCRIPTION

This property provides a more complete textual description of the calendar component, than that provided by the SUMMARY property (, analogous to a mail BODY).

The value type for DESCRIPTION is TEXT.
get DESCRIPTION

Format

getProperty( "DESCRIPTION" )

output = descriptionValue1

getProperty( "DESCRIPTION", FALSE , TRUE )

output = array( "value" => descriptionValue1 , "params" => params2 )

Example

$description = $vevent->getProperty( "description" );

Set DESCRIPTION

Format

setProperty( "description", descriptionValue [, params ] )

descriptionValue1 = Value type TEXT params2 = array( ["LANGUAGE" => "<lang>"] [, "ALTREP" => "<an alternate text representation, URI>"] [, xparam] ) xparam = *[ xparamkey => xparamvalue ]

Example

$vevent->setProperty( "description", "This is a description" );

[index]

3.2.15 DTEND

This property specifies the date and time that a calendar component ends.

The default value type for DTEND is DATE-TIME, can be set to a DATE value type.

Notice that an end date without a time is in effect midnight of the day before the date, so for timeless dates, use the date following the event date for it to be correct. For an "all-day event" and using timeless dates, the DTEND is equal DTSTART plus one day, example all-day event (2007-12-01)
DTSTART;VALUE=DATE:20071201
DTEND;VALUE=DATE:20071202.
get DTEND

Format

getProperty( "DTEND" )

output = dtendDate1

getProperty( "DTEND", FALSE , TRUE )

output = array( "value" => dtendDate1 , "params" => params2 )

Example

$dtend = $vevent->getProperty( "dtend" );

Set DTEND
If exist, default parameter value ( "VALUE" = "DATE-TIME" ) is (identified and) removed after input (params2).

Format

setProperty( "dtend", dtendDate [, params ] )

dtendDate1 = array ( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec [, "tz" => mixed tz ]] ) dtendDate = int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] dtendDate = array( int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] ) dtendDate = array( "timestamp" => int timestamp [,"tz" => mixed tz]) dtendDate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) dtendDate : Within the "VFREEBUSY" calendar component, the time MUST be specified in the UTC time format. tz = timezone / UTC offset offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME params2 = array([ tzidparam/datetimeparam/dateparam ] *[,xparams]) tzidparam = timezone identifier // date output as local date-time with timezone identifier datetimeparam = "VALUE" => "DATE-TIME" // default, date output as date-time dateparam = "VALUE" => "DATE" // date output as DATE, ex. all-day event xparams = xparamkey => xparamvalue

Example 1

$vevent->setProperty( "dtend" , 2006, 8, 11, 16, 30, 0 );

// 11 august 2006 16.30.00 local date

Example 2

$vfreebusy->setProperty( "dtend" , 2006, 8, 11, 16, 30, 0, "-040000" );

// 11 august 2006 16.30.00 -040000 : local date + UTC offset => UTC DATE-TIME

Example 3

$vevent->setProperty( "dtend" , array( 'year' =>, 2006, 'month' => 8, 'day'=> 11 ) , array( 'VALUE' => 'DATE' ));

// end of one or more all-day events

[index]

3.2.16 DTSTAMP

The property indicates the date/time that the instance of the iCalendar object was created.

The value type for DTSTAMP is DATE-TIME, UTC.
get DTSTAMP

Format

getProperty( "DTSTAMP" )

output = dtstampDate1

getProperty( "DTSTAMP", FALSE , TRUE )

output = array( "value" => dtstampDate1 , "params" => xparam2 )

Example

$dtstamp = $vevent->getProperty( "dtstamp" );

Set DTSTAMP
Input date is always considered as DATE-TIME. DTSTAMP is AUTO GENERATED at component creation (not in valarm/timzone components).

Format

setProperty( "dtstamp", dtstampDate [, xparam ] )

dtstampDate MUST be specified in the UTC time format. dtstampDate1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec ] ) dtstampDate = int year , int month , int day [, int hour , int min , int sec] dtstampDate = array( int year , int month , int day [, int hour , int min, int sec ] ) dtstampDate = array ( "timestamp" => int timestamp ) dtstampDate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) xparam2 = array( *[ xparamkey => xparamvalue ] )

Example 1

$vevent->setProperty( "dstamp" , 2006, 8, 11, 7, 30, 1 );

// 11 august 2006 07.30.01 UTC

Example 2

$vcalendar = new vcalendar(); $vtodo = new vtodo(); .. . $date = array("year" => 2006, "month" => 10, "day" => 10, "tz" => "+0200"); $date = $vcalendar->validDate( $date, TRUE ); // local date + UTC offset => UTC DATE-TIME $vtodo->setProperty( "dtstamp", $date ); .. .

[index]

3.2.17 DTSTART

This property specifies when the calendar component begins.

The default value type for DTSTART is DATE-TIME, can be set to a DATE value type.

For an "all-day event" and using timeless dates, example (2007-12-01)
DTSTART;VALUE=DATE:20071201
DTEND;VALUE=DATE:20071202. // opt., in effect midnight of the day before the date!!
get DTSTART

Format

getProperty( "DTSTART" )

output = dtstartDate1

getProperty( "DTSTART", FALSE , TRUE )

output = array( "value" => dtstartDate1 , "params" => params2 )

Example

$dtstart = $vevent->getProperty( "dtstart" );

Set DTSTART
If exist, default parameter value ( "VALUE" = "DATE-TIME" ) is (identified and) removed after input (params2).

Format

setProperty( "dtstart", mixed dtstartDate [, params ] )

dtstartDate1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec [, "tz" => mixed tz ]] ) dtstartDate = int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] dtstartDate = array( int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] ) dtstartDate = array("timestamp" => int timestamp [, "tz" => mixed tz]) dtstartDate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) dtstartDate : Within the "VFREEBUSY" calendar component, the time MUST be specified in the UTC time format. tz = timezone / offset offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME params2 = array([ tzidparam/datetimeparam/dateparam ] *[, xparams]) tzidparam = timezone identifier // date output as local date-time with timezone identifier datetimeparam = "VALUE" => "DATE-TIME" // default, date output as date-time dateparam = "VALUE" => "DATE" // date output as DATE, ex. all-day event xparams = xparamkey => xparamvalue

Example 1

$vevent->setProperty( "dstart" , 2006, 8, 11, 7, 30, 1 );

// 11 august 2006 07.30.01 local date

Example 2

$vevent->setProperty( width="75%">"dstart" , 2006, 8, 11, 16, 30, 0, "-040000" );

// 11 august 2006 16.30.00 -040000, // local date + UTC offset => UTC DATE-TIME

Example 3

$vevent->setProperty( "dtstart" , array( 'year' =>, 2006, 'month' => 8, 'day'=> 11 ) , array( 'VALUE' => 'DATE' ));

// start of an all-day event, or a period of (entire) days

[index]

3.2.18 DUE

This property defines the date and time when a to-do is expected to be completed.

The default value type for DUE is DATE-TIME, can be set to a DATE value type.
get DUE

Format

getProperty( "DUE" )

output = dueDate1

getProperty( "DUE", FALSE , TRUE )

output = array( "value" => dueDate1 , "params" => params2 )

Example

$due = $vtodo->getProperty( "due" );

Set DUE
If exist, default parameter value ( "VALUE" = "DATE-TIME" ) is (identified and) removed after input (params2).

Format

setProperty( "due", mixed dueDate [, params ] )

dueDate1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec [, "tz" => mixed tz ]] ) dueDate = int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] dueDate = array( int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] ) dueDate = array( "timestamp" => int timestamp [, "tz" => mixed tz]) dueDate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) tz = timezone / offset offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME params2 = array([ tzidparam/datetimeparam/dateparam ] *[, xparams]) tzidparam = timezone identifier // date output as local date-time with timezone identifier datetimeparam = "VALUE" => "DATE-TIME" // default, date output as date-time dateparam = "VALUE" => "DATE" // date output as DATE, "during the day" xparams = xparamkey => xparamvalue

Example 1

$vtodo->setProperty( "due" , 2006, 8, 11, 18, 0, 0 );

// 11 august 2005 18.00.00 local date

Example 2

$vtodo->setProperty( "due" , 2006, 8, 11, 16, 30, 0, "-040000" );

// 11 august 2006 16.30.00 -040000 // local date + UTC offset sets UTC DATE-TIME

Example 3

$vevent->setProperty( "due" , array( 'year' =>, 2006, 'month' => 8, 'day'=> 11 ) , array( 'VALUE' => 'DATE' ));

// due "during the day"

[index]

3.2.19 DURATION

The property specifies a positive duration of time.
get DURATION

Format

getProperty( "DURATION" )

output = duration1

getProperty( "DURATION", FALSE , TRUE )

output = array( "value" => duration1 , "params" => xparam2 )

Example

$duration = $vtodo->getProperty( "duration" );

option

If a 4th argument is used and set to TRUE, returned output is in a DATE-TIME output format (like DTEND / DUE), based on DTSTART value with added DURATION value,
output,  getProperty( "DTEND" ) or output, getProperty( "DUE" )
Set DURATION

Format

setProperty( "duration", mixed duration [, xparam ] )

duration1 = array( "week" => int week/false [, "day" => int day/false [, "hour" => int hour/false , "min" => int min/false , "sec" => int sec/false ]] ) duration = array ( "week" => int week ) duration = array ( "day" => int week ) duration = array ( "hour" => int hour , "min" => int min , "sec" => int sec ) duration = array ( "sec" => int sec ) duration = int week/false [, int day/false [, int hour , int min , int sec]] duration = array( int week/false [, int day/false [, int hour , int min , int sec]] ) duration = string dur-value = ["+"] "P" (dur-date/dur-time/dur-week) dur-date = dur-day [dur-time] dur-time = "T" (dur-hour / dur-minute / dur-second) dur-week = 1*DIGIT "W" dur-hour = 1*DIGIT "H" [dur-minute] dur-minute = 1*DIGIT "M" [dur-second] dur-second = 1*DIGIT "S" dur-day = 1*DIGIT "D" xparam2 = array( *[ xparamkey => xparamvalue ] )

Example 1

$vtodo->setProperty "duration" , array( "day" => 1 ));

// one day

Example 2

$vtodo->setProperty( "duration" , "PT4H" );

// four hours

[index]

3.2.20 EXDATE

This property defines the list of date/time exceptions for a recurring calendar component.

The default value type for EXDATE is DATE-TIME, can be set to a DATE value type.
get EXDATE

Format

getProperty( "EXDATE" )

output = exdates1

getProperty( "exdate", int propOrderNo/FALSE, TRUE )

output = array( "value" => exdates1 , "params" => params2 )

Example

$exdate = $vtodo->getProperty( "exdate" );

set EXDATE
If exist, default parameter value ( "VALUE" = "DATE-TIME" ) is (identified and) removed after input (params 2).

Format

setProperty( "exdate", exdates [, params ] )

exdates1 = array ( date *[, date ] ) date = array( int year , int month , int day [, int hour , int min , int sec , mixed tz ]] ) date1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec [, "tz" => mixed tz ]] ) date = array( "timestamp" => int timestamp [, "tz" => mixed tz]) date = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) tz = timezone / offset offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME params2 = array([(datetimeparam/dateparam) / tzidparam] [,xparam]) datetimeparam = "VALUE" => "DATE-TIME" // default, date output as date-time dateparam = "VALUE" => "DATE" // date output as DATE tzidparam = "TZID" => text xparam = *[ xparamkey => xparamvalue ]

Example 1

$vevent->setProperty( "exdate" , array( array( 2006, 8, 14, 16, 0, 0 ));

// >exclude 2006-08-14 16.00.00 (local date) from recurrence pattern

Example 2

$vevent->setProperty( "exdate" , array( array('year' =>,2006,'month' => 8,'day'=> 11)) , array( 'VALUE' => 'DATE' ));

// exclude 2006-08-11 from recurrence pattern;

[index]

3.2.22 EXRULE

This property defines a rule or repeating pattern for an exception to a recurrence set.
get EXRULE

Format

getProperty( "EXRULE" )

output = recur1

getProperty( "exrule", int propOrderNo/FALSE, TRUE )

output = array( "value" => recur1 , "params" => xparam2 )

Example

$exrule = $vtodo->getProperty( "exrule" );

Set EXRULE

Format

setProperty( "exrule", recur [, xparam ] )

Format

See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.

recur1 = array( "FREQ"=>freq // either UNTIL or COUNT may appear in a "recur", but UNTIL and COUNT MUST NOT occur in the same "recur" [, "UNTIL" "=>" >enddate ] [, "COUNT" "=>" 1*DIGIT ] // the rest of these keywords are optional, but MUST NOT occur more than once [, "INTERVAL" "=>" 1*DIGIT ] [, "BYSECOND" "=>" byseclist ] [, "BYMINUTE" "=>" byminlist ] [, "BYHOUR" "=>" byhrlist ] [, "BYDAY" "=>" bywdaylist ] [, "BYMONTHDAY" "=>" bymodaylist ] [, "BYYEARDAY" "=>" byyrdaylist ] [, "BYWEEKNO" "=>" bywknolist ] [, "BYMONTH" "=>" bymolist ] [, "BYSETPOS" "=>" bysplist ] [, "WKST" "=>" weekday ] [, x-name "=>" text ] ) freq = "SECONDLY" / "MINUTELY" / "HOURLY" / "DAILY" / "WEEKLY" / "MONTHLY" / "YEARLY" enddate = date enddate = / date-time ;An UTC DATE-TIME value byseclist = seconds byseclist = array (seconds / ( seconds *("," seconds) )) seconds = 1DIGIT / 2DIGIT ;0 to 59 byminlist = minutes byminlist = array( minutes / ( minutes *("," minutes) )) minutes = 1DIGIT / 2DIGIT ;0 to 59 byhrlist = hour byhrlist = array( hour / ( hour *("," hour) )) hour = 1DIGIT / 2DIGIT ;0 to 23 bywdaylist = weekdaynum bywdaylist = array( weekdaynum / ( weekdaynum *("," weekdaynum) )) weekdaynum = [([plus] ordwk / minus ordwk)] weekday plus = "+" minus = "-" ordwk = 1DIGIT / 2DIGIT ;1 to 53 weekday = "SU" / "MO" / "TU" / "WE" / "TH" / "FR" / "SA" ; Corresponding to ; SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, ; FRIDAY, SATURDAY and SUNDAY days of the week. bymodaylist = monthdaynum bymodaylist = aray( monthdaynum / ( monthdaynum *("," monthdaynum) )) monthdaynum = ([plus] ordmoday) / (minus ordmoday) ordmoday = 1DIGIT / 2DIGIT ;1 to 31 byyrdaylist = yeardaynum byyrdaylist = array( yeardaynum / ( yeardaynum *("," yeardaynum) )) yeardaynum = ([plus] ordyrday) / (minus ordyrday) ordyrday = 1DIGIT / 2DIGIT / 3DIGIT ;1 to 366 bywknolist = weeknum bywknolist = array( weeknum / ( weeknum *("," weeknum) )) weeknum = ([plus] ordwk) / (minus ordwk) bymolist = monthnum bymolist = array( monthnum / ( monthnum *("," monthnum) )) monthnum = 1DIGIT / 2DIGIT ;1 to 12 bysplist = setposday bysplist = array( setposday / ( setposday *("," setposday) )) setposday = yeardaynum

xparam2 = array( *[ xparamkey => xparamvalue ] )

Example

$vevent->setProperty( "Exrule" , array( "FREQ" => "MONTHLY" , "UNTIL" => "20060831" // DATE / DATE-TIME in UTC format; string/array, see CREATED format , "INTERVAL" => 2 , "WKST" => "SU" , "BYSECOND" => 2 , "BYMINUTE" => array( 2, -4, 6 ) // (*) , "BYHOUR" => array( 2, 4, -6 ) // (*) , "BYMONTHDAY" => -2 // (*) , "BYYEARDAY" => 2 // (*) , "BYWEEKNO" => array( 2, -4, 6 ) // (*) , "BYMONTH" => 2 // (*) , "BYSETPOS" => array( 2, -4, 6 ) // (*) , "BYday" => array( array(-2, "DAY" => "WE" ) , array( 3, "DAY" => "TH") , array( 5, "DAY" => "FR") , array( "DAY" => "MO")) // (**) , "X-NAME" => "x-value" ) , array( "xparamkey" => "xparamValue" )) $vtodo->setProperty( >"exrule" , array( "FREQ" => "WEEKLY" , "COUNT" => 2 , "INTERVAL" => 2 , "WKST" => "SU" , "BYSECOND" => array( -2, 4, 6 ) // (*) , "BYMINUTE" => -2 // (*) , "BYHOUR" => 2 // (*) , "BYMONTHDAY" => array( 2, -4, 6 ) // (*) , "BYYEARDAY" => array( -2, 4, 6 ) // (*) , "BYWEEKNO" => -2 // (*) , "BYMONTH" => array( 2, 4, -6 ) // (*) , "BYSETPOS" => -2 // (*) , "BYday" => array( 5, "DAY" => "WE" ) // (**) , "X-NAME" => "x-value" )); // (*) single value/array of values // (**) single value array /array of arrays

[index]

3.2.22 FREEBUSY

The property defines one or more free or busy time intervals in a VFREEBUSY calendar component.

The value type for FREEBUSY is PERIOD, DATE-TIME/DATE-TIME or DATE-TIME/duration.
get FREEBUSY

Format

getProperty( "FREEBUSY" )

output = array( "fbtyp" => freebusytype1 , dateperiods2 )

getProperty( "FREEBUSY", int propOrderNo/FALSE , TRUE )

output = array( "value" => array("fbtype" => freebusytype1 ,dateperiods2) , "params" => xparam 3 )

Example

$freebusy = $vfreebusy->getProperty( "FREEBUSY" );

Set FREEBUSY

Format

setProperty( "freebusy", freebusytype, dateperiods [, xparam ] )

freebusytype1 = one of "FREE" / "BUSY" Default / "BUSY-UNAVAILABLE" / "BUSY-TENTATIVE" / x-name dateperiods2 = array( array( startdate, enddate/duration )  *[, array( startdate, enddate/duration ) ] ) startdate/enddate = array( int year , int month , int day , int int hour , int min , int day [, string offset ] ) startdate/enddate = array( "year" => int year , "month" => int month , "day" => int day , "hour" => int hour , "min" => int min , "sec" => int sec [, "tz" => string offset ] ) // output format startdate/enddate = array( "timestamp" => int timestamp [, "tz" => string offset ] ) startdate/enddate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) startdate/enddate : date and time values MUST be an UTC DATE-TIME or local DATE-TIME + UTC offset. offset = (+/-)HHmm[ss] local date + UTC offset sets UTC DATE-TIME duration = array( int week/false [, int day/false , int hour , int min , int sec] ) duration = array ( "week" => int week/false [, "day" => int day/false [, "hour" => int hour , "min" => int min , "sec" => int sec ]] ); // output format duration = array( "week" => int week ) duration = array( "day" => int day ) duration = array( "hour" => int hour , "min" => int min , "sec" => int sec ) duration = array ( "sec" => int sec ) duration = string dur-value = (["+"]/"-") "P" (dur-date/dur-time/dur-week) dur-date = dur-day [dur-time] dur-time = "T" (dur-hour / dur-minute / dur-second) dur-week = 1*DIGIT "W" dur-hour = 1*DIGIT "H" [dur-minute] dur-minute = 1*DIGIT "M" [dur-second] dur-second = 1*DIGIT "S" dur-day = 1*DIGIT "D" xparam3 = array( *[ xparamkey => xparamvalue ] )

Example

See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.

$fdate1 = array ( 2001, 1, 1, 1, 1, 1 ); alt. $fdate1 = array ( "year" => 2001 , "month" => 1 , "day" => 1 , "hour" => 1 , "min" => 1 , "sec" => 1 ); $fdate2 = array ( 2002, 2, 2, 2, 2, 2 ); $fdate3 = array ( 2003, 3, 3, 3, 3, 3 ); $fdate4 = "4 April 2005 4:4:4"; $fdate7 = array ( "year" => 2007 , "month" => 7 , "day" => 7 ); $fdur6 = array ( "week" => 0 , "day" => 5 , "hour" => 5 , "min" => 5 , "sec" => 5 ); $fdur7 = array ( 0, 0, 6 ); // duration for 6 hours $fdur8 = "P2D"; // duration two days $freebusy->setProperty "freebusy" , "FREE" , array( array( $fdate1, $fdate2 ) , array( $fdate3, $fdur6 ) , array( $fdate4, $fdate5 ))); $freebusy->setProperty("freebusy" , "Busy" , array( array( array( $fdate1, $fdate2 ) , array( $fdate3, $fdur8 ) , array( $fdate4, $fdur7 ) , array( $fdate1, $fdate3 )));

[index]

3.2.23 GEO

This property specifies information related to the global position for the activity specified by a calendar component. Value type for latitude and longitude is FLOAT. "Values for latitude and longitude shall be expressed as decimal fractions of degrees. Whole degrees of latitude shall be represented by a two-digit decimal number ranging from 0 through 90. Whole degrees of longitude shall be represented by a decimal number ranging from 0 through 180. When a decimal fraction of a degree is specified, it shall be separated from the whole number of degrees by a decimal point."
get GEO

Format

getProperty( "GEO" )

output = array( "latitude" => <latitude> , "longitude" => <longitude>))

getProperty( "GEO", FALSE , TRUE )

output = array( "value" => array ( "latitude" => <latitude> , "longitude" => <longitude>)) , "params" => xparam 1 )

Example

$geo = $vevent->getProperty( "GEO" );

Set GEO

Format

setProperty( "geo", float latitude, float longitude [, xparam ] )

xparam 1 = array( *[ xparamkey => xparamvalue ] )

Example

$vevent->setProperty( "geo", 11.23456, -23.45678 );

[index]

3.2.24 LAST-MODIFIED

The property specifies the date and time that the information associated with the calendar component was last revised in the calendar store.

The value type for LAST-MODIFIED is UTC DATE-TIME.
get LAST-MODIFIED

Format 1

getProperty( "LAST-MODIFIED" )

output = moddate1

getProperty( "LAST-MODIFIED", FALSE , TRUE )

output = array( "value" => moddate1 , "params" => xparam2 )

Example

$last-mod = $vevent->getProperty( "LAST-MODIFIED" );

Set LAST-MODIFIED
Input date is always considered as DATE-TIME.

Format

setProperty( "Last-Modified" [, moddate [, xparam ]] )

moddate1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec ] ) moddate = int year , int month , int day [, int hour , int min , int sec ] moddate = array( int year , int month , int day [, int hour , int min , int sec ] ) moddate = array ( "timestamp" => int timestamp ) moddate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) xparam2 = array( *[ xparamkey => xparamvalue ] )

Example 1

$vevent->setProperty("last-modified" , 2006, 8, 14, 12, 1, 2 );

// 14 august 2006 12.01.02 UTC

Example 2

$vcalendar = new vcalendar(); $vtodo = new vtodo(); .. . $date = array("year" => 2006, "month" => 10, "day" => 10, "tz" => "+0200"); $date = $vcalendar->validDate( $date, TRUE ); // local date + UTC offset sets UTC format DATE-TIME $vtodo->setProperty( "last-modified", $date ); .. .

Example 3

$vevent->setProperty( "last-modified" );

// current UTC DATE-TIME is set if called without parameters

[index]

3.2.25 LOCATION

The property defines the intended venue for the activity defined by a calendar component.
get LOCATION

Format

getProperty( "LOCATION" )

output = location1

getProperty( "LOCATION", FALSE , TRUE )

output = array( "value" => location1 , "params" => param2 )

Example

$location = $vevent->getProperty( "LOCATION" );

Set LOCATION

Format

setProperty( "location", string location [, array param] )

location1 = Value type TEXT params2 = array( ["LANGUAGE" => "<lang>"] [, "ALTREP" => "<an alternate text representation, URI>"] [, xparam ] xparam = *[ xparamkey => xparamvalue ]

Example

$vevent->setProperty( "location", "Buckingham Palace" );

[index]

3.2.26 ORGANIZER

The property defines the organizer for a calendar component.

This value type for ORGANIZER is URI, a calendar user address.
get ORGANIZER

Format

getProperty( "ORGANIZER" )

output = organizer1

getProperty( "ORGANIZER", FALSE , TRUE )

output = array( "value" => organizer1 , "params" => params2 )

Example

$organizer = $vevent->getProperty( "ORGANIZER" );

Set ORGANIZER

Format

setProperty( "organizer", organizer [, params] )

organizer1 = a calendar user address, a URI as defined by [RFC 1738] or any other IANA registered form for a URI. params2 = array( ["LANGUAGE" => "<lang>" (applies to the CN parameter value) ] [, "CN" => "common name to be associated with the calendar user specified by the property"] [, "DIR" => "reference to a directory entry associated with the calendar user specified by the property" ] [, "SENT-BY" => "single calendar user that is acting on behalf of the calendar user specified by the property" ] [, xparam ] xparam = *[ xparamkey => xparamvalue ]

Example

$dir = "ldap://host.com:6666/o=3DDC%20Comp,c=3DUS??(cn=3DJohn%20Doe)"; $vevent->setProperty( "organizer" , "ical@domain.com" , array( "CN" => "John Doe" , "DIR" => $dir , "SENT-BY" => "secretary@domain.com" , "x-Key1" => "x-Value" , "x-Key2" => "y-Value" ));

[index]

3.2.27 PERCENTCOMPLETE

This property is used by an assignee or delegatee of a to-do to convey the percent completion of a to-do to the Organizer.

The property value is a positive integer between zero and one hundred. A value of "0" indicates the to-do has not yet been started. A value of "100" indicates that the to-do has been completed. Integer values in between indicate the percent partially complete.
get PERCENT-COMPLETE

Format

getProperty( "PERCENT-COMPLETE" )

output = percent1

getProperty( "PRIORITY", FALSE , TRUE )

output = array( "value" => percent1 , "params" => xparam2 )

Example

$percent = $vtodo->getProperty( "PERCENT-COMPLETE" );

Set PERCENT-COMPLETE

Format

setProperty( "Percent-Complete", percent [, xparam ] )

percent1 = Value type INTEGER xparam2 = array( *[ xparamkey => xparamvalue ] )

Example

$vtodo->setProperty( "percent-complete", 90 );

[index]

3.2.28 PRIORITY

The property defines the relative priority for a calendar component.

The priority is specified as an integer in the range zero to nine. A value of zero (US-ASCII decimal 48) specifies an undefined priority. A value of one (US-ASCII decimal 49) is the highest priority. A value of two (US-ASCII decimal 50) is the second highest priority. Subsequent numbers specify a decreasing ordinal priority. A value of nine (US-ASCII decimal 58) is the lowest priority.
get PRIORITY

Format

getProperty( "PRIORITY" )

output = priority1

getProperty( "PRIORITY", FALSE , TRUE )

output = array( "value" => priority1 , "params" => xparam2 )

Example

$priority = $vevent->getProperty( "priority" );

Set PRIORITY

Format

setProperty( "priority", priority [, xparam ] )

priority1 = Value type INTEGER xparam2 = array( *[ xparamkey => xparamvalue ] )

Example

$vevent->setProperty( "priority", 3 );

[index]

3.2.29 RDATE

This property defines the list of date/times for a recurrence set.

The default value type for RDATE is DATE-TIME, can be set to DATE or PERIOD (params 2).
get RDATE

Format

getProperty( "RDATE" )

output = dates1

getProperty( "RDATE", int propOrderNo/FALSE , TRUE )

output = array( "value" => dates1 , "params" => params2 )

Example

$rdates = $vevent->getProperty( "RDATE" );

Set RDATE

Format

setProperty( "rdate", dates [, params ] )

dates1 = array ( date2 *[, date2 ] ) date2 = date date2 = array( startdate, enddate/duration ) ] startdate = date enddate = date date = array( int year , int month , int day [, int int hour , int min , int day , mixed tz ] ) date = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec [, "tz => mixed tz ]] ) // output format date = array( "timestamp" => int timestamp [, "tz" => mixed tz ] ) date = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) tz = timezone / offset offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME duration = array( int week/false [, int day/false , int hour , int min , int sec] ) duration = array( "week" => int week/false [, "day" => int day/false [, "hour" => int hour , "min" => int min , "sec" => int sec ]] ); // output format duration = array( "week" => int week ); duration = array( "day" => int week ); duration = array( "hour" => int hour , "min" => int min , "sec" => int sec ); duration = array( "sec" => int sec ); params2 = ([( tzidparam / datetimeparam / dateparam ) / periodparam] *[, xparams ] ) tzidparam = timezone identifier // date output as local DATE-TIME with timezone identifier datetimeparam = "VALUE" => "DATE-TIME" // default, date output as DATE-TIME dateparam = "VALUE" => "DATE" // date output as DATE periodparam = "VALUE" => "PERIOD" // date output as PERIOD xparams = xparamkey => xparamvalue

Example

See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.

// $rdate1 = array ( 2001, 1, 1, 1, 1, 1 ); // alt. $rdate1 = array( "year" => 2001 , "month" => 1 , "day" => 1 , "hour" => 1 , "min" => 1 , "sec" => 1 , "tz" => "GMT" ); $rdate2 = array( 2002, 2, 2, 2, 2, 2, "GMT" ); $rdate3 = "3 March 2003 03.03.03"; $rdate4 = array( 2004, 4, 4, 4, 4, 4, "GMT" ); $rdate5 = array( 2005, 10, 5, 5, 5, 5 ); $rdur6 = array( "week" => 0 , "day" => 0 , "hour" => 5 , "min" => 5 , "sec" => 5 ); $rdur7 = array( 0, 0, 6 ); // duration for 6 hours $rdate8 = array( "year" => 2007, "month" => 7, "day" => 7 ); $vevent = new vevent(); $vevent->setProperty( "rdate", array( $rdate1 )); // one recurrence date, date in 7-params format (DATE-TIME) $vevent->setProperty( "rdate", array( $rdate1, $rdate2 )); // two dates, date 7-params format (DATE-TIME) $vevent->setProperty( "rdate", array( array( $rdate1, $rdate5 ) // Both fromdate and enddate must have 7 params (DATE-TIME) !!! , array( $rdate2, $rdur6 ) // duration , array( $rdate3, $rdur7 ) // period, pairs of fromdate <-> tom -date/-duration , array( $rdate4, $rdate5 )) ); .. .

[index]

3.2.30 RECURRENCE-ID

This property is used in conjunction with the UID and SEQUENCE property to identify a specific instance of a recurring VEVENT, VTODO or VJOURNAL calendar component.

The property value is the effective value of the DTSTART property of the recurrence instance. The default value type is DATE-TIME, can be set to DATE (params 2).
get RECURRENCE-ID

Format

getProperty( "RECURRENCE-ID" )

output = recurrIdDate1

getProperty( "RECURRENCE-ID", FALSE , TRUE )

output = array( "value" => recurrIdDate1 , "params" => params2 )

Example

$recurrDate = $vtodo->getProperty( "RECURRENCE-ID" );

Set RECURRENCE-ID

Format

setProperty( "recurrence-id", recurrIdDate [, params ] )

recurrIdDate1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec [, "tz" => mixed tz ]] ) recurrIdDate = int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] recurrIdDate = array( int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] ) recurrIdDate = array( "timestamp" => int timestamp [, "tz" => mixed tz ] ) recurrIdDate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) tz = timezone / offset offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME params2 = array( [ datetimeparam / dateparam ] [, rangeparam ] [, xparam ] ) datetimeparam = "VALUE" => "DATE-TIME" // default, date output as DATE-TIME dateparam = "VALUE" => "DATE" // date output as DATE rangeparam = "RANGE" => ( "THISANDPRIOR" / "THISANDFUTURE" ) // range parameter xparam = *[ xparamkey => xparamvalue ]

Example

$vtodo->setProperty( "recurrence-id", "3 March 2003 03.03.03" );

[index]

3.2.31 RELATED-TO

The property is used to represent a relationship or reference between one calendar component and another.

The property value consists of the persistent, globally unique identifier of another calendar component. This value would be represented in a calendar component by the UID property.

The value type for RELATED-TO is TEXT.
get RELATED-TO

Format

getProperty( "RELATED-TO" )

output = relid1

getProperty( "RELATED-TO", int propOrderNo/FALSE , TRUE )

output = array( "value" => relid1 , "params" => params2 )

Example

$relatedId = $vtodo->getProperty( "RELATED-TO" );

Set RELATED-TO

Format

setProperty( "Related-To", relid [, params ] )

relid1 = Value type TEXT. params2 = array( [ reltype ] [, xparam] ) reltype = "RELTYPE" => ("PARENT" (Default) / "CHILD" / "SIBLING" / iana-token / x-name) xparam = *[ xparamkey => xparamvalue ]

Example

$vtodo->setProperty( "related-to", "19960401-080045-4000F192713@host.com");

[index]

3.2.32 REPEAT

This property defines the number of time the ALARM should be repeated, after the initial trigger. If the ALARM triggers more than once, then this property MUST be specified along with the DURATION property.
get REPEAT

Format

getProperty( "REPEAT" )

output = repeatTimes1

getProperty( "REPEAT", FALSE , TRUE )

output = array( "value" => repeatTimes1 , "params" => xparam2 )

Example

$repeat = $vtodo->getProperty( "REPEAT" );

Set REPEAT

Format

setProperty( "repeat", repeatTimes [, xparam ] )

repeatTimes1 = Value type INTEGER xparam2 = array( *[ xparamkey => xparamvalue ] )

Example

$valarm->setProperty( "repeat", 2 );

[index]

3.2.33 REQUEST-STATUS

This property defines the status code returned for a scheduling request.
get REQUEST-STATUS

Format

getProperty( "REQUEST-STATUS" )

output = array( "statcode" => statcode1 , "text" => errtext2 [ , "extdata" => extraData 3 ] )

getProperty( "REQUEST-STATUS", int propOrderNo/FALSE, TRUE )

output = array( "value" => array( "statcode" => statcode1 , "text" => errtext2 [ , "extdata" => extraData3 ] ) , "params" => params4 )

Example

$requestStatus = $vtodo->getProperty( "REQUEST-STATUS" );

Set REQUEST-STATUS

Format

setProperty( "Request-Status" , statcode, errtext [, extraData/FALSE [, params ]] )

statcode1 = Hierarchical, numeric return status code (1*DIGIT *("." 1*DIGIT)) errtext2 = Textual status description extraData3 = Textual exception data. For example, the offending property name and value or complete property line. params4 = array( ["LANGUAGE" => "<lang>"] [, xparam ] ) xparam = *[ xparamkey => xparamvalue ]

Example

$vfreebusy->setProperty("request-status" , 2.0 , "Invalid property value" , "DTSTART:96-Apr-31");

[index]

3.2.34 RESOURCES

This property defines the equipment or resources anticipated for an activity specified by a calendar entity.

The value type for RESOURCES is TEXT.
get RESOURCES

Format

getProperty( "RESOURCES" )

output = resources1

getProperty( "RESOURCES", int propOrderNo/FALSE, TRUE )

output = array( "value" => resources1 , "params" => params2 )

Example

$resources = $vtodo->getProperty( "RESOURCES" );

Set RESOURCES

Format

setProperty( "resources", resources [, params ] )

resources1 = string resource / array( *resource ) resource = textual resources or subtypes of the calendar component, can be specified as a list of resources separated by the COMMA character. params2 = array([ "LANGUAGE" => "<lang>"] ) [, "ALTREP" => "<an alternate text representation, URI>"] [, xparam] xparam = *[ xparamkey => xparamvalue ]

Example

$vevent->setProperty( "resources", "COMPUTER PROJECTOR" );

[index]

3.2.35 RRULE

This property defines a rule or repeating pattern for recurring EVENTs, TODOs, or TIMEZONE definitions.
get RRULE

Format

getProperty( "RRULE" )

output = recur1

getProperty( "RRULE", int propOrderNo/FALSE, TRUE )

output = array( "value" => recur1 , "params" => xparam2 )

Example

$rrules = $vtodo->getProperty( "RRULE" );

Set RRULE

Format

setProperty( "rrule", recur [, xparam ] )

For rules example see Exrule format and in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.

recur1 = see Exrule xparam2 = array( *[ xparamkey => xparamvalue ] )

[index]

3.2.36 SEQUENCE

This property defines the revision sequence number of the calendar component within a sequence of revisions.
It is monotonically incremented by the ORGANIZER's CUA each time the ORGANIZER makes a significant revision to the calendar component. When the ORGANIZER makes changes to one of the following properties, the sequence number MUST be incremented: DTSTART, DTEND, DUE, RDATE, RRULE, EXDATE, EXRULE, STATUS. In addition, changes made by the ORGANIZER to other properties can also force the sequence number to be incremented. The ORGANIZER CUA MUST increment the sequence number when ever it makes changes to properties in the calendar component that the ORGANIZER deems will jeopardize the validity of the participation status of the Attendees. For example, changing the location of a meeting from one locale to another distant locale could effectively impact the participation status of the Attendees.
get SEQUENCE

Format

getProperty( "SEQUENCE" )

output = sequence1

getProperty( "SEQUENCE", FALSE , TRUE )

output = array( "value" => sequence1 , "params" => xparam2 )

Example

$sequence = $vtodo->getProperty( "SEQUENCE" );

Set SEQUENCE

Format

setProperty( "sequence" [, sequence [, xparam ]] )

sequence1 = Value type INTEGER xparam2 = array( *[ xparamkey => xparamvalue ] )

Example

$vevent->setProperty( "sequence", 2 );

// set sequence number to 2

$vevent->setProperty( "sequence" );

// force sequence number to be set to 1 or, if sequence exists, incremented by 1

[index]

3.2.37 STATUS

This property defines the overall status or confirmation for the calendar component.
get STATUS

Format

getProperty( "STATUS" )

output = status1

getProperty( "STATUS", FALSE , TRUE )

output = array( "value" => status1 , "params" => xparam2 )

Example

$status = $vtodo->getProperty( "STATUS" );

Set STATUS

Format

setProperty( "status", status [, xparam ] )

// Status values for a VEVENT status1 = "TENTATIVE" // Indicates event is tentative / "CONFIRMED" // Indicates event is definite / "CANCELLED" // Indicates event was cancelled // Status values for VTODO status1 = "NEEDS-ACTION" // Indicates to-do needs action / "COMPLETED" // Indicates to-do completed / "IN-PROCESS" // Indicates to-do in process of / "CANCELLED" // Indicates to-do was cancelled // Status values for VJOURNAL status1 = "DRAFT" // Indicates journal is draft / "FINAL" // Indicates journal is final / "CANCELLED" // Indicates journal is removed xparam2 = array( *[ xparamkey => xparamvalue ] )

Example

$vevent->setProperty( "Status", "COMPLETED" );

[index]

3.2.38 SUMMARY

This property defines a short ("one line") summary or subject for the calendar component. (In "rfc2445, Recommended Practices", up to 255 characters) (, analogous to a mail SUBJECT).

The value type for SUMMARY is TEXT.
get SUMMARY

Format

getProperty( "SUMMARY" )

output = summary1

getProperty( "SUMMARY", FALSE , TRUE )

output = array( "value" => summary1 , "params" => params2 )

Example

$summary = $vtodo->getProperty( "SUMMARY" );

Set SUMMARY

Format

setProperty( "summary", summary [, params ] )

summary1 = Value type TEXT, a short, one line summary about the activity or journal entry. params2 = array( ["LANGUAGE" => "<lang>"] [, "ALTREP" => "<an alternate text representation, URI>"] [, xparam ] ) xparam = *[ xparamkey => xparamvalue ]

Example

$vevent->setProperty( "summary", "This is a summary" );

[index]

3.2.39 TRANSP

This property defines whether an EVENT is transparent or not to busy time searches.
get TRANSP

Format

getProperty( "TRANSP" )

output = transp1

getProperty( "TRANSP", FALSE , TRUE )

output = array( "value" => transp1 , "params" => xparam2 )

Example

$transp = $vtodo->getProperty( "TRANSP" );

Set TRANSP

Format

setProperty( "transp", transp [, xparam ] )

transp1 = "OPAQUE" / "TRANSPARENT" xparam2 = array( *[ xparamkey => xparamvalue ] )

Example

$vevent->setProperty( "transp", "TRANSPARENT" );

[index]

3.2.40 TRIGGER

This property specifies when an ALARM will trigger.

The default value type is DURATION. The value type can be set to a DATE-TIME value type, in which case the value MUST specify an UTC formatted DATE-TIME value.
get TRIGGER

Format

getProperty( "TRIGGER" )

output = duration/date

getProperty( "TRIGGER", FALSE , TRUE )

output = array( "value" => duration/date ) , "params" => xparams ) duration = array( "week" => int week , "relatedstart" => bool relstart , "before" => bool before ) duration = array( "day" => int day , "hour" => int hour , "min" => int min , "sec" => int sec , "relatedstart" => bool relstart , "before" => bool before ) relstart = TRUE : related start, FALSE : related end before = TRUE : before relstart, FALSE : after relstart date = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec , "tz" => string offset ] xparams = array( *[ xparamkey => xparamvalue ] )

Example

$trigger = $vtodo->getProperty( "TRIGGER" );

Set TRIGGER

Format

setProperty( "trigger" , duration [ , bool relatedEnd=FALSE [ , bool after=FALSE [ , param ]]] ) setProperty( "trigger", duration2 [, param ]) setProperty( "trigger", date [, param ] ) setProperty( "trigger", int year/FALSE , int month/FALSE , int day/FALSE [, int week/FALSE [, int hour/FALSE , int min/FALSE , int sec/FALSE [, bool relatedEnd=FALSE [, bool after=FALSE [, string offset/FALSE [, array xparam ]]]]]] )

duration = array ( "week" => int week ) duration = array ( "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec ] ) duration2 = string dur-value = (["+"]/"-")"P"(dur-date/dur-time/dur-week) dur-date = dur-day [dur-time] dur-time = "T" (dur-hour / dur-minute / dur-second) dur-week = 1*DIGIT "W" dur-day = 1*DIGIT "D" dur-hour = 1*DIGIT "H" [dur-minute] dur-minute = 1*DIGIT "M" [dur-second] dur-second = 1*DIGIT "S" date1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec , "tz" => string offset ] ) date = array ( "timestamp" => int timestamp [, "tz" => string offset ] ) offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME date = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) param = array( [[ reltype ] / [ datetimeparam ]] [, xparams ] ) reltyp = "RELATED" => "START" (default) / "END" datetimeparam = "VALUE" => "DATE-TIME" xparam = *[ xparamkey => xparamvalue ]

Example 1

$valarm->setProperty( "trigger" , FALSE, FALSE, FALSE, FALSE, 1, 2, 3, TRUE, TRUE ); $valarm->setProperty( "trigger" , array ("hour"=>1,"min"=>2,"sec"=>3),TRUE,TRUE); $valarm->setProperty( "trigger" , "PT1H2M3S", array ( "related" => "end");

// duration, 1 hour 2 min 3 sec, after end

Example 2

$valarm->setProperty( "trigger" , FALSE, FALSE, FALSE, 1 ); $valarm->setProperty( "trigger" , array ( "week" => 1 )); $valarm->setProperty( "trigger" , "-P1W";

// duration, 1 week before start

Example 3

$valarm->setProperty( "trigger" , array( "year" => 2007 , "month" => 6 , "day" => 5, , "hour" => 2 , "min" => 2 , "sec" => 3 , "tz" => "-0200" ));

// local date + UTC offset => UTC DATE-TIME

Example 4

$valarm->setProperty( "trigger" , array( "year" => 2007 , "month" => 6 , "day" => 5, , "hour" => 2 , "min" => 2 , "sec" => 3 ));

// UTC DATE-TIME

[index]

3.2.41 TZID

This property specifies the text value that uniquely identifies the VTIMEZONE calendar component.

The value type for TZID is TEXT.
get TZID

Format

getProperty( "TZID" )

output = tzid1

getProperty( "TZID", FALSE , TRUE )

output = array( "value" => tzid1 , "params" => xparam2 )

Example

$tzid = $vtimezone->getProperty( "TZID" );

set TZID

Format

setProperty( "tzid", tzid [, xparam ] )

tzid1 = Value type TEXT xparam2 = array( *[ xparamkey => xparamvalue ] )

Example

$calendar = new vcalendar(); $timezone = new vtimezone(); $timezone->setProperty( "tzid", "US-Eastern" ); .. .

[index]

3.2.42 TZNAME

This property specifies the customary designation for a TIMEZONE description.

The value type for TZNAME is TEXT.
get TZNAME

Format

getProperty( "TZNAME" )

output = tzname1

getProperty( "TZNAME", int propOrderNo/FALSE, TRUE )

output = array( "value" => tzname1 , "params" => params2 )

Example

$tzname = $timezonestandard->getProperty( "TZNAME" );

Set TZNAME

Format

setProperty( "tzname", tzname [, params ] )

tzname1 = Value type TEXT params2 = array( [ "LANGUAGE" => "<lang>" ] [, xparam ] ) xparam=*[ xparamkey => xparamvalue ]

Example

$calendar = new vcalendar(); $timezone = new vtimezone(); $timezone->setProperty( "Tzid", "US-Eastern" ); $timezone->setProperty( "Last-Modified", "19870101" ); $timezonestandard = new vtimezone( "standard" ); $timezonestandard->setProperty( "tzname", "EST" ); .. .

[index]

3.2.43 TZOFFSETFROM

This property specifies the offset which is in use prior to this TIMEZONE observance.
get TZOFFSETFROM

Format

getProperty( "TZOFFSETFROM" )

output = tzoffsetfrom1

getProperty( "TZOFFSETFROM", FALSE , TRUE )

output = array( "value" => tzoffsetfrom1 , "params" => xparam2 )

Example

$tzoffsetfrom = $timezonestandard->getProperty( "TZOFFSETFROM" );

Set TZOFFSETFROM

Format

setProperty( "tzoffsetfrom", tzoffsetfrom [, xparam ] )

tzoffsetfrom1 = (+/-)HHmm[ss], UTC offset xparam2 = array( *[ xparamkey => xparamvalue ] )

Example

$calendar = new vcalendar(); $timezone = new vtimezone(); $timezone->setProperty( "Tzid", "US-Eastern" ); $timezone->setProperty( "Last-Modified", "19870101" ); $timezonestandard = new vtimezone( "standard" ); $timezonestandard->setProperty( "tzname", "EST" ); $timezonestandard->setProperty( "tzoffsetfrom", "-0500" ); .. .

[index]

3.2.44 TZOFFSETTO

This property specifies the offset which is in use in this TIMEZONE observance.
get TZOFFSETTO

Format

getProperty( "TZOFFSETTO" )

output = tzoffsetto1

getProperty( "TZOFFSETTO", FALSE , TRUE )

output = array( "value" => tzoffsetto1 , "params" => xparam2 )

Example

$tzoffsetto = $timezonestandard->getProperty( "TZOFFSETTO" );

Set TZOFFSETTO

Format

setproperty( "tzoffsetto", tzoffsetto [, xparam ] )

tzoffsetto1 = (+/-)HHmm[ss], UTC offset xparam2 = array( *[ xparamkey => xparamvalue ] )

Example

$calendar = new vcalendar(); $timezone = new vtimezone(); $timezone->setProperty( "Tzid", "US-Eastern" ); $timezone->setProperty( "Last-Modified", "19870101" ); $timezonestandard = new vtimezone( "standard" ); .. . $timezonedaylight = new vtimezone( "daylight" ); $timezonedaylight->setProperty( "tzoffsetto", "1345" ); .. .

[index]

3.2.45 TZURL

The TZURL provides a means for a VTIMEZONE component to point to a network location that can be used to retrieve an up-to-date version of itself.
get TZURL

Format

getProperty( "TZURL" )

output = tzurl1

getProperty( "TZURL", FALSE , TRUE )

output = array( "value" => tzurl1 , "params" => xparam2 )

Example

$tzurl = $timezonestandard->getProperty( "TZURL" );

set TZURL

Format

setProperty( "tzurl", tzurl [, xparam ] )

tzurl1 = Value type URI xparam2 = array( *[ xparamkey => xparamvalue ] )

Example

$tz = "http://zones.stds_r_us.net/tz/US-Eastern" ); $calendar = new vcalendar(); $timezone = new vtimezone(); $timezone->setProperty( "Tzid", "US-Eastern" ); $timezone->setProperty( "Last-Modified", "19870101T000000" ); $timezone->setProperty( "tzurl", $tz ); .. .

[index]

3.2.46 UID

The persistent, globally unique identifier for the calendar component. Unique_id, set at calendar level (setConfig), is used when auto-creating component uid.

The value type for UID is TEXT.
get UID

Format

getProperty( "UID" )

output = uid1

getProperty( "UID", FALSE , TRUE )

output = array( "value" => uid1 , "params" => xparam2 )

Example

$uid = $vevent->getProperty( "UID" );

Set UID
AUTO GENERATED at component creation but NOT in ALARM / VTIMEZONE components.
UID generated format :
date("Ymd\THisT")."-".[microseconds, 4 pos][random]."@".unique_id
random = 6 characters aA-zZ, 0-9

Format

setProperty( "uid", uid [, xparam ] )

uid1 = Value type TEXT xparam2 = array( *[ xparamkey => xparamvalue ] )

Example

$vevent->setProperty("uid","20070803T194810CEST-0123U3PXiX@domain.com");

[index]

3.2.47 URL

This property defines a Uniform Resource Locator (URL) associated with the iCalendar object.
get URL

Format

getProperty( "URL" )

output = url1

getProperty( "URL", FALSE , TRUE )

output = array "value" => url1 , "params" => xparam2 )

Example

$url = $vevent->getProperty( "URL" );

Set URL

Format

setProperty( "url", url [, xparam ] )

url1 = Value type URI xparam2 = array( *[ xparamkey => xparamvalue ] (

Example

$vtodo->setProperty( "url", "http://www.icaldomain.net" );

[index]

3.2.48 X-PROPERTY

Any calendar component property name with a "X-" prefix and text value. If x-prop with the same name exists, it will be replaced.
Get X-property

Format

getProperty()

output = array( propertyName1 , propertyData2 )

getProperty( FALSE, int propOrderNo/FALSE, TRUE )

output = array( propertyName1 , array ( "value" => propertyData2 ) , "params" => params 3))

Example 1

$v = new vcalendar(); $v->parse( "file.ics" ); while( $xprop = $v->getProperty( )) { .. .

// $xprop = array( propertyName1, propertyData2 )

Example 2

$v = new vcalendar(); $v->parse( "file.ics" ); while( $xprop = $v->getProperty( "X-ABC-MMSUBJ" )) { .. .

// $xprop = array( "X-ABC-MMSUBJ", propertyData2 )

Example 3

$v = new vcalendar(); $v->parse( "file.ics" ); while( $xprop = $v->getProperty( FALSE, FALSE, TRUE )) { .. .

// $xprop = array( propertyName1 // , array( "value" => propertyData2 ) // , "params" => params 3 )

Set X-property

Format

setProperty( propertyName, propertyData [, params ] )

propertyName1 = Any property name with a "X-" prefix propertyData2 = Value type TEXT params3 = array( ["LANGUAGE" => "<lang>"] [, xparam] ) xparam = *[ xparamkey => xparamvalue ]

Example

$component->setProperty("X-ABC-MMSUBJ", "http://load.noise.org/mysubj.wav");

[index]

3.3 Calendar Component configuration functions

3.3.1 Language

Language for specific calendar component as defined in [RFC 1766]. Language set at component level can be overridden by specific component property parameter.
Get language
Language for calendar (only if language is set at component level).

Format

getConfig( "language" )

Example

$lang = $vevent->getConfig( "language" );

Set LANGUAGE

Format

setConfig( "language", string <lang> )

Example

$vevent->setConfig( "language", "en" );

[index]

3.4 Calendar component object misc. functions

Calendar component subcomponent functions

3.4.1 deleteComponent

Remove subcomponent from component.

Format

deleteComponent( int orderNumber )

Remove component with order number (1st=1, 2nd=2.. .).

deleteComponent( string componentType [, int componentSuborderNumber])

Remove component with component type (ex. "vevent") and order 1 alt. suborder number.

deleteComponent( string UID )

Remove component with UID. N.B UID is NOT set for ALARM / timzone components.

Example

$v = new vcalendar(); $v->parse( "file.ics" ); $comp1 = $v->getComponent(); $comp1->deleteComponent( 1 ); .. .

[index]

3.4.2 getComponent

Get subComponent from component.

Format

getComponent()

Get next component until end-of-components.

getComponent( int orderNumber )

Get component with order number (1st=1, 2nd=2.. .).

getComponent( string componentType [, int componentSuborderNumber])

Get (next) component with component type (until end-of-components) alt. component with component type and suborder number (1st=1, 2nd=2..).

getComponent( string UID )

Get component with UID. N.B UID is NOT set for ALARM / timzone components.

Example

$v = new vcalendar(); $v->parse( "file.ics" ); $comp1 = $v->getComponent()); while( $subComp = $comp1->getComponent()) { .. .

[index]

3.4.3 setComponent

Add calendar component to calendar or replace/update component in calendar.

Format

setComponent( component ) addSubComponent( component ) // alias

Insert last in component chain.

setComponent( component, int orderNumber )

Replace component with order number(1st=1, 2nd=2.. .). If orderNumber is not found, component is inserted last in chain.

setComponent( component, string componentType [,component suborder number])

Replace component with component type and component order number. if orderNumber is not found, component is inserted last in chain.

setComponent( component, string UID )

Replace component with UID. N.B UID is NOT set for ALARM / timzone components.

Example

$calendar = new vcalendar(); // initiate new CALENDAR .. . $vevent = new vevent(); // initiate EVENT $vevent->setProperty( "dtstart" // add some EVENT properties , 2006, 12, 24, 19, 30, 00 ); $vevent->setProperty(.. . .. . $valarm = new valarm(); // initiate ALARM and set some properties $valarm->setProperty( "trigger", .. . .. . $vevent->setComponent ( $valarm ); // add ALARM to .. .

[index]

4. COPYRIGHT AND LICENSE

Copyright

iCalcreator class
copyright (c) 2007-2008 Kjell-Inge Gustafsson, kigkonsult
www.kigkonsult.se/iCalcreator/index.php
ical@kigkonsult.se

License

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or download it here.

[index]