activate_urls (line
58)
Looks for URLs in the given text, and makes them into links.
string
activate_urls
(string $text)
activity_log (line
93)
Adds something to the activity log for an event.
The information will be saved to the webcal_entry_log table.
void
activity_log
(int $event_id, string $user, string $user_cal, string $type, string $text)
-
int
$event_id: Event ID
-
string
$user: Username of user doing this
-
string
$user_cal: Username of user whose calendar is affected
-
string
$type: Type of activity we are logging:
- LOG_APPROVE
- LOG_APPROVE_T
- LOG_ATTACHMENT
- LOG_COMMENT
- LOG_CREATE
- LOG_CREATE_T
- LOG_DELETE
- LOG_DELETE_T
- LOG_LOGIN_FAILURE
- LOG_NEWUSER_FULL
- LOG_NEWUSEREMAIL
- LOG_NOTIFICATION
- LOG_REJECT
- LOG_REJECT_T
- LOG_REMINDER
- LOG_UPDATE
- LOG_UPDATE_T
- LOG_USER_ADD
- LOG_USER_DELETE
- LOG_USER_UPDATE
-
string
$text: Text comment to add with activity log entry
add_dstfree_time (line
121)
Get the corrected timestamp after adding or subtracting ONE_HOUR to compensate for DST.
void
add_dstfree_time
( $date, $span, [ $interval = 1])
add_duration (line
144)
Return the time in HHMMSS format of input time + duration
string
add_duration
(string $time, int $duration)
-
string
$time: format "235900"
-
int
$duration: number of minutes
boss_must_approve_event (line
5779)
Checks the boss user preferences to see if the boss must approve events added to their calendar.
bool
boss_must_approve_event
(string $assistant, string $boss)
-
string
$assistant: Assistant login
-
string
$boss: Boss login
boss_must_be_notified (line
5795)
Checks the boss user preferences to see if the boss wants to be notified via email on changes to their calendar.
bool
boss_must_be_notified
(string $assistant, string $boss)
-
string
$assistant: Assistant login
-
string
$boss: Boss login
build_entry_label (line
182)
Builds the HTML for the event label.
string
build_entry_label
( $event, $popupid, string $can_access, $timestr, [string $time_only = 'N'])
-
string
$can_access
-
string
$time_only
-
$event
-
$popupid
-
$timestr
build_entry_popup (line
5888)
Builds the HTML for the entry popup.
string
build_entry_popup
(string $popupid, string $user, [string $description = ''], string $time, [string $site_extras = ''], [ $location = ''], [ $name = ''], [ $id = ''], [ $reminder = ''])
-
string
$popupid: CSS id to use for event popup
-
string
$user: Username of user the event pertains to
-
string
$description: Event description
-
string
$time: Time of the event (already formatted in a display format)
-
string
$site_extras: HTML for any site_extras for this event
-
$location
-
$name
-
$id
-
$reminder
bump_local_timestamp (line
166)
Bump UNIX local timestamp with the given duration.
param int $ts input timestamp param int $hour hour duration param int $minute minute duration param int $second second duration param int $month month duration param int $day day duration param int $year year duration
This function overcomes problems due to daylight saving change dates; it is based on the fact that function mktime() accepts out of range data.
void
bump_local_timestamp
( $ts, [ $hour = 0], [ $minute = 0], [ $second = 0], [ $month = 0], [ $day = 0], [ $year = 0])
-
$ts
-
$hour
-
$minute
-
$second
-
$month
-
$day
-
$year
calc_time_slot (line
256)
Calculates which row/slot this time represents.
This is used in day and week views where hours of the time are separeted into different cells in a table.
Note: the global variable $TIME_SLOTS is used to determine how many time slots there are and how many minutes each is. This variable is defined user preferences (or defaulted to admin system settings).
int
calc_time_slot
(string $time, [bool $round_down = false])
-
string
$time: Input time in HHMMSS format
-
bool
$round_down: Should we change 1100 to 1059? (This will make sure a 10AM-100AM appointment just shows up in the 10AM slow and not in the 11AM slot also.)
check_for_conflicts (line
293)
Checks for conflicts.
Find overlaps between an array of dates and the other dates in the database.
Limits on number of appointments: if enabled in System Settings ($LIMIT_APPTS global variable), too many appointments can also generate a scheduling conflict.
Empty
check_for_conflicts
(array $dates, int $duration, int $eventstart, array $participants, string $login, int $id)
-
array
$dates: Array of dates in Timestamp format that is checked for overlaps.
-
int
$duration: Event duration in minutes
-
int
$eventstart: GMT starttime timestamp
-
array
$participants: Array of users whose calendars are to be checked
-
string
$login: The current user name
-
int
$id: Current event id (this keeps overlaps from wrongly checking an event against itself)
clean_html (line
454)
Replaces unsafe characters with HTML encoded equivalents.
string
clean_html
(string $value)
-
string
$value: Input text
clean_int (line
469)
Removes non-digits from the specified text.
string
clean_int
(string $data)
clean_whitespace (line
479)
Removes whitespace from the specified text.
string
clean_whitespace
(string $data)
clean_word (line
489)
Removes non-word characters from the specified text.
string
clean_word
(string $data)
combine_and_sort_events (line
502)
Combines the repeating and nonrepeating event arrays and sorts them
The returned events will be sorted by time of day.
array
combine_and_sort_events
(array $ev, array $rep)
-
array
$ev: Array of events
-
array
$rep: Array of repeating events
daily_matrix (line
528)
Draws a daily outlook style availability grid showing events that are approved and awaiting approval.
string
daily_matrix
(string $date, array $participants, [string $popup = ''])
-
string
$date: Date to show the grid for
-
array
$participants: Which users should be included in the grid
-
string
$popup: Not used
date_selection (line
759)
Generate HTML for a date selection for use in a form.
string
date_selection
(string $prefix, string $date, [bool $trigger = false], [int $num_years = 20])
-
string
$prefix: Prefix to use in front of form element names
-
string
$date: Currently selected date (in YYYYMMDD format)
-
bool
$trigger: Add onchange event trigger that calls javascript function $prefix_datechanged ()
-
int
$num_years: Number of years to display
date_to_epoch (line
812)
Converts a date to a timestamp.
int
date_to_epoch
(string $d, [bool $gmt = true])
-
string
$d: Date in YYYYMMDD or YYYYMMDDHHIISS format
-
bool
$gmt: Whether to use GMT or LOCAL
date_to_str (line
859)
Converts a date in YYYYMMDD format into "Friday, December 31, 1999", "Friday, 12-31-1999" or whatever format the user prefers.
string
date_to_str
(string $indate, [string $format = ''], [bool $show_weekday = true], [bool $short_months = false], [bool $forceTranslate = false])
-
string
$indate: Date in YYYYMMDD format
-
string
$format: Format to use for date (default is "__month__ __dd__, __yyyy__")
-
bool
$show_weekday: Should the day of week also be included?
-
bool
$short_months: Should the abbreviated month names be used instead of the full month names?
-
bool
$forceTranslate: Check to see if there is a translation for the specified data format. If there is, then use the translated format from the language file, but only if $DATE_FORMAT is language-defined.
decode_string (line
914)
Extracts a user's name from a session id.
This prevents users from begin able to edit their cookies.txt file and set the username in plain text.
string
decode_string
(string $instr)
-
string
$instr: A hex-encoded string. "Hello" would be "678ea786a5".
delete_entry_by_id (line
6121)
Delete everything about this entry
void
delete_entry_by_id
(int $id)
-
int
$id: The cal_id of this entry
display_activity_log (line
935)
Display a text for a single activity log entry.
string
display_activity_log
(string $cal_type, [string $cal_text = ''], [ $break = '<br/>&nbsp;'])
-
string
$cal_type: the log entry type
-
string
$cal_text: addiitonal text to display
-
$break
display_admin_link (line
1001)
Display the <<Admin link on pages if menus are not enabled
string
display_admin_link
([bool $break = true])
-
bool
$break: If true, include break if empty
display_month (line
1014)
Generate HTML to create a month display.
void
display_month
( $thismonth, $thisyear, [ $demo = false])
-
$thismonth
-
$thisyear
-
$demo
display_navigation (line
1119)
Generate the HTML for the navigation bar.
void
display_navigation
( $name, [ $show_arrows = true], [ $show_cats = true])
-
$name
-
$show_arrows
-
$show_cats
display_small_month (line
1193)
Prints out a minicalendar for a month.
void
display_small_month
(int $thismonth, int $thisyear, bool $showyear, [bool $show_weeknums = false], [string $minical_id = ''], [string $month_link = 'month.php?'])
-
int
$thismonth: Number of the month to print
-
int
$thisyear: Number of the year
-
bool
$showyear: Show the year in the calendar's title?
-
bool
$show_weeknums: Show week numbers to the left of each row?
-
string
$minical_id: id attribute for the minical table
-
string
$month_link: URL and query string for month link that should come before the date specification (e.g. month.php? or view_l.php?id=7&)
display_small_tasks (line
1357)
Prints small task list for this $login user.
void
display_small_tasks
( $cat_id)
display_time (line
1488)
Displays a time in either 12 or 24 hour format.
string
display_time
([string $time = ''], [int $control = 0], [int $timestamp = ''], [string $format = ''])
-
string
$time: Input time in HHMMSS format Optionally, the format can be YYYYMMDDHHMMSS
-
int
$control: bitwise command value
- default
- ignore_offset Do not use the timezone offset
- show_tzid Show abbrev TZ id ie EST after time
4 use server's timezone
-
int
$timestamp: optional input time in timestamp format
-
string
$format: user's TIME_FORMAT when sending emails
display_unapproved_events (line
1553)
Checks for any unnaproved events.
If any are found, display a link to the unapproved events (where they can be approved).
If the user is an admin user, also count up any public events. If the user is a nonuser admin, count up events on the nonuser calendar.
void
display_unapproved_events
(string $user)
-
string
$user: Current user login
do_debug (line
38)
Logs a debug message.
Generally, we try not to leave calls to this function in the code. It is used for debugging only.
void
do_debug
(string $msg)
-
string
$msg: Text to be logged
do_redirect (line
1640)
Sends a redirect to the specified page.
The database connection is closed and execution terminates in this function.
Note: MS IIS/PWS has a bug that does not allow sending a cookie and a redirect in the same HTTP header. When we detect that the web server is IIS, we accomplish the redirect using meta-refresh. See the following for more info on the IIS bug: http://www.faqts.com/knowledge_base/view.phtml/aid/9316/fid/4
void
do_redirect
(string $url)
-
string
$url: The page to redirect to. In theory, this should be an absolute URL, but all browsers accept relative URLs (like "month.php").
encode_string (line
1678)
Takes an input string and encode it into a slightly encoded hexval that we can use as a session cookie.
string
encode_string
(string $instr)
-
string
$instr: Text to encode
error_check (line
1701)
Check for errors and return required HTML for display
string
error_check
(string $nextURL, [bool $redirect = true])
-
string
$nextURL: URL the redirect to
-
bool
$redirect: Redirect OR popup Confirmation window
event_get_external_users (line
1732)
Gets the list of external users for an event from the webcal_entry_ext_user table in HTML format.
string
event_get_external_users
(int $event_id, [int $use_mailto = 0])
-
int
$event_id: Event ID
-
int
$use_mailto: When set to 1, email address will contain an href link with a mailto URL.
format_site_extras (line
5999)
Formats site_extras for display according to their type.
This will return an array containing formatted extras indexed on their unique names. Each formatted extra is another array containing two indices: 'name' and 'data', which hold the name of the site_extra and the formatted data, respectively. So, to access the name and data of an extra uniquely name 'Reminder', you would access $array['Reminder']['name'] and $array['Reminder']['data']
array
format_site_extras
(array $extras, [int $filter = ''])
-
array
$extras: Array of site_extras for an event as returned by ()
-
int
$filter: CONSTANT 'view settings' values from site_extras.php
generate_activity_log (line
1779)
Generate activity log
string
generate_activity_log
([int $id = ''], [bool $sys = false], [int $startid = ''])
-
int
$id: Event id if called from view_entry.php
-
bool
$sys: Display System Log ro Event Log
-
int
$startid: Event number to start off list
generate_application_name (line
1868)
Generate Application Name
void
generate_application_name
([bool $custom = true])
-
bool
$custom: Allow user name to be displayed
generate_printer_friendly (line
1892)
Generate HTML to add Printer Friendly Link.
If called without parameter, return only the href string.
string
generate_printer_friendly
([string $hrefin = ''])
-
string
$hrefin: script name
generate_refresh_meta (line
1920)
Generate Refresh Meta Tag.
HTML
generate_refresh_meta
()
getByday (line
2277)
void
getByday
( $cdate, $byday, $type, $date)
-
$cdate
-
$byday
-
$type
-
$date
getBymonth (line
2240)
void
getBymonth
( $cdate, $bymonth)
getBymonthday (line
2266)
void
getBymonthday
( $cdate, $bymonthday)
getByweekno (line
2247)
void
getByweekno
( $cdate, $byweekno)
getByyearday (line
2254)
void
getByyearday
( $cdate, $byyearday)
getMoonPhases (line
3043)
Get the moonphases for a given year and month.
Will only work if optional moon_phases.php file exists in includes folder.
array
getMoonPhases
(int $year, int $month)
-
int
$year: Year in YYYY format
-
int
$month: Month in m format Jan =1
getOverLap (line
3075)
Calculate event rollover to next day and add partial event as needed.
Create a cloned event on the fly as needed to display in next day slot. The event times will be adjusted so that the total of all times will equal the total time of the original event. This function will get called recursively until all time has been accounted for.
void
getOverLap
(mixed $item, int $i, [bool $parent = true])
-
mixed
$item: Event Object
-
int
$i: Current count of event array
-
bool
$parent:
flag to keep track of the original event object
$global array $result Array of events
getReminders (line
3136)
Get the reminder data for a given entry id.
array
getReminders
(int $id, [bool $display = false])
-
int
$id: cal_id of requested entry
-
bool
$display: if true, will create a displayable string
getShortTime (line
3205)
Remove :00 from times based on $DISPLAY_MINUTES value.
void
getShortTime
(string $timestr)
-
string
$timestr: time value to shorten
get_all_dates (line
1950)
Returns all the dates a specific event will fall on accounting for the repeating.
Any event with no end will be assigned one.
array
get_all_dates
(int $date, string $rpt_type, [int $interval = 1], [array $Byxxx = ''], [int $Count = 999], [string $Until = null], [string $Wkst = 'MO'], [array $ex_days = ''], [array $inc_days = ''], [int $jump = ''])
-
int
$date: Initial date in raw format
-
string
$rpt_type: Repeating type as stored in the database
-
int
$interval: Interval of repetition
-
array
$Byxxx: Array of Byxxx values
-
int
$Count: Max number of events to return
-
string
$Until: Last day of repeat
-
string
$Wkst: First day of week ('MO' is default)
-
array
$ex_days: Array of exception dates for this event in YYYYMMDD format
-
array
$inc_days: Array of inclusion dates for this event in YYYYMMDD format
-
int
$jump: Date to short cycle loop counts to, also makes output YYYYMMDD
get_byday (line
2295)
Get the dates the correspond to the byday values.
array
get_byday
(array $byday, string $cdate, [string $type = 'month'], string $date)
-
array
$byday: ByDay values to process (MO,TU,-1MO,20MO...)
-
string
$cdate: First day of target search (Unix timestamp)
-
string
$type: Month, Year, Week (default = month)
-
string
$date: First day of event (Unix timestamp)
get_bymonthday (line
2378)
Get the dates the correspond to the bymonthday values.
array
get_bymonthday
(array $bymonthday, string $cdate, string $date, string $realend)
-
array
$bymonthday: ByMonthDay values to process (1,2,-1,-2...)
-
string
$cdate: First day of target search (Unix timestamp)
-
string
$date: First day of event (Unix timestamp)
-
string
$realend: Last day of event (Unix timestamp)
get_categories_by_id (line
2407)
Get categories for a given event id Global categories are changed to negative numbers
array
get_categories_by_id
(int $id, string $user, [bool $asterisk = false])
-
int
$id: Id of event
-
string
$user: normally this is $login
-
bool
$asterisk: Include '*' if Global
get_entries (line
2441)
Gets all the events for a specific date.
Events are retreived from the array of pre-loaded events (which was loaded all at once to improve performance).
The returned events will be sorted by time of day.
array
get_entries
(string $date, [bool $get_unapproved = true])
-
string
$date: Date to get events for in YYYYMMDD format in user's timezone
-
bool
$get_unapproved: Load unapproved events?
get_last_view (line
2467)
Gets the last page stored using ().
string
get_last_view
([ $clear = true])
get_my_nonusers (line
2496)
Gets a list of nonusers.
If groups are enabled, this will restrict the list of nonusers to only those that are in the same group(s) as the user (unless the user is an admin) or the nonuser is a public calendar. We allow admin users to see all users because they can also edit someone else's events (so they may need access to users who are not in the same groups).
If user access control is enabled, then we also check to see if this user is allowed to view each nonuser's calendar. If not, then that nonuser is not included in the list.
array
get_my_nonusers
([ $user = ''], [ $add_public = false], [ $reason = 'invite'])
-
$user
-
$add_public
-
$reason
get_my_users (line
2609)
Gets a list of users.
If groups are enabled, this will restrict the list to only those users who are in the same group(s) as this user (unless the user is an admin). We allow admin users to see all users because they can also edit someone else's events (so they may need access to users who are not in the same groups).
If user access control is enabled, then we also check to see if this user is allowed to view each user's calendar. If not, then that user is not included in the list.
array
get_my_users
([ $user = ''], [ $reason = 'invite'])
get_nonuser_cals (line
2709)
Gets a list of nonuser calendars and return info in an array.
array
get_nonuser_cals
([string $user = ''], [bool $remote = false])
-
string
$user: Login of admin of the nonuser calendars
-
bool
$remote: Return only remote calendar records
get_preferred_view (line
2837)
Gets user's preferred view.
The user's preferred view is stored in the $STARTVIEW global variable. This is loaded from the user preferences (or system settings if there are no user prefererences.)
string
get_preferred_view
([string $indate = ''], [string $args = ''])
-
string
$indate: Date to pass to preferred view in YYYYMMDD format
-
string
$args: Arguments to include in the URL (such as "user=joe")
get_pref_setting (line
2803)
Gets a preference setting for the specified user.
If no value is found in the database, then the system default setting will be returned.
string
get_pref_setting
(string $user, string $setting, [ $defaultValue = ''], stirng $defaultSetting)
-
string
$user: User login we are getting preference for
-
string
$setting: Name of the setting
-
stirng
$defaultSetting: Value to return if no value foun in the database
-
$defaultValue
get_repeating_entries (line
2903)
Gets all the repeating events for the specified date.
Note: The global variable $repeated_events needs to be set by calling () first.
mixed
get_repeating_entries
(string $user, $dateYmd, [bool $get_unapproved = true], string $date)
-
string
$user: Username
-
string
$date: Date to get events for in YYYYMMDD format
-
bool
$get_unapproved: Include unapproved events in results?
-
$dateYmd
get_RRULE (line
2231)
Rule out days by using the Byxxx values
void
get_RRULE
(integer $date, integer $cdate, array $Byxxx)
-
integer
$date: Timestamp of initial day
-
integer
$cdate: Timestamp of day in question
-
array
$Byxxx: Byxxx array
get_site_extras_names (line
6075)
Extract the names of all site_extras.
array
get_site_extras_names
([int $filter = ''])
-
int
$filter: CONSTANT 'view setting' from site_extras.php
get_site_extra_fields (line
6049)
Gets any site-specific fields for an entry that are stored in the database in the webcal_site_extras table.
array
get_site_extra_fields
(int $eventid)
get_tasks (line
2928)
Gets all the tasks for a specific date.
Events are retreived from the array of pre-loaded tasks (which was loaded all at once to improve performance).
The returned tasks will be sorted by time of day.
array
get_tasks
(string $date, [bool $get_unapproved = true])
-
string
$date: Date to get tasks for in YYYYMMDD format
-
bool
$get_unapproved: Load unapproved events?
get_users_event_ids (line
2973)
Get event ids for all events this user is a participant.
void
get_users_event_ids
(string $user)
-
string
$user: User to retrieve event ids
get_weekday_before (line
3017)
Gets the previous weekday of the week containing the specified date.
If the date specified is a Sunday, then that date is returned.
int
get_weekday_before
(int $year, int $month, [int $day = 2])
-
int
$year: Year
-
int
$month: Month (1-12)
-
int
$day: Day (1-31)
html_for_add_icon (line
3328)
Generates the HTML for an icon to add a new event.
string
html_for_add_icon
([string $date = 0], [int $hour = ''], [int $minute = ''], [string $user = ''])
-
string
$date: Date for new event in YYYYMMDD format
-
int
$hour: Hour of day (0-23)
-
int
$minute: Minute of the hour (0-59)
-
string
$user: Participant to initially select for new event
html_for_event_day_at_a_glance (line
3360)
Generates the HTML for an event to be viewed in the day-at-glance (day.php).
The HTML will be stored in an array (global variable $hour_arr) indexed on the event's starting hour.
void
html_for_event_day_at_a_glance
(
Event $event,
string $date)
-
Event
$event: The event
-
string
$date: Date of event in YYYYMMDD format
html_for_event_week_at_a_glance (line
3516)
Generates the HTML for an event to be viewed in the week-at-glance (week.php).
The HTML will be stored in an array (global variable $hour_arr) indexed on the event's starting hour.
void
html_for_event_week_at_a_glance
(
Event $event,
string $date, [
string $override_class =
''], [
bool $show_time =
true])
-
Event
$event: The event
-
string
$date: Date for which we're printing (in YYYYMMDD format)
-
string
$override_class: If set, then this is the class to use
-
bool
$show_time: If enabled, then event time is displayed
html_to_8bits (line
3676)
Converts HTML entities in 8bit.
Note: Only supported for PHP4 (not PHP3).
string
html_to_8bits
(string $html)
is_weekend (line
3725)
Determine if date is a weekend
bool
is_weekend
(int $date)
-
int
$date: Timestamp of subject date OR a weekday number 0-6
load_global_settings (line
3778)
Loads default system settings (which can be updated via admin.php).
System settings are stored in the webcal_config table.
Note: If the setting for server_url is not set, the value will be calculated and stored in the database.
void
load_global_settings
()
load_nonuser_preferences (line
3855)
Loads nonuser preferences from the webcal_user_pref table if on a nonuser admin page.
void
load_nonuser_preferences
(string $nonuser)
-
string
$nonuser: Login name for nonuser calendar
load_template (line
3898)
Returns a custom header, stylesheet or tailer.
The data will be loaded from the webcal_user_template table. If the global variable $ALLOW_EXTERNAL_HEADER is set to 'Y', then we load an external file using include. This can have serious security issues since a malicous user could open up /etc/passwd.
void
load_template
(string $login, string $type)
-
string
$login: Current user login
-
string
$type: type of template ('H' = header, 'S' = stylesheet, 'T' = trailer)
load_user_categories (line
3960)
Loads current user's category info and stuff it into category global variable.
void
load_user_categories
([string $ex_global = ''])
-
string
$ex_global: Don't include global categories ('' or '1')
load_user_layers (line
3999)
Loads current user's layer info into layer global variable.
If the system setting $ALLOW_VIEW_OTHER is not set to 'Y', then we ignore all layer functionality. If $force is 0, we only load layers if the current user preferences have layers turned on.
void
load_user_layers
([string $user = ''], [int $force = 0])
-
string
$user: Username of user to load layers for
-
int
$force: If set to 1, then load layers for this user even if user preferences have layers turned off.
load_user_preferences (line
4040)
Loads the current user's preferences as global variables from the webcal_user_pref table.
Also loads the list of views for this user (not really a preference, but this is a convenient place to put this...)
Notes:
- If $ALLOW_COLOR_CUSTOMIZATION is set to 'N', then we ignore any
color preferences.
- Other default values will also be set if the user has not saved a
preference and no global value has been set by the administrator in the
system settings.
void
load_user_preferences
([ $guest = ''])
month_name (line
4175)
Returns the either the full name or the abbreviation of the specified month.
string
month_name
(int $m, [string $format = 'F'])
-
int
$m: Number of the month (0-11)
-
string
$format: 'F' = full, 'M' = abbreviation
nonuser_load_variables (line
4238)
Loads nonuser variables (login, firstname, etc.).
The following variables will be set:
- login
- firstname
- lastname
- fullname
- admin
- email
void
nonuser_load_variables
(string $login, string $prefix)
-
string
$login: Login name of nonuser calendar
-
string
$prefix: Prefix to use for variables that will be set. For example, if prefix is "temp_", then the login will be stored in the $temp_login global variable.
print_category_menu (line
4273)
Prints dropdown HTML for categories.
void
print_category_menu
(string $form, [string $date = ''], [int $cat_id = ''])
-
string
$form: The page to submit data to (without .php)
-
string
$date: Date in YYYYMMDD format
-
int
$cat_id: Category id that should be pre-selected
print_checkbox (line
4322)
Generates HTML to for checkbox form controls.
string
print_checkbox
(array $vals, [string $id = ''], [string $onchange = ''])
-
array
$vals: (name, value, display, setting)
-
string
$id: the id of the control
-
string
$onchange: javascript function to call if needed
print_color_input_html (line
4366)
Generates HTML for color chooser options in admin and pref pages.
string
print_color_input_html
(string $varname, string $title, [string $varval = ''])
-
string
$varname: the name of the variable to display
-
string
$title: color description
-
string
$varval: the default value to display
print_date_entries (line
4405)
Prints all the calendar entries for the specified user for the specified date.
If we are displaying data from someone other than the logged in user, then check the access permission of the entry.
void
print_date_entries
(string $date, string $user, [bool $ssi = false])
-
string
$date: Date in YYYYMMDD format
-
string
$user: Username
-
bool
$ssi: Is this being called from week_ssi.php?
print_day_at_a_glance (line
4482)
Prints all the calendar entries for the specified user for the specified date in day-at-a-glance format.
If we are displaying data from someone other than the logged in user, then check the access permission of the entry.
void
print_day_at_a_glance
(string $date, string $user, [ $can_add = 0])
-
string
$date: Date in YYYYMMDD format
-
string
$user: Username of calendar
-
$can_add
print_entry (line
4602)
Prints the HTML for one event in the month view.
void
print_entry
(
Event $event,
string $date)
-
Event
$event: The event
-
string
$date: The data for which we're printing (YYYYMMDD)
print_error (line
4748)
Generate standardized error message
string
print_error
(string $error, [bool $full = false])
-
string
$error: Message to display
-
bool
$full: Include extra text in display
print_error_header (line
4756)
An h2 header error message.
void
print_error_header
()
print_not_auth (line
4770)
Generate standardized Not Authorized message
string
print_not_auth
([int $errno = ''], [bool $full = false])
-
int
$errno: Optional Error number to display
-
bool
$full: Include ERROR title
print_radio (line
4789)
Generates HTML for radio buttons.
string
print_radio
(string $variable, [array $vals = ''], [string $onclick = ''], [string $defIdx = ''], [string $sep = '&nbsp;'])
-
string
$variable: the name of the variable to display
-
array
$vals: the value and display variables if empty ( Yes/No options will be displayed )
-
string
$onclick: javascript function to call if needed
-
string
$defIdx: default array index to select
-
string
$sep: HTML value between radio options ( ,
)
print_success (line
4829)
Generate standardized Success message.
string
print_success
(bool $saved)
print_timezone_select_html (line
4845)
Prints Timezone select for use on forms
string
print_timezone_select_html
(string $prefix, string $tz)
-
string
$prefix: Prefix for select control's name
-
string
$tz: Current timezone of logged in user
query_events (line
4929)
Reads events visible to a user.
Includes layers and possibly public access if enabled. NOTE: The values for the global variables $thisyear and $thismonth MUST be set! (This will determine how far in the future to caclulate repeating event dates.)
array
query_events
(string $user, bool $want_repeated, string $date_filter, [int $cat_id = ''], [bool $is_task = false])
-
string
$user: Username
-
bool
$want_repeated: Get repeating events?
-
string
$date_filter: SQL phrase starting with AND, to be appended to the WHERE clause. May be empty string.
-
int
$cat_id: Category ID to filter on. May be empty.
-
bool
$is_task: Used to restrict results to events OR tasks
read_events (line
5217)
Reads all the events for a user for the specified range of dates.
This is only called once per page request to improve performance. All the events get loaded into the array $events sorted by time of day (not date).
array
read_events
(string $user, string $startdate, string $enddate, [int $cat_id = ''])
-
string
$user: Username
-
string
$startdate: Start date range, inclusive (in timestamp format) in user's timezone
-
string
$enddate: End date range, inclusive (in timestamp format) in user's timezone
-
int
$cat_id: Category ID to filter on
read_repeated_events (line
5255)
Reads all the repeated events for a user.
This is only called once per page request to improve performance. All the events get loaded into the array $repeated_events sorted by time of day (not date).
This will load all the repeated events into memory.
Notes:
- To get which events repeat on a specific date, use
().
- To get all the dates that one specific event repeats on, call
().
array
read_repeated_events
(string $user, [int $date = ''], [ $enddate = ''], [int $cat_id = ''])
-
string
$user: Username
-
int
$cat_id: Category ID to filter on (May be empty)
-
int
$date: Cutoff date for repeating event cal_end in timestamp format (may be empty)
-
$enddate
read_tasks (line
5285)
Reads all the tasks for a user with due date within the specified date range.
This is only called once per page request to improve performance. All the tasks get loaded into the array $tasks sorted by time of day (not date).
array
read_tasks
(string $user, string $duedate, [int $cat_id = ''])
-
string
$user: Username
-
string
$duedate: End date range, inclusive (in timestamp format) in user's timezone
-
int
$cat_id: Category ID to filter on
remember_this_view (line
5303)
Generates a cookie that saves the last calendar view.
Cookie is based on the current $REQUEST_URI.
We save this cookie so we can return to this same page after a user edits/deletes/etc an event.
void
remember_this_view
([bool $view = false])
-
bool
$view: Determine if we are using a view_x.php file
send_doctype (line
5323)
This just sends the DOCTYPE used in a lot of places in the code.
void
send_doctype
([string $doc_title = ''])
send_http_login (line
5349)
Sends an HTTP login request to the browser and stops execution.
void
send_http_login
()
send_no_cache_header (line
5381)
Sends HTTP headers that tell the browser not to cache this page.
Different browsers use different mechanisms for this, so a series of HTTP header directives are sent.
Note: This function needs to be called before any HTML output is sent to the browser.
void
send_no_cache_header
()
send_to_preferred_view (line
5398)
Sends a redirect to the user's preferred view.
The user's preferred view is stored in the $STARTVIEW global variable. This is loaded from the user preferences (or system settings if there are no user prefererences.)
void
send_to_preferred_view
([string $indate = ''], [string $args = ''])
-
string
$indate: Date to pass to preferred view in YYYYMMDD format
-
string
$args: Arguments to include in the URL (such as "user=joe")
set_env (line
5409)
Set an environment variable if system allows it.
bool
set_env
(string $val, string $setting)
-
string
$val: name of environment variable
-
string
$setting: value to assign
set_today (line
5449)
Determines what the day is and sets it globally.
All times are in the user's timezone
The following global variables will be set:
- $thisyear
- $thismonth
- $thisday
- $thisdate
- $today
void
set_today
([string $date = ''])
-
string
$date: The date in YYYYMMDD format
site_extras_for_popup (line
6099)
Generates the HTML used in an event popup for the site_extras fields.
string
site_extras_for_popup
(int $id)
sort_events (line
5472)
Sorts the combined event arrays by timestamp then name.
Note: This is a user-defined comparison function for usort ().
void
sort_events
(passed $a, $b)
-
passed
$a: automatically by usort, don't pass them in your call
-
$b
sort_events_insensitive (line
5490)
Sorts the combined event arrays by timestamp then name (case insensitive).
Note: This is a user-defined comparison function for usort ().
void
sort_events_insensitive
(passed $a, $b)
-
passed
$a: automatically by usort, don't pass them in your call.
-
$b
sort_users (line
5507)
Sort user array based on $USER_SORT_ORDER.
Note: This is a user-defined comparison function for usort () that will be called from user-xxx.php.
void
sort_users
(passed $a, $b)
-
passed
$a: automatically by usort, don't pass them in your call.
-
$b
times_overlap (line
5542)
Checks to see if two events overlap.
bool
times_overlap
(string $time1, int $duration1, string $time2, int $duration2)
-
string
$time1: Time 1 in HHMMSS format
-
int
$duration1: Duration 1 in minutes
-
string
$time2: Time 2 in HHMMSS format
-
int
$duration2: Duration 2 in minutes
time_to_minutes (line
5529)
Converts a time format HHMMSS (like 130000 for 1PM) into number of minutes past midnight.
int
time_to_minutes
(string $time)
-
string
$time: Input time in HHMMSS format
update_status (line
5574)
Updates event status and logs activity
void
update_status
(string $status, string $user, int $id, [string $type = 'E'])
-
string
$status: A,D,R,W to set cal_status
-
string
$user: user to apply changes to
-
int
$id: event id
-
string
$type: event type for logging
user_get_boss_list (line
5835)
Gets a list of an assistant's boss from the webcal_asst table.
array
user_get_boss_list
(string $assistant)
-
string
$assistant: Login of assistant
user_has_boss (line
5861)
Is this user an assistant?
bool
user_has_boss
(string $assistant)
-
string
$assistant: Login for user
user_is_assistant (line
5810)
Is this user an assistant of this boss?
bool
user_is_assistant
(string $assistant, string $boss)
-
string
$assistant: Login of potential assistant
-
string
$boss: Login of potential boss
user_is_nonuser_admin (line
5622)
Checks the webcal_nonuser_cals table to determine if the user is the administrator for the nonuser calendar.
bool
user_is_nonuser_admin
(string $login, string $nonuser)
-
string
$login: Login of user that is the potential administrator
-
string
$nonuser: Login name for nonuser calendar
user_is_participant (line
5634)
Determine if the specified user is a participant in the event.
User must have status 'A' or 'W'.
void
user_is_participant
(int $id, string $user)
-
int
$id: event id
-
string
$user: user login
validate_domain (line
5661)
Checks to see if user's IP in in the IP Domain specified by the /includes/blacklist.php file
bool
validate_domain
()
weekday_name (line
5722)
Returns either the full name or the abbreviation of the day.
string
weekday_name
(int $w, [string $format = 'l'])
-
int
$w: Number of the day in the week (0=Sun,...,6=Sat)
-
string
$format: 'l' (lowercase L) = Full, 'D' = abbreviation.