Calendar

Estimated reading: 4 minutes

Create new Calendar

In order to create a new calendar you only have to create a table with the type calendar. After a reset and a reload of the page you can see the new calendar in the media menue on the right side. Like for any other table you can add new fields to the calendar in the table settings.

Gantt-Chart

To see the calender as gantt-chart, you have to create a new table (type: link n:m) in the Table Settings of the calendar. As linked table you could chose e.g. field “roomtitle” from table “rooms”.

Resource for the gantt-chart

The created table has to be selected in the settings of the calendar (see calendar settings).

If the table was selected, you have to delete the session and reload the page. The calendar now has a different symbol and the gantt-chart was activated.

gantt-chart is activated in the calendar “myCalendar”

Calendar Settings

By clickinig on the gear-symbol in the Table Settings you can edit the calender settings.

calender settings
  • ressource: If a field of the calender is chosen, viewmode gantt-chart is activated. The entries of the selected field are shown on the y-axis in gantt-chart-viewmode.
  • viewmode: The standard view.
  • minTime: The first time that is shown (format: hh:mm:ss).
  • maxTime: The last time that is shown (format: hh:mm:ss).
  • weekNumberTitle: The text that is shown in front of the weeknumber (e.g. “week “).
  • firstHour: The hour that is shown first on the screen.
  • firstDay: The first day of the week (0=sunday, 1=monday, etc.).
  • slotMinutes: The amount of minutes per row.
  • snapMinutes: The precision in minutes with which a user can move dates using drag&drop.
  • editable: Allows the user to edit dates.
  • selectable: Allows the user to select multiple dates with clicking and dragging.
  • weekNumbers: If activated, shows week numbers.
  • weekends: If activated, shows weekends.
  • repetition: ??
  • allDayDefault: ??

Show User Defined Details Form

If you click on a date you can see the default detail form for this date. If you want to see a user defined Form instead of the default one you can insert it in the table rights. To do this go to administrate -> groups -> table rights.

At the item “meinKalender(myCalendar)” the form “Kalenderformular” is selected in the second drop down box. After a click on the button “save” and a reset of the application you can see the user defined form “Kalenderformular” if you click on a calendar entry. The first drop down box in the calendar row defines which form you see if you click on an entry in the table calender.

Use of the Indicator in the Calendar

Like for all other tables also in the table calendar you can define one or several inicators. Afterwards you can see them in the calendar view as well as in the table calendar. In the following example the calendar has the additional fields urgenca and room. With the help of the indicators it is defined that a calendar entry for which the “urgency” has the value “urgent” is coloured red, for the value “medium” it is coloured yellow. The second indicator in the example affects the field “room”. For each room a suitable symbol is set (sun, moon or star).

You need the following source code to get the above view of the calendar.

function calendarIndicatorSample($gtabid,$i,&$gresult) {
  global $filter;

  $field1 = $gresult[$gtabid][21][$i];   # urgency
  $field2 = $gresult[$gtabid][22][$i];    # room


  if($field1 == 'dringend') {
     $gresult[$gtabid]["indicator"]["color"][$i][1] = "ff0606"; # background color
  } else if ($field1 == 'mittel') {
     $gresult[$gtabid]["indicator"]["color"][$i][1] = "f5f506"; # background color
  }

    
  if ($field2 == 'Stern') {
     $gresult[$gtabid]["indicator"]["object"][$i][2] = "<IMG SRC=\"pic/ampel/star.gif\" style=\"cursor:pointer;\" BORDER=\"0\" TITLE=\"".$gdesc."\" ALT=\"".$gdesc."\"> "; #  image or text
  } else if ($field2 == 'Sonne') {
     $gresult[$gtabid]["indicator"]["object"][$i][2] = "<IMG SRC=\"pic/ampel/sun.gif\" style=\"cursor:pointer;\" BORDER=\"0\" TITLE=\"".$gdesc."\" ALT=\"".$gdesc."\"> ";
  } else if ($field2 == 'Mond') {
     $gresult[$gtabid]["indicator"]["object"][$i][2] = "<IMG SRC=\"pic/ampel/moon.gif\"  style=\"cursor:pointer;\" BORDER=\"0\" TITLE=\"".$gdesc."\" ALT=\"".$gdesc."\"> "; # image or text
  }

  $filter["indicator"][$gtabid] = 1; #numbers of indicators without rowcolor

  return true;
}

Calendar as User Calendar

A calendar can be created as group calendar as well as a private calendar for a single user. To do this a new filter rule is created in the field “ERSTUSER” in the user administration. With this filter rule the calendar is only visible, when the user that is logged in and the creater of the calendar are the same.