\Kronolith

Kronolith base library.

The Kronolith class provides functionality common to all of Kronolith.

Summary

Methods
Properties
Constants
permissionToJson()
listAlarms()
search()
listEvents()
mergeEvents()
addEvents()
addCoverDates()
addSearchEvents()
countEvents()
quickAdd()
initialize()
getUserName()
getUserEmail()
isUserEmail()
validateUserAttendee()
recurToString()
statusToString()
responseToString()
partToString()
responseFromICal()
buildStatusWidget()
listInternalCalendars()
listCalendars()
getDefaultCalendar()
getSyncCalendars()
addCalendarLinks()
getLabel()
hasPermission()
addShare()
updateShare()
deleteShare()
listShareUsers()
readPermsForm()
subscribeRemoteCalendar()
unsubscribeRemoteCalendar()
feedUrl()
embedCode()
attendeeList()
sendITipNotifications()
sendNotification()
notifyOfResourceRejection()
_notificationPref()
buildMimeMessage()
getImagePart()
currentDate()
parseDate()
tabs()
eventTabs()
getDriver()
getCalendar()
getRemoteParams()
displayedCalendars()
getView()
viewShowLocation()
viewShowTime()
backgroundColor()
foregroundColor()
getCSSColors()
randomColor()
showAjaxView()
sortEvents()
getTagger()
getInternalCalendar()
getAddressbookSearchParams()
hasApiPermission()
removeUserEvents()
toTimeslice()
No public properties found
STATUS_NONE
STATUS_TENTATIVE
STATUS_CONFIRMED
STATUS_CANCELLED
STATUS_FREE
RESPONSE_NONE
RESPONSE_ACCEPTED
RESPONSE_DECLINED
RESPONSE_TENTATIVE
PART_REQUIRED
PART_OPTIONAL
PART_NONE
PART_IGNORE
ITIP_REQUEST
ITIP_CANCEL
ITIP_REPLY
RANGE_THISANDFUTURE
PERMS_DELEGATE
DISPLAY_CALENDARS
DISPLAY_REMOTE_CALENDARS
DISPLAY_EXTERNAL_CALENDARS
DISPLAY_RESOURCE_CALENDARS
DISPLAY_HOLIDAYS
ALL_CALENDARS
ALL_REMOTE_CALENDARS
ALL_EXTERNAL_CALENDARS
ALL_HOLIDAYS
ALL_RESOURCE_CALENDARS
SHARE_TYPE_USER
SHARE_TYPE_RESOURCE
VFS_PATH
_sortEventStartTime()
No protected properties found
N/A
No private methods found
$_tagger
N/A

Constants

STATUS_NONE

STATUS_NONE

Event status

STATUS_TENTATIVE

STATUS_TENTATIVE

STATUS_CONFIRMED

STATUS_CONFIRMED

STATUS_CANCELLED

STATUS_CANCELLED

STATUS_FREE

STATUS_FREE

RESPONSE_NONE

RESPONSE_NONE

Invitation responses

RESPONSE_ACCEPTED

RESPONSE_ACCEPTED

RESPONSE_DECLINED

RESPONSE_DECLINED

RESPONSE_TENTATIVE

RESPONSE_TENTATIVE

PART_REQUIRED

PART_REQUIRED

Attendee status

PART_OPTIONAL

PART_OPTIONAL

PART_NONE

PART_NONE

PART_IGNORE

PART_IGNORE

ITIP_REQUEST

ITIP_REQUEST

iTip requests

ITIP_CANCEL

ITIP_CANCEL

ITIP_REPLY

ITIP_REPLY

RANGE_THISANDFUTURE

RANGE_THISANDFUTURE

PERMS_DELEGATE

PERMS_DELEGATE

The event can be delegated.

DISPLAY_CALENDARS

DISPLAY_CALENDARS

Calendar Manager Constants

DISPLAY_REMOTE_CALENDARS

DISPLAY_REMOTE_CALENDARS

DISPLAY_EXTERNAL_CALENDARS

DISPLAY_EXTERNAL_CALENDARS

DISPLAY_RESOURCE_CALENDARS

DISPLAY_RESOURCE_CALENDARS

DISPLAY_HOLIDAYS

DISPLAY_HOLIDAYS

ALL_CALENDARS

ALL_CALENDARS

ALL_REMOTE_CALENDARS

ALL_REMOTE_CALENDARS

ALL_EXTERNAL_CALENDARS

ALL_EXTERNAL_CALENDARS

ALL_HOLIDAYS

ALL_HOLIDAYS

ALL_RESOURCE_CALENDARS

ALL_RESOURCE_CALENDARS

SHARE_TYPE_USER

SHARE_TYPE_USER

Share Types

SHARE_TYPE_RESOURCE

SHARE_TYPE_RESOURCE

VFS_PATH

VFS_PATH

The virtual path to use for VFS data.

Properties

Methods

permissionToJson()

permissionToJson(\Horde_Perms_Permission  $perm, boolean  $systemShare = false) : array

Converts a permission object to a json object.

This methods filters out any permissions for the owner and converts the user name if necessary.

Parameters

\Horde_Perms_Permission $perm

A permission object.

boolean $systemShare

Is this from a system share?

Returns

array —

A hash suitable for json.

listAlarms()

listAlarms(\Horde_Date  $date, array  $calendars, boolean  $fullevent = false) : array

Returns all the alarms active on a specific date.

Parameters

\Horde_Date $date

The date to check for alarms.

array $calendars

The calendars to check for events.

boolean $fullevent

Whether to return complete alarm objects or only alarm IDs.

Throws

\Kronolith_Exception

Returns

array —

The alarms active on the date. A hash with calendar names as keys and arrays of events or event ids as values.

