DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: GLZ Calendar

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:David Nyffenegger
Changed:2006-04-01T22:55:04
Email:david@nyffis.ch
Info 2:
Info 3:
Info 4:

EXT: GLZ Calendar

Extension Key: glz_calendar

Copyright 2006, david@nyffis.ch, <david@nyffis.ch>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

EXT: GLZ Calendar 1

Introduction 1

What does it do? 1

Screenshots 2

Users manual 3

Administration 3

Installation and Typoscript default settings 3

Mapping with TemplaVoila 4

Configuration 6

FAQ 6

Tutorial 6

Known problems 6

To-Do list 6

Changelog 7

Linking 7

Introduction

What does it do?

Yet another calendar, because I found no one, which fits my requirements. Features: Each event can be assigned to one or more "organisators". The view can be configured to show only events from specified organisators. Also the number of events or days to display can be limited. As for the rendering, the events are grouped into month and day.

Screenshots

Events only from Organisator 1

April 2006

20:00bis13.0416:00

a

20:00bis13.0416:00

b

Organisator 1: Event 1

This event is only assigned to organisator 1 and has a end date and

a

This event is only assigned to organisator 1 and has a end date and time.

20:00

a

20:00

b

Organisator 1: Event 2

This event is only assigned to organisator 1 and has no end date and

a

This event is only assigned to organisator 1 and has no end date and time.

((Unknown Property))

a

b

((Unknown Property))

a

b

Organisator 1: Event 3

((Unknown Property))

a

b

18:00

a

18:00

b

Organisator 1: Event 6

((Unknown Property))

a

b

Events only from organisator 2

April 2006

20:00

a

20:00

b

Organisator 2: Event 4

14:00

a

14:00

b

Organisator 2: Event 5

((Unknown Property))

a

b

18:00

a

18:00

b

Organisator 1: Event 6

((Unknown Property))

a

b

Events from all organisators

April 2006

20:00

a

20:00

b

Organisator 2: Event 4

((Unknown Property))

a

b

20:00bis13.0416:00

a

20:00bis13.0416:00

b

Organisator 1: Event 1

This event is only assigned to organisator 1 and has a end date and

a

This event is only assigned to organisator 1 and has a end date and time.

20:00

a

20:00

b

Organisator 1: Event 2

This event is only assigned to organisator 1 and has no end date and

a

This event is only assigned to organisator 1 and has no end date and time.

((Unknown Property))

a

b

((Unknown Property))

a

b

Organisator 1: Event 3

((Unknown Property))

a

b

14:00

a

14:00

b

Organisator 2: Event 5

((Unknown Property))

a

b

18:00

a

18:00

b

Organisator 1: Event 6

This screenshot shows the grouping by month and day as well as the assignment possibilties. Users manual ------------

Create a sys-folder

Within this sys-folder, create the organisators and the events (with “create new record”)

img-1 Insert the “GLZ Calendar” plugin on the desired page

img-2 Set the plugin options according your needs:

Plugin options

Select organisators

Plugin Option

Select organisators

Meaning

Only events which are assigned to one of the selected organisators are displayed. If no item is selected, all events will be displayed.

Max. number of events to display

Plugin Option

Max. number of events to display

Meaning

Displays not more events than the specified number. If '0' or no value is set, there will be no limit of events.

Max. number of days to display

Plugin Option

Max. number of days to display

Meaning

Hides all events with a start date greater than the current date + the given number. If '0' or no value is set, there will be no limit.

Template file

Plugin Option

Template file

Meaning

Set an alternative template file to the default file.

Startingpoint

Plugin Option

Startingpoint

Meaning

Page (sys folder) where the events are stored

Configuration

The rendering can be controlled by Typoscript. A default setup is provided with the extension.

Reference

All values are subkeys of plugin.tx_glzcalendar_pi1.

timezone

Name

timezone

Type

Int

Description

Specifies the timezone of the time values stored in the database.

This is necessary because the strftime function (stdwrap) assumes UTC input where as the TYPO3 backend stores the time information in the browsers timezone.

Example:

1

means GMT+1

month_begin

Name

month_begin

Type

Object

Description

A Typoscript object which will be the month header.

month_end

Name

month_end

Type

Object

Description

A Tyopscript object which willl be the month footer.

day_begin

Name

day_begin

Type

Object

Description

A Typoscript object which will be the day header

day_end

Name

day_end

Type

Object

Description

A Typoscript object which will be the day footer

Event

Name

Event

Type

Object

Description

