PHP Class Kronolith_Event, horde

Author: Chuck Hagenbuch ([email protected])
Author: Jan Schneider ([email protected])
Mostrar archivo Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$alarm integer Number of minutes before the event starts to trigger an alarm.
$allday boolean Whether this is an all-day event.
$attendees Kronolith_Attendee_List All the attendees of this event.
$baseid string The baseid. For events that represent exceptions this is the UID of the original, recurring event.
$calendar string The identifier of the calender this event exists on.
$calendarType string The type of the calender this event exists on.
$created Horde_Date The creation time.
$createdby string The creator string.
$description string The description for this event.
$durMin integer The duration of this event in minutes
$end Horde_Date The end time of the event.
$exceptionoriginaldate Horde_Date For exceptions, the date of the original recurring event that this is an exception for.
$first boolen Whether this is the event on the first day of a multi-day event.
$icon string URL to an icon of this event.
$initialized boolean Flag that is set to true if this event has data from either a storage backend or a form or other import method.
$last boolen Whether this is the event on the last day of a multi-day event.
$location string The location this event occurs at.
$methods array The particular alarm methods overridden for this event.
$modified Horde_Date The last modification time.
$modifiedby string The last-modifier string.
$organizer string The email address of the organizer of the event, if known.
$private boolean Whether the event is private.
$recurrence Horde_Date_Recurrence The Horde_Date_Recurrence class for this event.
$recurrenceid integer The iCalendar RECURRENCE-ID for this event exception.
$sequence integer The iCalendar SEQUENCE for this event.
$start Horde_Date The start time of the event.
$status integer The status of this event.
$stored boolean Flag that is set to true if this event exists in a storage driver.
$timezone string The timezone of this event.
$title string For displaying in the interface use getTitle() instead.
$uid string The UID for this event.
$url string URL of this event.

Protected Properties

Property Type Description
$_backgroundColor string The HTML background color to be used for this event.
$_creator string The user id of the creator of the event.
$_duration stdClass The cached event duration, split up in time units.
$_foregroundColor string The HTML foreground color to be used for this event.
$_geoLocation array Geolocation
$_id string The driver unique identifier for this event.
$_indent integer Used in view renderers.
$_internaltags array Event tags from the storage backend (e.g. Kolab)
$_originalEnd Horde_Date The original end time of the event.
$_originalStart Horde_Date This may differ from $start on multi-day events where $start is the start time on the current day. For recurring events this is the start time of the current recurrence.
$_overlap integer Used in view renderers.
$_resources array This is an associative array where keys are resource uids, values are associative arrays with keys attendance and response.
$_rowspan integer Used in view renderers.
$_snooze integer Snooze minutes for this event's alarm.
$_span integer Used in view renderers.
$_tags array | string This tag's events.
$_vfs Horde_Vfs VFS handler

Public Methods

