.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ================= 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: EXT: GLZ Calendar ================= Extension Key: **glz\_calendar** Copyright 2006, 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: 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: Introduction ------------ .. _What-does-it-do: 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: Screenshots ^^^^^^^^^^^ *Events only from Organisator 1* **April 2006** .. ### BEGIN~OF~TABLE ### .. _20-00bis13-0416-00: 20:00bis13.0416:00 """""""""""""""""" .. container:: table-row a 20:00bis13.0416:00 b Organisator 1: Event 1 .. _This-event-is-only-assigned-to-organisator-1-and-has-a-end-date-and: This event is only assigned to organisator 1 and has a end date and """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .. container:: table-row a This event is only assigned to organisator 1 and has a end date and time. .. _20-00: 20:00 """"" .. container:: table-row a 20:00 b Organisator 1: Event 2 .. _This-event-is-only-assigned-to-organisator-1-and-has-no-end-date-and: This event is only assigned to organisator 1 and has no end date and """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .. container:: table-row a This event is only assigned to organisator 1 and has no end date and time. .. _Unknown-Property: ((Unknown Property)) """""""""""""""""""" .. container:: table-row a b .. _Unknown-Property: ((Unknown Property)) """""""""""""""""""" .. container:: table-row a b Organisator 1: Event 3 .. _Unknown-Property: ((Unknown Property)) """""""""""""""""""" .. container:: table-row a b .. _18-00: 18:00 """"" .. container:: table-row a 18:00 b Organisator 1: Event 6 .. _Unknown-Property: ((Unknown Property)) """""""""""""""""""" .. container:: table-row a b .. ###### END~OF~TABLE ###### *Events only from organisator 2* **April 2006** .. ### BEGIN~OF~TABLE ### .. _20-00: 20:00 """"" .. container:: table-row a 20:00 b Organisator 2: Event 4 .. _14-00: 14:00 """"" .. container:: table-row a 14:00 b Organisator 2: Event 5 .. _Unknown-Property: ((Unknown Property)) """""""""""""""""""" .. container:: table-row a b .. _18-00: 18:00 """"" .. container:: table-row a 18:00 b Organisator 1: Event 6 .. _Unknown-Property: ((Unknown Property)) """""""""""""""""""" .. container:: table-row a b .. ###### END~OF~TABLE ###### *Events from all organisators* **April 2006** .. ### BEGIN~OF~TABLE ### .. _20-00: 20:00 """"" .. container:: table-row a 20:00 b Organisator 2: Event 4 .. _Unknown-Property: ((Unknown Property)) """""""""""""""""""" .. container:: table-row a b .. _20-00bis13-0416-00: 20:00bis13.0416:00 """""""""""""""""" .. container:: table-row a 20:00bis13.0416:00 b Organisator 1: Event 1 .. _This-event-is-only-assigned-to-organisator-1-and-has-a-end-date-and: This event is only assigned to organisator 1 and has a end date and """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .. container:: table-row a This event is only assigned to organisator 1 and has a end date and time. .. _20-00: 20:00 """"" .. container:: table-row a 20:00 b Organisator 1: Event 2 .. _This-event-is-only-assigned-to-organisator-1-and-has-no-end-date-and: This event is only assigned to organisator 1 and has no end date and """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .. container:: table-row a This event is only assigned to organisator 1 and has no end date and time. .. _Unknown-Property: ((Unknown Property)) """""""""""""""""""" .. container:: table-row a b .. _Unknown-Property: ((Unknown Property)) """""""""""""""""""" .. container:: table-row a b Organisator 1: Event 3 .. _Unknown-Property: ((Unknown Property)) """""""""""""""""""" .. container:: table-row a b .. _14-00: 14:00 """"" .. container:: table-row a 14:00 b Organisator 2: Event 5 .. _Unknown-Property: ((Unknown Property)) """""""""""""""""""" .. container:: table-row a b .. _18-00: 18:00 """"" .. container:: table-row a 18:00 b Organisator 1: Event 6 .. ###### END~OF~TABLE ###### 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: Plugin options ^^^^^^^^^^^^^^ .. ### BEGIN~OF~TABLE ### .. _Select-organisators: Select organisators """"""""""""""""""" .. container:: table-row 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: Max. number of events to display """""""""""""""""""""""""""""""" .. container:: table-row 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: Max. number of days to display """""""""""""""""""""""""""""" .. container:: table-row 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: Template file """"""""""""" .. container:: table-row Plugin Option Template file Meaning Set an alternative template file to the default file. .. _Startingpoint: Startingpoint """"""""""""" .. container:: table-row Plugin Option Startingpoint Meaning Page (sys folder) where the events are stored .. ###### END~OF~TABLE ###### .. _Configuration: Configuration ------------- The rendering can be controlled by Typoscript. A default setup is provided with the extension. .. _Reference: Reference ^^^^^^^^^ All values are subkeys of plugin.tx\_glzcalendar\_pi1. .. ### BEGIN~OF~TABLE ### .. _timezone: timezone """""""" .. container:: table-row 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: month\_begin """""""""""" .. container:: table-row Name month\_begin Type Object Description A Typoscript object which will be the month header. .. _month-end: month\_end """""""""" .. container:: table-row Name month\_end Type Object Description A Tyopscript object which willl be the month footer. .. _day-begin: day\_begin """""""""" .. container:: table-row Name day\_begin Type Object Description A Typoscript object which will be the day header .. _day-end: day\_end """""""" .. container:: table-row Name day\_end Type Object Description A Typoscript object which will be the day footer .. _Event: Event """"" .. container:: table-row Name Event Type Object Description A Typoscript object which will be the event it self. .. ###### END~OF~TABLE ###### The data values are accessible over the field property of stdwrap function. .. ### BEGIN~OF~TABLE ### .. _start-date: start\_date """"""""""" .. container:: table-row 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: start\_time """"""""""" .. container:: table-row 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: end\_date """"""""" .. container:: table-row 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: end\_time """"""""" .. container:: table-row 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: title """"" .. container:: table-row Field Name title Type String Content Contains the title of the current event. .. _description: description """"""""""" .. container:: table-row Field Name description Type String Content Contains the description of the current event .. _organisators: organisators """""""""""" .. container:: table-row Field Name organisators Type String Content Contains the assigned organisators as comma separated uids. .. _organisator-name: organisator\_name """"""""""""""""" .. container:: table-row Field Name organisator\_name Type String Content Name of the first assigned organisator .. _has-range: has\_range """""""""" .. container:: table-row Field Name has\_range Type Boolean Content If true, this event has a end date or end time or both. .. _has-start-time: has\_start\_time """""""""""""""" .. container:: table-row Field Name has\_start\_time Type Boolean Content If true, this event has a start time .. _template: template """""""" .. container:: table-row Field Name template Type String Content Contains the content of the template file selected in the plugin options. .. ###### END~OF~TABLE ###### .. _Example: 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 :code:`month\_begin` and :code:`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 :code:`month\_end` , only the HTML content of the template is taken without any replacements (contains only the table end tag :code:`` ). 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 :code:`day\_begin` and :code:`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 =
to if.isTrue.field = has\_range } 30 = TEXT 30 { field = end\_date wrap =  \| strftime = %d.%m if.isTrue.field = end\_date } 40 = TEXT 40 { field = end\_time strftime = %H:%M wrap =  \| if.isTrue.field = end\_time } } TITLE = TEXT TITLE.field = title ORGANISATOR = TEXT ORGANISATOR { field = organisator\_name wrap = \|:  } DESCRIPTION = TEXT DESCRIPTION.field = description } } } .. _Known-problems: 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 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. :border: 0 .. :height: 343 .. :id: Grafik1 .. :name: Grafik1 .. :width: 457 .. |img-2| image:: img-2.png .. :align: left .. :border: 0 .. :height: 464 .. :id: Grafik2 .. :name: Grafik2 .. :width: 552 .. |img-3| image:: img-3.png .. :align: left .. :border: 0 .. :height: 32 .. :id: Graphic1 .. :name: Graphic1 .. :width: 102