WebCalendar Database Schema

NOTE: Generated from the source code (see here).


Specifies what WebCalendar functions a user can access. Each function has a corresponding numeric value (specified in the file includes/access.php). For example, view event is 0, so the very first character in the cal_permissions column is either a “Y” if this user can view events or a “N” if they cannot.

Column NameTypeLengthNullDefaultDescription
cal_loginVARCHAR25N user login
cal_permissionsVARCHAR64N a string of ‘Y’ or ‘N’ for the various functions


Specifies which users can access another user’s calendar.

Column NameTypeLengthNullDefaultDescription
cal_loginVARCHAR25N the current user who is attempting to look at another user’s calendar
cal_other_userVARCHAR25N the login of the other user whose calendar the current user wants to access
cal_can_viewINT N‘0’can current user view events on the other user’s calendar?
cal_can_editINT N‘0’can current user edit events on the other user’s calendar?
cal_can_approveINT N‘0’can current user approve events on the other user’s calendar?
cal_can_inviteCHAR1Y‘Y’can current user see other user in Participant lists?
cal_can_emailCHAR1Y‘Y’can current user send emails to other user?
cal_see_time_onlyCHAR1Y‘N’can current user can only see time of other user?


Define assitant/boss relationship.

Column NameTypeLengthNullDefaultDescription
cal_bossVARCHAR25N user login of boss
cal_assistantVARCHAR25N user login of assistant


This table stores event attachments and comments.

Column NameTypeLengthNullDefaultDescription
cal_blob_idINT N Unique identifier for this object
cal_idINT Y event id (if applicable)
cal_loginVARCHAR25Y login of user who created
cal_nameVARCHAR30Y filename of object (not used for comments)
cal_descriptionVARCHAR128Y description of what the object is (subject for comment)
cal_sizeINT Y size of object (not used for comment)
cal_mime_typeVARCHAR50Y MIME type of object (as specified by browser during upload) (not used for comment)
cal_typeCHAR1N type of object: C=Comment, A=Attachment
cal_mod_dateINT N date added (in YYYYMMDD format)
cal_mod_timeINT N time added in HHMMSS format
cal_blobLONGBLOB Y binary data for object


Defines user categories. Categories can be specific to a user or global. When a category is global, the cat_owner field will be NULL. (Only an admin user can create a global category.)

Column NameTypeLengthNullDefaultDescription
cat_idINT N unique category id
cat_ownerVARCHAR25Y user login of category owner. If this is NULL, then it is a global category
cat_nameVARCHAR80N category name
cat_colorVARCHAR8Y RGB color for category


System settings (set by the admin interface in admin.php)

Column NameTypeLengthNullDefaultDescription
cal_settingVARCHAR50N setting name
cal_valueVARCHAR100Y setting value


Defines a calendar event. Each event in the system has one entry in this table unless the event starts before midnight and ends after midnight. In that case a secondary event will be created with cal_ext_for_id set to the cal_id of the original entry. The following tables contain additional information about each event:

  • webcal_entry_user – lists participants in the event and specifies the status (accepted, rejected) and category of each participant.
  • webcal_entry_repeats – contains information if the event repeats.
  • webcal_entry_repeats_not – specifies which dates the repeating event does not repeat (because they were deleted or modified for just that date by the user)
  • webcal_entry_log – provides a history of changes to this event.
  • webcal_site_extras – stores event data as defined in site_extras.php (such as reminders and other custom event fields).
Column NameTypeLengthNullDefaultDescription
cal_idINT N cal_id is unique integer id for event
cal_group_idINT Y cal_group_id: the parent event id if this event is overriding an occurrence of a repeating event
cal_ext_for_idINT Y used when an event goes past midnight into the next day, in which case an additional entry in this table will use this field to indicate the original event cal_id
cal_create_byVARCHAR25N user login of user that created the event
cal_dateINT N date of event (in YYYYMMDD format)
cal_timeINT Y event time (in HHMMSS format)
cal_mod_dateINT Y date the event was last modified (in YYYYMMDD format)
cal_mod_timeINT Y time the event was last modified (in HHMMSS format)
cal_durationINT N duration of event in minutes
cal_due_dateINT YNULLTask due date
cal_due_timeINT YNULLTask due time
cal_priorityINT Y5event priority: 1=Low, 2=Med, 3=High
cal_typeCHAR1Y‘E’‘E’ = Event, ‘M’ = Repeating event, ‘T’ = Task
cal_accessCHAR1Y‘P’‘P’ = Public, ‘R’ = Private (others cannot see the event), ‘C’ = Confidential (others can see time allocated but not what it is)
cal_nameVARCHAR80N brief description of event
cal_locationvarchar100YNULLlocation of event
cal_urlvarchar100YNULLURL of event
cal_completedINT YNULLdate task completed
cal_descriptionTEXT Y full description of event


