/sources/calendar.php

Description
Functions
calendar_matches (line 273)

Detect calendar matches in a time period.

  • return: A list of events happening, with time details
array calendar_matches (MEMBER $member_id, boolean $restrict, ?TIME $period_start, ?TIME $period_end, [?array $filter = NULL], [boolean $do_rss = true])
  • MEMBER $member_id: The member to detect conflicts for
  • boolean $restrict: Whether to restrict only to viewable events for the current member
  • ?TIME $period_start: The timestamp that found times must exceed. In user-time (NULL: use find_periods_recurrence default)
  • ?TIME $period_end: The timestamp that found times must not exceed. In user-time (NULL: use find_periods_recurrence default)
  • ?array $filter: The type filter (NULL: none)
  • boolean $do_rss: Whether to include RSS events in the results
date_from_week_of_year (line 48)

Converts year+week to year+month+day. This is really complex. The first week of a year may actually start in December. The first day of the first week is a Monday or a Sunday, depending on configuration.

  • return: Month #,Day #,Year #
array date_from_week_of_year (integer $year, integer $week)
  • integer $year: Year #
  • integer $week: Week #
date_range (line 233)

Create a neatly human-readable date range, using various user-friendly readability tricks.

  • return: Textual specially-formatted range
string date_range (TIME $from, TIME $to)
  • TIME $from: From time
  • TIME $to: To time
detect_conflicts (line 417)

Detect conflicts with an event at a certain time.

  • return: Information about conflicts (NULL: none)
?tempcode detect_conflicts (MEMBER $member_id, AUTO_LINK $skip_id, ?integer $start_year, ?integer $start_month, ?integer $start_day, ?integer $start_hour, ?integer $start_minute, ?integer $end_year, ?integer $end_month, ?integer $end_day, ?integer $end_hour, ?integer $end_minute, string $recurrence, ?integer $recurrences)
  • MEMBER $member_id: The member to detect conflicts for
  • AUTO_LINK $skip_id: The event ID that we are detecting conflicts with (we need this so we don't think we conflict with ourself)
  • ?integer $start_year: The year the event starts at. This and the below are in server time (NULL: default)
  • ?integer $start_month: The month the event starts at (NULL: default)
  • ?integer $start_day: The day the event starts at (NULL: default)
  • ?integer $start_hour: The hour the event starts at (NULL: default)
  • ?integer $start_minute: The minute the event starts at (NULL: default)
  • ?integer $end_year: The year the event ends at (NULL: not a multi day event)
  • ?integer $end_month: The month the event ends at (NULL: not a multi day event)
  • ?integer $end_day: The day the event ends at (NULL: not a multi day event)
  • ?integer $end_hour: The hour the event ends at (NULL: not a multi day event)
  • ?integer $end_minute: The minute the event ends at (NULL: not a multi day event)
  • string $recurrence: The event recurrence
  • ?integer $recurrences: The number of recurrences (NULL: none/infinite)
detect_happening_at (line 453)

Detect conflicts with an event in certain time periods.

  • return: A list of events happening, with time details
array detect_happening_at (MEMBER $member_id, AUTO_LINK $skip_id, array $our_times, [boolean $restrict = true], [?TIME $period_start = NULL], [?TIME $period_end = NULL])
  • MEMBER $member_id: The member to detect conflicts for
  • AUTO_LINK $skip_id: The event ID that we are detecting conflicts with (we need this so we don't think we conflict with ourself)
  • array $our_times: List of pairs specifying our happening time (in time order)
  • boolean $restrict: Whether to restrict only to viewable events for the current member
  • ?TIME $period_start: The timestamp that found times must exceed. In user-time (NULL: use find_periods_recurrence default)
  • ?TIME $period_end: The timestamp that found times must not exceed. In user-time (NULL: use find_periods_recurrence default)
find_periods_recurrence (line 83)

Find a list of pairs specifying the times the event occurs, for 20 years into the future.

  • return: A list of pairs for period times (timestamps, in user-time)
array find_periods_recurrence (?integer $start_year, ?integer $start_month, ?integer $start_day, ?integer $start_hour, ?integer $start_minute, ?integer $end_year, ?integer $end_month, ?integer $end_day, ?integer $end_hour, ?integer $end_minute, string $recurrence, ?integer $recurrences, [?TIME $period_start = NULL], [?TIME $period_end = NULL])
  • ?integer $start_year: The year the event starts at. This and the below are in server time (NULL: default)
  • ?integer $start_month: The month the event starts at (NULL: default)
  • ?integer $start_day: The day the event starts at (NULL: default)
  • ?integer $start_hour: The hour the event starts at (NULL: default)
  • ?integer $start_minute: The minute the event starts at (NULL: default)
  • ?integer $end_year: The year the event ends at (NULL: not a multi day event)
  • ?integer $end_month: The month the event ends at (NULL: not a multi day event)
  • ?integer $end_day: The day the event ends at (NULL: not a multi day event)
  • ?integer $end_hour: The hour the event ends at (NULL: not a multi day event)
  • ?integer $end_minute: The minute the event ends at (NULL: not a multi day event)
  • string $recurrence: The event recurrence
  • ?integer $recurrences: The number of recurrences (NULL: none/infinite)
  • ?TIME $period_start: The timestamp that found times must exceed. In user-time (NULL: now)
  • ?TIME $period_end: The timestamp that found times must not exceed. In user-time (NULL: 20 years time)
get_week_number_for (line 28)

Get the week number for a time.

  • return: The week number
string get_week_number_for (TIME $timestamp, [boolean $no_year = false])
  • TIME $timestamp: The week number
  • boolean $no_year: Whether to do it contextually to the year, rather than including the year
nice_get_events (line 382)

Get a list of events to edit.

  • return: The list
tempcode nice_get_events (?MEMBER $only_owned, ?AUTO_LINK $it, [boolean $edit_viewable_events = true])
  • ?MEMBER $only_owned: Only show events owned by this member (NULL: no such limitation)
  • ?AUTO_LINK $it: Event to select by default (NULL: no specific default)
  • boolean $edit_viewable_events: Whether owned public events should be shown
nice_get_event_types (line 158)

Get a list of event types, taking security into account against the current member.

  • return: The list
tempcode nice_get_event_types ([?AUTO_LINK $it = NULL])
  • ?AUTO_LINK $it: The event type to select by default (NULL: none)
regenerate_event_reminder_jobs (line 180)

Regenerate all the calendar jobs for reminders for next occurance of an event (because the event was added or edited).

void regenerate_event_reminder_jobs (AUTO_LINK $id, [boolean $force = false])
  • AUTO_LINK $id: The ID of the event
  • boolean $force: Force evaluation even if it's in the past. Only valid for code events

Documentation generated on Sun, 02 Jan 2011 23:09:43 +0000 by phpDocumentor 1.4.3