Method Description
__construct ( Kronolith_Driver $driver, mixed $eventObject = null ) Constructor.
__get ( string $name ) : mixed Getter.
__set ( string $name, mixed $value ) Setter.
addAttendee ( string $email, integer $role, integer | boolean $response, string $name = null ) Adds a new attendee to the current event.
addEASFiles ( $message )
addFile ( array $info ) Saves a file into the VFS backend associated with this event.
addFileFromData ( $info )
addResource ( Kronolith_Resource $resource, $response ) Adds a single resource to this event.
boundExceptions ( boolean $flat = true ) : array Returns a list of events that represent exceptions to this event's recurrence series, if any. If this event does not recur, an empty array is returned.
deleteFile ( string $file ) Deletes a file from the VFS backend associated with this event.
deleteFiles ( ) Deletes all files from the VFS backend associated with this event.
disconnectExceptions ( boolean $delete = false ) Disconnect any existing exceptions.
exceptionLink ( string $date ) : string Returns a correcty formatted exception date for recurring events and a link to delete this exception.
exceptionsList ( ) : string Returns a list of exception dates for recurring events including links to delete them.
exists ( ) : boolean Checks if the current event is already present in the calendar.
fromASAppointment ( Horde_ActiveSync_Message_Appointment $message ) Imports the values for this event from a MS ActiveSync Message.
fromDriver ( $event ) Imports a backend specific event object.
fromHash ( array $hash ) Imports the values for this event from an array of values.
fromiCalendar ( Horde_Icalendar_Vevent $vEvent, boolean $parseAttendees = false ) Updates the properties of this event from a Horde_Icalendar_Vevent object.
getCSSColors ( boolean $with_attribute = true ) : string Returns the CSS color definition for this event.
getDeleteUrl ( array $params = [], $full = false ) : Horde_Url
getDriver ( ) : Kronolith_Driver Returns a reference to a driver that's valid for this event.
getDuration ( )
getEditUrl ( array $params = [], $full = false ) : Horde_Url
getExportUrl ( array $params = [], $full = false ) : Horde_Url
getLink ( $datetime = null, $icons = true, $from_url = null, $full = false, $encoded = true )
getLocation ( string $user = null ) : string Returns the location of this event, considering private flags.
getRecurName ( ) : string Returns a description of this event's recurring type.
getResources ( ) : array Returns all resources.
getShare ( ) : Horde_Share Returns the share this event belongs to.
getStatusClass ( ) : string
getTimeRange ( ) : string
getTitle ( string $user = null ) : string Returns the title of this event, considering private flags.
getTooltip ( ) : string
getVfsUid ( ) : string Return a unique id suitable for identifying this event in the VFS. Takes into account there may be multiple users with access to the same UID in different calendars.
getViewUrl ( array $params = [], $full = false, $encoded = true ) : Horde_Url
hasAttendee ( string $email, boolean $case_sensitive = false, array $attendees = null ) : boolean Checks to see whether the specified attendee is associated with the current event.
hasPermission ( integer $permission, string $user = null ) : boolean Encapsulates permissions checking.
html ( $property )
isAllDay ( )
isPrivate ( string $user = null ) : boolean Returns whether the event should be considered private.
listFiles ( ) : array Returns all files from the VFS backend associated with this event.
loadHistory ( ) Retrieves history information for this event from the history backend.
readForm ( Kronolith_Event $existing = null ) Reads form/post data and updates this event's properties.
readRecurrenceForm ( $start, $timezone, $recurrence = null )
recurs ( ) : boolean Returns whether this event is a recurring event.
removeResource ( Kronolith_Resource $resource ) Removes a resource from this event.
save ( ) : integer Saves changes to this event.
setResources ( array $resources ) Set the entire resource array. Only used when copying an Event.
setTimezone ( $to_original ) Converts this event between the event's and the local timezone.
synchronizeTags ( array $tags ) Syncronizes tags from the tagging backend with the task storage backend, if necessary.
toASAppointment ( array $options = [] ) : Horde_ActiveSync_Message_Appointment Export this event as a MS ActiveSync Message
toAlarm ( Horde_Date $time, string $user = null, Prefs $prefs = null ) : array Returns an alarm hash of this event suitable for Horde_Alarm.
toJson ( array $options = [] ) : stdClass Returns a simple object suitable for json transport representing this event.
toiCalendar ( Horde_Icalendar $calendar, boolean $includeFiles = true ) : array Exports this event in iCalendar format.
vfsDisplayUrl ( array $file ) : string Returns a link to display and download a file from the VFS backend associated with this object.
vfsEditUrl ( array $file ) : string Returns a link to display, download, and delete a file from the VFS backend associated with this object.
vfsInit ( ) : Horde_Vfs Loads the VFS configuration and initializes the VFS backend.

Protected Methods

Method Description
_addEASFile ( Horde_ActiveSync_Message_AirSyncBaseAdd $add )
_formIDEncode ( $id )
_getEASFileReference ( $filename )
_handleEas16Exception ( Horde_ActiveSync_Message_Appointment $message ) : boolean Handle adding/editing exceptions from EAS 16.0 clients.
_handleResources ( Kronolith_Event $existing = null ) Handles updating/saving this event's resources. Unless this event recurs, this will delete this event from any resource calendars that are no longer needed (as when a resource is removed from an existing event). If this event is an exception, i.e., contains a baseid, AND $existing is provided, the resources from the original event are used for purposes of determining any resources that need to be removed.
_handlevEventRecurrence ( Horde_Icalendar $vEvent ) Handle parsing recurrence related fields.

Method Details

__construct() public method