Contains category foreign keys to enable multiple categories for each event or task

Column NameTypeLengthNullDefaultDescription
cal_idINT N0id of event. Not unique
cat_idINT N0id of category. Not unique
cat_orderINT N0order that user requests their categories appear. Globals are always last
cat_ownervarchar25YNULLuser that owns this record. Global categories will be NULL


This table associates one or more external users (people who do not have a WebCalendar login) with an event by the event id. An event must still have at least one WebCalendar user associated with it. This table is not used unless external users are enabled* in system settings. The event can be found in webcal_entry.

Column NameTypeLengthNullDefaultDescription
cal_idINT N0event id
cal_fullnameVARCHAR50N external user fill name
cal_emailVARCHAR75Y external user email (for sending a reminder)


Activity log for an event.

Column NameTypeLengthNullDefaultDescription
cal_log_idINT N unique id of this log entry
cal_entry_idINT N event id
cal_loginVARCHAR25N user who performed this action
cal_user_calVARCHAR25Y user of calendar affected
cal_typeCHAR1N log types:C: CreatedA: Approved/Confirmed by userR: Rejected by userU: Updated by userM: Mail Notification sentE: Reminder sent
cal_dateINT N date in YYYYMMDD format
cal_timeINT Y time in HHMMSS format
cal_textTEXT Y optional text


Defines repeating info about an event. The event is defined in webcal_entry.

Column NameTypeLengthNullDefaultDescription
cal_idINT N0event id
cal_typeVARCHAR20Y type of repeating:daily – repeats dailymonthlyByDate – repeats on same day of the monthmonthlyBySetPos – repeats based on position within other ByXXX valuesmonthlyByDay – repeats on specified weekday (2nd Monday, for example)weekly – repeats every weekyearly – repeats on same date every year
cal_endINT Y end date for repeating event (in YYYYMMDD format)
cal_endtimeINT YNULL
cal_frequencyINT Y1frequency of repeat: 1 = every, 2 = every other, 3 = every 3rd, etc.
cal_daysCHAR7Y NO LONGER USED. We’ll leave it in for now
cal_bymonthvarchar50YNULLthe following columns are values as specified in RFC2445
cal_countINT YNULL


This table specifies which dates in a repeating event have either been deleted, included, or replaced with a replacement event for that day. When replaced, the cal_group_id (I know… not the best name, but it was not being used) column will be set to the original event. That way the user can delete the original event and (at the same time) delete any exception events.

Column NameTypeLengthNullDefaultDescription
cal_idINT N event id of repeating event
cal_dateINT N cal_date: date event should not repeat (in YYYYMMDD format)
cal_exdateint1N1indicates whether this record is an exclusion (1) or inclusion (0)


This table associates one or more users with an event by the event id. The event can be found in webcal_entry.

Column NameTypeLengthNullDefaultDescription
cal_idINT N0event id
cal_loginVARCHAR25N participant in the event
cal_statusCHAR1Y‘A’status of event for this user:A=AcceptedC=CompletedD=DeletedP=In-ProgressR=Rejected/DeclinedW=Waiting
cal_categoryINT YNULLcategory of the event for this user
cal_percentINT N0Task percentage of completion for this user’s task


Define a group. Group members can be found in webcal_group_user.

Column NameTypeLengthNullDefaultDescription
cal_group_idINT N unique group id
cal_ownerVARCHAR25Y user login of user that created this group
cal_nameVARCHAR50N name of the group
cal_last_updateINT N date last updated (in YYYYMMDD format)


Specify users in a group. The group is defined in webcal_group.

Column NameTypeLengthNullDefaultDescription
cal_group_idINT N group id
cal_loginVARCHAR25N user login


