dolibarr  20.0.0-beta
Public Member Functions | List of all members
ICal Class Reference

Class to read/parse ICal calendars. More...

Public Member Functions

 __construct ()
 Constructor.
 
 read_file ($file)
 Read text file, icalender text file. More...
 
 get_event_count ()
 Returns the number of calendar events. More...
 
 get_todo_count ()
 Returns the number of to do. More...
 
 parse ($uri, $usecachefile='', $delaycache=3600)
 Translate Calendar. More...
 
 add_to_array ($type, $key, $value)
 Add to $this->ical array one value and key. More...
 
 retun_key_value ($text)
 Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value");. More...
 
 ical_rrule ($value)
 Parse RRULE return array. More...
 
 ical_date_to_unix ($ical_date)
 Return Unix time from ical date time format (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS) More...
 
 ical_dt_date ($key, $value)
 Return unix date from iCal date format. More...
 
 get_sort_event_list ()
 Return sorted eventlist as array or false if calendar is empty. More...
 
 ical_dtstart_compare ($a, $b)
 Compare two unix timestamp. More...
 
 get_event_list ()
 Return eventlist array (not sorted eventlist array) More...
 
 get_freebusy_list ()
 Return freebusy array (not sort eventlist array) More...
 
 get_todo_list ()
 Return to do array (not sorted todo array) More...
 
 get_calender_data ()
 Return base calendar data. More...
 
 get_all_data ()
 Return array with all data. More...
 

Detailed Description

Class to read/parse ICal calendars.

Definition at line 35 of file ical.class.php.

Member Function Documentation

◆ add_to_array()

ICal::add_to_array (   $type,
  $key,
  $value 
)

Add to $this->ical array one value and key.

Parameters
string$typeType ('VTODO', 'VEVENT', 'VFREEBUSY', 'VCALENDAR'...)
string$keyKey ('DTSTART', ...). Note: Field is never 'DTSTART;TZID=...' because ';...' was before removed and added as another property
string$valueValue
Returns
void

Definition at line 270 of file ical.class.php.

◆ get_all_data()

ICal::get_all_data ( )

Return array with all data.

Returns
array

Definition at line 510 of file ical.class.php.

◆ get_calender_data()

ICal::get_calender_data ( )

Return base calendar data.

Returns
array

Definition at line 498 of file ical.class.php.

◆ get_event_count()

ICal::get_event_count ( )

Returns the number of calendar events.

Returns
int

Definition at line 117 of file ical.class.php.

◆ get_event_list()

ICal::get_event_list ( )

Return eventlist array (not sorted eventlist array)

Returns
array

Definition at line 462 of file ical.class.php.

Referenced by get_sort_event_list().

◆ get_freebusy_list()

ICal::get_freebusy_list ( )

Return freebusy array (not sort eventlist array)

Returns
array

Definition at line 474 of file ical.class.php.

◆ get_sort_event_list()

ICal::get_sort_event_list ( )

Return sorted eventlist as array or false if calendar is empty.

Returns
array|false

Definition at line 430 of file ical.class.php.

References get_event_list().

◆ get_todo_count()

ICal::get_todo_count ( )

Returns the number of to do.

Returns
int

Definition at line 129 of file ical.class.php.

◆ get_todo_list()

ICal::get_todo_list ( )

Return to do array (not sorted todo array)

Returns
array

Definition at line 486 of file ical.class.php.

◆ ical_date_to_unix()

ICal::ical_date_to_unix (   $ical_date)

Return Unix time from ical date time format (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS)

Parameters
string$ical_dateString date
Returns
int

Definition at line 375 of file ical.class.php.

◆ ical_dt_date()

ICal::ical_dt_date (   $key,
  $value 
)

Return unix date from iCal date format.

Parameters
string$keyKey. Example: 'DTSTART', 'DTSTART;TZID=US-Eastern'
string$valueValue. Example: '19970714T133000', '19970714T173000Z', '19970714T133000'
Returns
array{0:string,1:int}|array{0:string,1:array<string,int|string>}

Definition at line 401 of file ical.class.php.

◆ ical_dtstart_compare()

ICal::ical_dtstart_compare (   $a,
  $b 
)

Compare two unix timestamp.

Parameters
array$aOperand a
array$bOperand b
Returns
integer

Definition at line 450 of file ical.class.php.

◆ ical_rrule()

ICal::ical_rrule (   $value)

Parse RRULE return array.

Parameters
string$valuestring
Returns
array

Definition at line 356 of file ical.class.php.

◆ parse()

ICal::parse (   $uri,
  $usecachefile = '',
  $delaycache = 3600 
)

Translate Calendar.

Parameters
string$uriUrl
string$usecachefileFull path of a cache file to use a cache file
int$delaycacheDelay in seconds for cache (by default 3600 secondes)
Returns
array|string

Definition at line 143 of file ical.class.php.

◆ read_file()

ICal::read_file (   $file)

Read text file, icalender text file.

Parameters
string$fileFile
Returns
string|null Content of remote file read or null if error

Definition at line 92 of file ical.class.php.

References getURLContent().

◆ retun_key_value()

ICal::retun_key_value (   $text)

Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value");.

Parameters
string$textText
Returns
array

Definition at line 331 of file ical.class.php.


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