Constructor.
public __construct ( Kronolith_Driver $driver, mixed $eventObject = null )
$driver Kronolith_Driver The backend driver that this event is stored in.
$eventObject mixed Backend specific event object that this will represent.

__get() public method

Returns the 'id' and 'creator' properties.
public __get ( string $name ) : mixed
$name string Property name.
return mixed Property value.

__set() public method

Sets the 'id' and 'creator' properties.
public __set ( string $name, mixed $value )
$name string Property name.
$value mixed Property value.

_addEASFile() protected method

protected _addEASFile ( Horde_ActiveSync_Message_AirSyncBaseAdd $add )
$add Horde_ActiveSync_Message_AirSyncBaseAdd

_formIDEncode() protected method

protected _formIDEncode ( $id )

_getEASFileReference() protected method

protected _getEASFileReference ( $filename )

_handleEas16Exception() protected method

Handle adding/editing exceptions from EAS 16.0 clients.
protected _handleEas16Exception ( Horde_ActiveSync_Message_Appointment $message ) : boolean
$message Horde_ActiveSync_Message_Appointment
return boolean

_handleResources() protected method

Handles updating/saving this event's resources. Unless this event recurs, this will delete this event from any resource calendars that are no longer needed (as when a resource is removed from an existing event). If this event is an exception, i.e., contains a baseid, AND $existing is provided, the resources from the original event are used for purposes of determining any resources that need to be removed.
Since: 4.2.6
protected _handleResources ( Kronolith_Event $existing = null )
$existing Kronolith_Event An existing base event.

_handlevEventRecurrence() protected method

Handle parsing recurrence related fields.
protected _handlevEventRecurrence ( Horde_Icalendar $vEvent )
$vEvent Horde_Icalendar

addAttendee() public method

This will overwrite an existing attendee if one exists with the same email address.
public addAttendee ( string $email, integer $role, integer | boolean $response, string $name = null )
$email string The email address of the attendee.
$role integer The role code of the attendee.
$response integer | boolean The response code of the attendee.
$name string The name of the attendee.

addEASFiles() public method

public addEASFiles ( $message )

addFile() public method

Saves a file into the VFS backend associated with this event.
public addFile ( array $info )
$info array A hash with the file information as returned from a Horde_Form_Type_file.

addFileFromData() public method

public addFileFromData ( $info )

addResource() public method

No validation or acceptence/denial is done here...it should be done when saving the event.
public addResource ( Kronolith_Resource $resource, $response )
$resource Kronolith_Resource The resource to add.

boundExceptions() public method

Returns a list of events that represent exceptions to this event's recurrence series, if any. If this event does not recur, an empty array is returned.
Since: 4.2.2
public boundExceptions ( boolean $flat = true ) : array
$flat boolean If true (the default), returns a flat array containing Kronolith_Event objects. If false, results are in the format of listEvents calls. @see Kronolith::listEvents().
return array An array of Kronolith_Event objects whose baseid property is equal to this event's uid. I.e., it is a bound exception.

deleteFile() public method

Deletes a file from the VFS backend associated with this event.
public deleteFile ( string $file )
$file string The file name.

deleteFiles() public method

Deletes all files from the VFS backend associated with this event.
public deleteFiles ( )

disconnectExceptions() public method

Disconnect any existing exceptions.
public disconnectExceptions ( boolean $delete = false )
$delete boolean If true, disconnected exceptions will be deleted completely.

exceptionsList() public method

Returns a list of exception dates for recurring events including links to delete them.
public exceptionsList ( ) : string
return string List of exception dates and delete links.

exists() public method

Does the check based on the uid.
public exists ( ) : boolean
return boolean True if event exists, false otherwise.

fromASAppointment() public method

Imports the values for this event from a MS ActiveSync Message.
public fromASAppointment ( Horde_ActiveSync_Message_Appointment $message )
$message Horde_ActiveSync_Message_Appointment

fromDriver() public method

Imports a backend specific event object.
public fromDriver ( $event )

fromHash() public method

Imports the values for this event from an array of values.
public fromHash ( array $hash )
$hash array Array containing all the values.

fromiCalendar() public method

Updates the properties of this event from a Horde_Icalendar_Vevent object.
public fromiCalendar ( Horde_Icalendar_Vevent $vEvent, boolean $parseAttendees = false )
$vEvent Horde_Icalendar_Vevent The iCalendar data to update from.
$parseAttendees boolean Parse attendees too? @since Kronolith 4.2

