VI. Event Reference

Midgard 1.4 'Bifrost' introduces support for building Web-based calendar and scheduling applications that share all the regular features of Midgard data handling.

1. Event Record Definition

An event record contains information about an event.

Fields of an event record

id

The id of the event record.

up

The id of the parent event.

start

The start date and time of the event (Unix timestamp).

end

The end date and time of the event (Unix timestamp).

title

The title of the event.

description

The description of the event.

extra

A free form extra information field.

type

The type of the event (an integer).

busy

Two events cannot overlap if one of them has the busy set to 1.

owner

The id of the group that owns the event.

creator

Points to the person-id of the creator of the event.

created

Date and time the event was created.

revisor

Points to the person-id of the last revisor of the event.

revised

Date and time of the last revision of the event.

revision

An integer representing the number of times the event has been revised.

locker

Points to the person-id of the locker of the event.

locked

Date and time the event has been locked.

sitegroup

The id of the sitegroup the event is in.

2. Event Object Definition

This section describes the contents of event objects. Most object parameters map directly to the record fields described above.

The functions listed within the object definition are the object methods that are available for the object. Usage information about those methods can be found in Object Methods.

/* Event Object Prototype */

Class event {

  var $N;     # Only with mgd_list_XXX functions.
  var $id;
  var $up;
  var $start;
  var $end;
  var $title;
  var $description;
  var $extra;
  var $type;
  var $owner;
  var $creator;
  var $created;
  var $locker;
  var $locked;
  var $revisor;
  var $revised;
  var $revision;
  var $sitegroup;

  function fetch(); # Only with mgd_list_XXX functions.
  
  function create();
  function update();
  function delete();

  function createattachment();
  function updateattachment();
  function deleteattachment();
  function listattachments();
  function getattachment();
  function openattachment();
  function serveattachment();
  
  function parameter();
  function searchparameters();
  function listparameters();
  
  function getsitegroup();
  function setsitegroup();

}
Table of Contents
mgd_get_event — Get an event record
mgd_create_event — Create a new event record
mgd_delete_event — Delete an event record
mgd_update_event — Update an event record
mgd_copy_event — Copy an event
mgd_move_event — Move an event to different event
mgd_is_event_owner — Check event ownership
mgd_count_events_in_month — Count the events in a month
mgd_count_events_in_period — Count the events in a period
mgd_list_events — List event records
mgd_list_events_all — List event records under event tree
mgd_list_events_between — list event records between two timestamps