A Typoscript object which will be the event it self.

The data values are accessible over the field property of stdwrap function.

start_date

Field Name

start_date

Type

Int (unix timestamp)

Content

Contains the start date of the current event as unix timestamp. Zero means: no start date set

start_time

Field Name

start_time

Type

Int (unix timestamp)

Content

Contains the start time of the current event as unix timestamp. Zero means: not start time set.

Example: if in the BE the value entered was “20:00”, this field will be set to 20 * 3600 = 72'000.

end_date

Field Name

end_date

Type

Int (unix timestamp)

Content

Contains the end date of the current event as unix timestamp. Zero means: no end date set

end_time

Field Name

end_time

Type

Int (unix timestamp)

Content

Contains the end time of the current event as unix timestamp. Zero means: not end time set.

title

Field Name

title

Type

String

Content

Contains the title of the current event.

description

Field Name

description

Type

String

Content

Contains the description of the current event

organisators

Field Name

organisators

Type

String

Content

Contains the assigned organisators as comma separated uids.

organisator_name

Field Name

organisator_name

Type

String

Content

Name of the first assigned organisator

has_range

Field Name

has_range

Type

Boolean

Content

If true, this event has a end date or end time or both.

has_start_time

Field Name

has_start_time

Type

Boolean

Content

If true, this event has a start time

template

Field Name

template

Type

String

Content

Contains the content of the template file selected in the plugin options.

Example

The following listing shows the Typoscript setup provided with the extension and explains it.

First, a temporary object to access the template is made, because it is used often.

temp {

template = TEXT

template.field = template

}

Now, the real setup starts. The timezone is set to 1, which means GMT+1. With this information all time values (start time and end time) are transformed into UTC time. This is important for the strftime function of stdwrap, because the PHP strftime function assumes as input a timestamp in UTC and formats it according the PHP locale settings (setlocale).

plugin.tx_glzcalendar_pi1 {

# timezone of *entered* date/time values in database

timezone = 1

The next step is to setup the objects month\_begin and month\_end . They can be any valid Typoscript object. In the setup below, an object of type TEMPLATE is used. The HTML template is not selected directly over a file object. The plugin provieds the contentof the selected template file (plugin options) in the field '”template”. So the template property of the TEMPLATE object is set as TEXT object where the value is the field “template” (this setup is done in temp.template and copied).

The next step is to select the desired subpart of the HTML template and replace the markers. Here, the marker MONTH is replaces the by output of the strftime function with the start date as input.

As for the month\_end , only the HTML content of the template is taken without any replacements (contains only the table end tag </table> ).

month_begin = TEMPLATE

month_begin {

template < temp.template

workOnSubpart = MONTH_BEGIN

marks {

MONTH = TEXT

MONTH {

field = start_date

strftime = %B %Y

}

}

}

month_end = TEMPLATE

month_end {

template < temp.template

workOnSubpart = MONTH_END

}

Very similar to the two objects before, the day\_begin and day\_end are initialized.

day_begin = TEMPLATE

day_begin {

template < temp.template

workOnSubpart = DAY_BEGIN

marks {

DAY = TEXT

DAY {

field = start_date

strftime = %d. %A

}

}

}

day_end = TEMPLATE

day_end {

template < temp.template

workOnSubpart = DAY_END

}

Now, the object for the event itself is set. To substitute the TIME mark, some more effort than usual is necessary. A Content Object Array (COA) is used to render the the start time and optional end. With the if property of the stdwrap function and the related fields, the second part is made optional.

event = TEMPLATE

event {

template < temp.template

workOnSubpart = EVENT

marks {

TIME = COA

TIME {

10 = TEXT

10 {

field = start_time

strftime = %H:%M

if.isTrue.field = has_start_time

}

20 = TEXT

20 {

value = <br>to

if.isTrue.field = has_range

}

30 = TEXT

30 {

field = end_date

wrap = &nbsp;|

strftime = %d.%m

if.isTrue.field = end_date

}

40 = TEXT

40 {

field = end_time

strftime = %H:%M

wrap = &nbsp;|

if.isTrue.field = end_time

}

}

TITLE = TEXT

TITLE.field = title

ORGANISATOR = TEXT

ORGANISATOR {

field = organisator_name

wrap = |:&nbsp;

}

DESCRIPTION = TEXT

DESCRIPTION.field = description

}

}

}

Known problems

A start time of “00:00” cannot be set because the value '0' is threated as 'not set'.

img-3 EXT: GLZ Calendar - 6