getCSSColors() public method

Returns the CSS color definition for this event.
public getCSSColors ( boolean $with_attribute = true ) : string
$with_attribute boolean Whether to wrap the colors inside a "style" attribute.
return string A CSS string with color definitions.

getDeleteUrl() public method

public getDeleteUrl ( array $params = [], $full = false ) : Horde_Url
$params array
return Horde_Url

getDriver() public method

Returns a reference to a driver that's valid for this event.
public getDriver ( ) : Kronolith_Driver
return Kronolith_Driver A driver that this event can use to save itself, etc.

getDuration() public method

public getDuration ( )

getEditUrl() public method

public getEditUrl ( array $params = [], $full = false ) : Horde_Url
$params array
return Horde_Url

getExportUrl() public method

public getExportUrl ( array $params = [], $full = false ) : Horde_Url
$params array
return Horde_Url

getLocation() public method

Returns the location of this event, considering private flags.
public getLocation ( string $user = null ) : string
$user string The current user.
return string The location of this event.

getRecurName() public method

Returns a description of this event's recurring type.
public getRecurName ( ) : string
return string Human readable recurring type.

getResources() public method

Returns all resources.
public getResources ( ) : array
return array A copy of the resources array.

getShare() public method

Returns the share this event belongs to.
public getShare ( ) : Horde_Share
return Horde_Share This event's share.

getStatusClass() public method

public getStatusClass ( ) : string
return string The CSS class for the event based on its status.

getTimeRange() public method

public getTimeRange ( ) : string
return string The time range of the event ("All Day", "1:00pm-3:00pm", "08:00-22:00").

getTitle() public method

Returns the title of this event, considering private flags.
public getTitle ( string $user = null ) : string
$user string The current user.
return string The title of this event.

getTooltip() public method

public getTooltip ( ) : string
return string A tooltip for quick descriptions of this event.

getVfsUid() public method

Return a unique id suitable for identifying this event in the VFS. Takes into account there may be multiple users with access to the same UID in different calendars.
public getVfsUid ( ) : string
return string The unique id.

getViewUrl() public method

public getViewUrl ( array $params = [], $full = false, $encoded = true ) : Horde_Url
$params array
return Horde_Url

hasAttendee() public method

Checks to see whether the specified attendee is associated with the current event.
public hasAttendee ( string $email, boolean $case_sensitive = false, array $attendees = null ) : boolean
$email string The email address of the attendee.
$case_sensitive boolean Match in a case sensitive manner. @since 4.3.0
$attendees array Search that attendee list instead of this event's. @since 4.3.0
return boolean True if the specified attendee is present for this event.

hasPermission() public method

Encapsulates permissions checking.
public hasPermission ( integer $permission, string $user = null ) : boolean
$permission integer The permission to check for.
$user string The user to check permissions for.
return boolean

html() public method

public html ( $property )

isAllDay() public method

public isAllDay ( )

isPrivate() public method

Returns whether the event should be considered private.
public isPrivate ( string $user = null ) : boolean
$user string The current user. If omitted, uses the current user.
return boolean Whether to consider the event as private.

listFiles() public method

Returns all files from the VFS backend associated with this event.
public listFiles ( ) : array
return array A list of hashes with file informations.

loadHistory() public method

Retrieves history information for this event from the history backend.
public loadHistory ( )

readForm() public method

Reads form/post data and updates this event's properties.
public readForm ( Kronolith_Event $existing = null )
$existing Kronolith_Event If this is an exception event this is taken as the base event. @since 4.2.6

readRecurrenceForm() public static method

public static readRecurrenceForm ( $start, $timezone, $recurrence = null )

recurs() public method

Returns whether this event is a recurring event.
public recurs ( ) : boolean
return boolean True if this is a recurring event.

removeResource() public method

Removes a resource from this event.
public removeResource ( Kronolith_Resource $resource )
$resource Kronolith_Resource The resource to remove.

save() public method

Saves changes to this event.
public save ( ) : integer
return integer The event id.

setResources() public method

Set the entire resource array. Only used when copying an Event.
Since: 4.2.6
public setResources ( array $resources )
$resources array The resource array.

setTimezone() public method