search()

search(object  $query, string  $calendar = null) : array

Searches for events with the given properties.

Parameters

object $query

The search query.

string $calendar

The calendar to search in the form "Driver|calendar_id".

Throws

\Kronolith_Exception

Returns

array —

The events.

listEvents()

listEvents(\Horde_Date  $startDate, \Horde_Date  $endDate, array  $calendars = null, array  $options = array()) : array

Returns all the events that happen each day within a time period

Parameters

\Horde_Date $startDate

The start of the time range.

\Horde_Date $endDate

The end of the time range.

array $calendars

The calendars to check for events.

array $options

Additional options:

  • show_recurrence: (boolean) Return every instance of a recurring event? DEFAULT: false (Only return recurring events once inside $startDate - $endDate range)
  • has_alarm: (boolean) Only return events with alarms. DEFAULT: false (Return all events)
  • json: (boolean) Store the results of the event's toJson() method? DEFAULT: false
  • cover_dates: (boolean) Add the events to all days that they cover? DEFAULT: true
  • hide_exceptions: (boolean) Hide events that represent exceptions to a recurring event. DEFAULT: false (Do not hide exception events)
  • fetch_tags: (boolean) Fetch tags for all events. DEFAULT: false (Do not fetch event tags)

Returns

array —

The events happening in this time period.

mergeEvents()

mergeEvents(array  $results, array  $events) 

Merges results from two listEvents() result sets.

Parameters

array $results

First list of events.

array $events

List of events to be merged into the first one.

addEvents()

addEvents(  $results,   $event,   $startDate,   $endDate,   $showRecurrence,   $json,   $coverDates = true) 

Calculates recurrences of an event during a certain period.

Parameters

$results
$event
$startDate
$endDate
$showRecurrence
$json
$coverDates

addCoverDates()

addCoverDates(  $results, \Kronolith_Event  $event, \Horde_Date  $eventStart, \Horde_Date  $eventEnd, boolean  $json, \Horde_Date  $originalStart = null, \Horde_Date  $originalEnd = null, \Horde_Date  $endDate = null) 

Adds an event to all the days it covers.

Parameters

$results
\Kronolith_Event $event

An event object.

\Horde_Date $eventStart

The event's start of the actual recurrence.

\Horde_Date $eventEnd

The event's end of the actual recurrence.

boolean $json

Store the results of the events' toJson() method?

\Horde_Date $originalStart

The actual starting time of a single event spanning multiple days.

\Horde_Date $originalEnd

The actual ending time of a single event spanning multiple days.

\Horde_Date $endDate

addSearchEvents()

addSearchEvents(array  $events, \Kronolith_Event  $event, \stdClass  $query, boolean  $json) 

Adds an event to set of search results.

Parameters

array $events

The list of events to update with the new event.

\Kronolith_Event $event

An event from a search result.

\stdClass $query

A search query.

boolean $json

Store the results of the events' toJson() method?

countEvents()

countEvents() : integer

Returns the number of events in calendars that the current user owns.

Returns

integer —

The number of events.

quickAdd()

quickAdd(string  $text, string  $calendar = null) : array

Imports an event parsed from a string.

Parameters

string $text

The text to parse into an event

string $calendar

The calendar into which the event will be imported. If 'null', the user's default calendar will be used.

Throws

\Kronolith_Exception

Returns

array —

The UID of all events that were added.

initialize()

initialize() 

Initial app setup code.

Globals defined:

getUserName()

getUserName(  $uid) 

Returns the real name, if available, of a user.

Parameters

$uid

getUserEmail()

getUserEmail(  $uid) 

Returns the email address, if available, of a user.

Parameters

$uid

isUserEmail()

isUserEmail(string  $uid, string  $email) 

Checks if an email address belongs to a user.

Parameters

string $uid

user id to check

string $email

email address to check

validateUserAttendee()

validateUserAttendee(string  $user) : mixed

Return Kronolith_Attendee object for a local user.

Parameters

string $user

The local username.

Returns

mixed —

Return the Kronolith_Attendee object for $user, or false if the auth backend supports user listing and the user is not found.

recurToString()

recurToString(integer  $type) : string

Maps a Kronolith recurrence value to a translated string suitable for display.

Parameters

integer $type

The recurrence value; one of the Horde_Date_Recurrence::RECUR_XXX constants.

Returns

string —

The translated displayable recurrence value string.

statusToString()

statusToString(integer  $status) : string

Maps a Kronolith meeting status string to a translated string suitable for display.

Parameters

integer $status

The meeting status; one of the Kronolith::STATUS_XXX constants.

Returns

string —

The translated displayable meeting status string.

responseToString()

responseToString(integer  $response) : string

Maps a Kronolith attendee response string to a translated string suitable for display.

Parameters

integer $response

The attendee response; one of the Kronolith::RESPONSE_XXX constants.

Returns

string —

The translated displayable attendee response string.

partToString()

partToString(integer  $part) : string

Maps a Kronolith attendee participation string to a translated string suitable for display.

Parameters

integer $part

The attendee participation; one of the Kronolith::PART_XXX constants.

Returns

string —

The translated displayable attendee participation string.

responseFromICal()

responseFromICal(string  $response) : string

Maps an iCalendar attendee response string to the corresponding Kronolith value.

Parameters

string $response

The attendee response.

Returns

string —

The Kronolith response value.

buildStatusWidget()

buildStatusWidget(string  $name, string  $current = self::STATUS_CONFIRMED, string  $any = false) : string

Builds the HTML for an event status widget.

Parameters

string $name

The name of the widget.

string $current

The selected status value.

string $any

Whether an 'any' item should be added

Returns

string —

The HTML