Used to track import data (one row per import)

Column NameTypeLengthNullDefaultDescription
cal_import_idINT N unique id for import
cal_nameVARCHAR50Y name of import (optional)
cal_dateINT N date of import (YYYYMMDD format)
cal_typeVARCHAR10N type of import (ical, vcal, palm, outlookcsv)
cal_loginVARCHAR25Y user who performed the import


Used to track import data (one row per event)

Column NameTypeLengthNullDefaultDescription
cal_import_idINT N import id (from webcal_import table)
cal_idINT N event id in WebCalendar
cal_loginVARCHAR25N user login
cal_import_typeVARCHAR15N type of import: ‘palm’, ‘vcal’, ‘ical’ or ‘outlookcsv’
cal_external_idVARCHAR200Y external id used in external calendar system (for example, UID in iCal)


Defines non-user calendars.

Column NameTypeLengthNullDefaultDescription
cal_loginVARCHAR25N the unique id for the calendar
cal_lastnameVARCHAR25Y calendar’s last name
cal_firstnameVARCHAR25Y calendar’s first name
cal_adminVARCHAR25N who is the calendar administrator
cal_is_publicCHAR1N‘N’can this nonuser calendar be a public calendar (no login required)
cal_urlVARCHAR255YNULLurl of the remote calendar


Stores information about reminders

Column NameTypeLengthNullDefaultDescription
cal_idINT N‘0’
cal_dateINT N‘0’timestamp that specifies send datetime. Use this or cal_offset, but not both
cal_offsetINT N‘0’offset in minutes from the selected edge
cal_relatedCHAR1N‘S’S=Start, E=End. Specifies which edge of entry this reminder applies to
cal_beforeCHAR1N‘Y’specifies whether reminder is sent before or after selected edge
cal_last_sentINT N‘0’timestamp of last sent reminder
cal_repeatsINT N‘0’number of times to repeat in addition to original occurance
cal_durationINT N‘0’time in ISO 8601 format that specifies time between repeated reminders
cal_times_sentINT N‘0’number of times this reminder has been sent
cal_actionVARCHAR12N‘EMAIL’action as imported, may be used in the future


Defines a custom report created by a user.

Column NameTypeLengthNullDefaultDescription
cal_loginVARCHAR25N creator of report
cal_report_idINT N unique id of this report
cal_is_globalCHAR1N‘N’is this a global report (can it be accessed by other users) (‘Y’ or ‘N’)
cal_report_typeVARCHAR20N format of report (html, plain or csv)
cal_include_headerCHAR1N‘Y’if cal_report_type is ‘html’, should the DEFAULT HTML header and trailer be included? (‘Y’ or ‘N’)
cal_report_nameVARCHAR50N name of the report
cal_time_rangeINT N time range for report:0 = tomorrow1 = today2 = yesterday3 = day before yesterday10 = next week11 = current week12 = last week13 = week before last20 = next week and week after21 = current week and next week22 = last week and this week23 = last two weeks30 = next month31 = current month32 = last month33 = month before last40 = next year41 = current year42 = last year43 = year before last
cal_userVARCHAR25Y user calendar to display (NULL indicates current user)
cal_allow_navCHAR1Y‘Y’allow user to navigate to different dates with next/previous (‘Y’ or ‘N’)
cal_cat_idINT Y category to filter on (optional)
cal_include_emptyCHAR1Y‘N’include empty dates in report (‘Y’ or ‘N’)
cal_show_in_trailerCHAR1Y‘N’include a link for this report in the “Go to” section of the navigation in the page trailer (‘Y’ or ‘N’)
cal_update_dateINT N date created or last updated (in YYYYMMDD format)


Defines one of the templates used for a report. Each report has three templates:

  1. Page template – Defines the entire page (except for header and footer). The following variables can be defined:
    • ${days}* – the HTML of all dates (generated from the Date template)
  2. Date template – Defines events for one day. If the report is for a week or month, then the results of each day will be concatenated and used as the ${days} variable in the Page template. The following variables can be defined:
    • ${events}* – the HTML of all events for the data (generated from the Event template)
    • ${date} – the date
    • ${fulldate} – date (includes weekday)
  3. Event template – Defines a single event. The following variables can be defined:
    • ${name}* – Brief Description of event
    • ${description} – Full Description of event
    • ${date} – Date of event
    • ${fulldate} – Date of event (includes weekday)
    • ${time} – Time of event (4:00pm – 4:30pm)
    • ${starttime} – Start time of event
    • ${endtime} – End time of event
    • ${duration} – Duration of event (in minutes)
    • ${priority} – Priority of event
    • ${href} – URL to view event details