Converts this event between the event's and the local timezone.
public setTimezone ( $to_original )

synchronizeTags() public method

Syncronizes tags from the tagging backend with the task storage backend, if necessary.
public synchronizeTags ( array $tags )
$tags array Tags from the tagging backend.

toASAppointment() public method

Export this event as a MS ActiveSync Message
public toASAppointment ( array $options = [] ) : Horde_ActiveSync_Message_Appointment
$options array Options: - protocolversion: (float) The EAS version to support DEFAULT: 2.5 - bodyprefs: (array) A BODYPREFERENCE array. DEFAULT: none (No body prefs enforced). - truncation: (integer) Truncate event body to this length DEFAULT: none (No truncation).
return Horde_ActiveSync_Message_Appointment

toAlarm() public method

Returns an alarm hash of this event suitable for Horde_Alarm.
public toAlarm ( Horde_Date $time, string $user = null, Prefs $prefs = null ) : array
$time Horde_Date Time of alarm.
$user string The user to return alarms for.
$prefs Prefs A Prefs instance.
return array Alarm hash or null.

toJson() public method

Possible properties are: - t: title - d: description - c: calendar id - s: start date - e: end date - fi: first day of a multi-day event - la: last day of a multi-day event - x: status (Kronolith::STATUS_* constant) - al: all-day? - bg: background color - fg: foreground color - pe: edit permissions? - pd: delete permissions? - vl: variable, i.e. editable length? - a: alarm text or minutes - r: recurrence type (Horde_Date_Recurrence::RECUR_* constant) - bid: The baseid for an event representing an exception - eod: The original date that an exception is replacing - ic: icon - ln: link - aj: ajax link - id: event id - ty: calendar type (driver) - l: location - u: url - sd: formatted start date - st: formatted start time - ed: formatted end date - et: formatted end time - at: attendees - rs: resources - tg: tag list - mt: meeting (Boolean true if event has attendees, false otherwise). - cb: created by (string describing when and who created the event). - mb: modified by (string describing when and who last modified event). - o: organizer (if known) - oy: organizer you - cr: creator's attendance response - fs: Array of attached files.
public toJson ( array $options = [] ) : stdClass
$options array An array of options: - all_day: (boolean) If not null, overrides whether the event is an all-day event. DEFAULT: null (Do not override). - full: (boolean) Whether to return all event details. DEFAULT: false (Do not return all details). - time_format: (string) The date() format to use for time formatting. DEFAULT: 'H:i' - history: (boolean) If true, ensures that this event's history is loaded from the History backend. DEFAULT: false (Do not ensure history is loaded).
return stdClass A simple object.

toiCalendar() public method

Exports this event in iCalendar format.
public toiCalendar ( Horde_Icalendar $calendar, boolean $includeFiles = true ) : array
$calendar Horde_Icalendar A Horde_Icalendar object that acts as a container.
$includeFiles boolean Include attached files in the iCalendar file? @since 4.3.0
return array An array of Horde_Icalendar_Vevent objects for this event.

vfsDisplayUrl() public method

Returns a link to display and download a file from the VFS backend associated with this object.
public vfsDisplayUrl ( array $file ) : string
$file array The file information hash as returned from self::listFiles.
return string The HTML code of the generated link.

vfsEditUrl() public method

Returns a link to display, download, and delete a file from the VFS backend associated with this object.
public vfsEditUrl ( array $file ) : string
$file array The file information hash as returned from self::listFiles.
return string The HTML code of the generated link.

vfsInit() public method

Loads the VFS configuration and initializes the VFS backend.
public vfsInit ( ) : Horde_Vfs
return Horde_Vfs A VFS object.

Property Details

$_backgroundColor protected_oe property

The HTML background color to be used for this event.
protected string $_backgroundColor
return string

$_creator protected_oe property

The user id of the creator of the event.
protected string $_creator
return string

$_duration protected_oe property

The cached event duration, split up in time units.
See also: getDuration()
protected stdClass $_duration
return stdClass

$_foregroundColor protected_oe property

The HTML foreground color to be used for this event.
protected string $_foregroundColor
return string

$_geoLocation protected_oe property

Geolocation
protected array $_geoLocation
return array

$_id protected_oe property

The driver unique identifier for this event.
protected string $_id
return string

$_indent protected_oe property