* denotes a required template variable

Column NameTypeLengthNullDefaultDescription
cal_report_idINT N report id (in webcal_report table)
cal_template_typeCHAR1N type of template:’P’: page template represents entire document’D’: date template represents a single day of events’E’: event template represents a single event
cal_template_textTEXT Y text of template


This table holds data for site extra fields (customized in site_extra.php).

Column NameTypeLengthNullDefaultDescription
cal_idINT N0event id
cal_nameVARCHAR25N the brief name of this type (first field in $site_extra array)
cal_dateINT Y0only used for EXTRA_DATE type fields (in YYYYMMDD format)
cal_remindINT Y0how many minutes before event should a reminder be sent
cal_dataTEXT Y used to store text data


** This table stores timezones of the world.

Column NameTypeLengthNullDefaultDescription
tzidvarchar100NUnique name of timezone, try to use Olsen naming conventions
dtstartvarchar25YNULLearliest date this timezone represents YYYYMMDDTHHMMSSZ format
dtendvarchar25YNULLlast date this timezone represents YYYYMMDDTHHMMSSZ format
vtimezonetext Y Complete VTIMEZONE text gleaned from imported ics files


Defines a WebCalendar user.

Column NameTypeLengthNullDefaultDescription
cal_loginVARCHAR25N the unique user login
cal_passwdVARCHAR32Y the user’s password. (not used for http)
cal_lastnameVARCHAR25Y user’s last name
cal_firstnameVARCHAR25Y user’s first name
cal_is_adminCHAR1Y‘N’is the user a WebCalendar administrator (‘Y’ = yes, ‘N’ = no)
cal_emailVARCHAR75Y user’s email address
cal_enabledCHAR1Y‘Y’allow admin to disable account (‘Y’ = yes, ‘N’ = no)
cal_telephoneVARCHAR50Y user’s telephone
cal_addressVARCHAR75Y user’s address
cal_titleVARCHAR75Y user’s title
cal_birthdayINT Y user’s birthday
cal_last_loginINT Y user’s last log in date


Define layers for a user.

Column NameTypeLengthNullDefaultDescription
cal_layeridINT N0unique layer id
cal_loginVARCHAR25N login of owner of this layer
cal_layeruserVARCHAR25N login name of user that this layer represents
cal_colorVARCHAR25Y color to display this layer in
cal_dupsCHAR1Y‘N’show duplicates (‘N’ or ‘Y’)


Specify preferences for a user. Most preferences are set via pref.php. Values in this table are loaded after system settings found in webcal_config.

Column NameTypeLengthNullDefaultDescription
cal_loginVARCHAR25N user login
cal_settingVARCHAR25N setting name
cal_valueVARCHAR100Y setting value


This table stores the custom header/stylesheet/trailer. If configured properly, each user (or nonuser cal) can have their own custom header/trailer.

Column NameTypeLengthNullDefaultDescription
cal_loginVARCHAR25N user login (or nonuser cal name), the DEFAULT for all users is stored with the username ‘__system__’
cal_typeCHAR1N type (‘H’ = header, ‘S’ = stylesheet/script, ‘T’ = trailer)
cal_template_textTEXT Y text of template


A “view” allows a user to put the calendars of multiple users all on one page. A “view” is valid only for the owner (cal_owner) of the view. Users for the view are in webcal_view_user.

Column NameTypeLengthNullDefaultDescription
cal_view_idINT N unique view id
cal_ownerVARCHAR25N login name of owner of this view
cal_nameVARCHAR50N name of view
cal_view_typeCHAR1Y “W” for week view, “D” for day view, “M” for month view
cal_is_globalCHAR1N‘N’is this a global view (can it be accessed by other users) (‘Y’ or ‘N’)


Specify users in a view. See webcal_view.

Column NameTypeLengthNullDefaultDescription
cal_view_idINT N view id
cal_loginVARCHAR25N a user in the view