Used in view renderers.
protected int $_indent
return integer

$_internaltags protected_oe property

Event tags from the storage backend (e.g. Kolab)
protected array $_internaltags
return array

$_originalEnd protected_oe property

The original end time of the event.
protected Horde_Date $_originalEnd
return Horde_Date

$_originalStart protected_oe property

This may differ from $start on multi-day events where $start is the start time on the current day. For recurring events this is the start time of the current recurrence.
protected Horde_Date $_originalStart
return Horde_Date

$_overlap protected_oe property

Used in view renderers.
protected int $_overlap
return integer

$_resources protected_oe property

This is an associative array where keys are resource uids, values are associative arrays with keys attendance and response.
protected array $_resources
return array

$_rowspan protected_oe property

Used in view renderers.
protected int $_rowspan
return integer

$_snooze protected_oe property

Snooze minutes for this event's alarm.
See also: Horde_Alarm::snooze()
protected int $_snooze
return integer

$_span protected_oe property

Used in view renderers.
protected int $_span
return integer

$_tags protected_oe property

This tag's events.
protected array|string $_tags
return array | string

$_vfs protected_oe property

VFS handler
protected Horde_Vfs $_vfs
return Horde_Vfs

$alarm public_oe property

Number of minutes before the event starts to trigger an alarm.
public int $alarm
return integer

$allday public_oe property

Whether this is an all-day event.
public bool $allday
return boolean

$attendees public_oe property

All the attendees of this event.
public Kronolith_Attendee_List $attendees
return Kronolith_Attendee_List

$baseid public_oe property

The baseid. For events that represent exceptions this is the UID of the original, recurring event.
public string $baseid
return string

$calendar public_oe property

The identifier of the calender this event exists on.
public string $calendar
return string

$calendarType public_oe property

The type of the calender this event exists on.
public string $calendarType
return string

$created public_oe property

The creation time.
See also: loadHistory()
public Horde_Date $created
return Horde_Date

$createdby public_oe property

The creator string.
See also: loadHistory()
public string $createdby
return string

$description public_oe property

The description for this event.
public string $description
return string

$durMin public_oe property

The duration of this event in minutes
public int $durMin
return integer

$end public_oe property

The end time of the event.
public Horde_Date $end
return Horde_Date

$exceptionoriginaldate public_oe property

For exceptions, the date of the original recurring event that this is an exception for.
public Horde_Date $exceptionoriginaldate
return Horde_Date

$first public_oe property

Whether this is the event on the first day of a multi-day event.
public boolen $first
return boolen

$icon public_oe property

URL to an icon of this event.
public string $icon
return string

$initialized public_oe property

Flag that is set to true if this event has data from either a storage backend or a form or other import method.
public bool $initialized
return boolean

$last public_oe property

Whether this is the event on the last day of a multi-day event.
public boolen $last
return boolen

$location public_oe property

The location this event occurs at.
public string $location
return string

$methods public_oe property

The particular alarm methods overridden for this event.
public array $methods
return array

$modified public_oe property

The last modification time.
See also: loadHistory()
public Horde_Date $modified
return Horde_Date

$modifiedby public_oe property

The last-modifier string.
See also: loadHistory()
public string $modifiedby
return string

$organizer public_oe property

The email address of the organizer of the event, if known.
public string $organizer
return string

$private public_oe property

Whether the event is private.
public bool $private
return boolean

$recurrence public_oe property

The Horde_Date_Recurrence class for this event.
public Horde_Date_Recurrence $recurrence
return Horde_Date_Recurrence

$recurrenceid public_oe property

The iCalendar RECURRENCE-ID for this event exception.
public int $recurrenceid
return integer

$sequence public_oe property

The iCalendar SEQUENCE for this event.
public int $sequence
return integer

$start public_oe property

The start time of the event.
public Horde_Date $start
return Horde_Date

$status public_oe property

The status of this event.
public int $status
return integer

$stored public_oe property

Flag that is set to true if this event exists in a storage driver.
public bool $stored
return boolean

$timezone public_oe property

The timezone of this event.
public string $timezone
return string

$title public_oe property

For displaying in the interface use getTitle() instead.
public string $title
return string

$uid public_oe property

The UID for this event.
public string $uid
return string

$url public_oe property

URL of this event.
public string $url
return string