Calendar

From FollowTheScore
Jump to: navigation, search

English 中文(Chinese)

This is the homepage of the DPL Calendar application.

Concept

If you combine the power of some popular extensions it is possible to write a calendaring application completely in wiki code. This is very flexible compared to php programming.

Calendar kit evaluating table

See here


Architecture

{{#wgraph: svg| thumb=90 |

node Current_events {type cal}
node 2007-09-28-Event_A {}
node YYYY-10-04-Event_B   {}
node 2007-10-19-Event_C   {}
node Event                                     {type tpl}
node CatEvent                                  {type category label Events}
node CatHoliday                                {type category label Holiday}
edge Event CatEvent                            {type cat}
node Event_template                            {type tpl}
node Event_intro                               {type editintro}
edge Event_intro          Event_template       {kind rightnear type editintro}
edge 2007-09-28-Event_A   Event                {type incl}
edge YYYY-10-04-Event_B   Event                {type incl}
edge YYYY-10-04-Event_B   CatHoliday           {type catgeory}
edge 2007-10-19-Event_C   Event                {type incl}
edge Event_template       2007-09-28-Event_A   {type edit}
edge Event_template       YYYY-10-04-Event_B   {type edit}
edge Event_template       2007-10-19-Event_C   {type edit}
edge Event_template       Event                {type incl}
edge Current_events       Calendar_month       {type incl}
node Calendar_month                            {type tpl}
node CalendarSingle                            {type tpl}
node Calendar_link                             {type tpl}
edge Calendar_month       2007-09-28-Event_A   {type dpl}
edge Calendar_month       YYYY-10-04-Event_B   {type dpl}
edge Calendar_month       2007-10-19-Event_C   {type dpl}
edge Calendar_month       CalendarSingle       {type incl}
edge CalendarSingle       Calendar_link        {type incl}
edge CalendarSingle       Current_events       {type link label 'next month
prev. month' }
node Calendar/MonthStartMon                    {type tpl}
node Calendar/MonthStartTue                    {type tpl}
edge CalendarSingle    Calendar/MonthStartMon  {type incl}
edge CalendarSingle    Calendar/MonthStartTue  {type incl}
nodetype tpl        {color yellow    }
nodetype category   {color lightgreen}
nodetype cal        {color lightblue }
nodetype editsample {color lightcyan }
nodetype editintro  {color lightcyan }
nodetype *          {color #ffdddd bordercolor darkgray}
edgetype incl  {color darkgray}
edgetype link  {color blue}
edgetype cat   {color darkgreen}
edgetype dpl   {color red thickness 4 label 'DPL query'}
edgetype edit  {linestyle dotted color blue}
node.fontname helvR10

}}

  • Templates are in yellow.
  • The pages describing an event are in red. Their names must start with the date of the event (format: YYYY-MM-DD) or with 'YYYY-' plus month and day (for recurring yearly events).
  • We use two edit helpers (in cyan) when event pages are created.
  • The entry page for the calendar (Current events) is in blue.
  • Categories are in green.

The design is as follows:

  1. The user calls the entry page Current events. Be careful if you change its name: The name of this page must be passed as an argument (named 'basepage') to the template 'Calendar month'.
  2. The basepage can be called by the user without any arguments. Then it uses a date function to calculate the current month. It can also be called from another calendar page - in which case the desired year & month are passed as parameters via the Call extension. There are more parameters for Current events - see the explanation below.
  3. Template 'Calendar month' ...
    • shows the calendar box. The calendar box contains the titles of the event pages (the first part of the titles´ names which contain the resp. date is suppressed). Below the calendar there is an optional event list which shows either all events of the current month or all events regardless of month.
    • expects a 'purpose' parameter. If this parameter is set it acts as a filter, i.e. only events will be shown which belong to a category with the name of the 'purpose'. This allows you to have several calendars in parallel
    • uses a DPL query to find all articles in category 'Event' which belong to the selected year/month
    • shows the selected articles in a list, together with some selected chapters (like Participants ..) and with their categories
    • offers a link to create new events (using the edit template Event template)


Installation

Install extensions

You need

  1. from this website (via Download and unzip)
    • DPL extension
    • Call extension
    • Inputbox extension (this is slightly modified compared to the official release)
  2. from mediawiki.org:

The process of installation is the same as always: create a directory per extension in the 'extension' folder and put a 'require_once' statement into your LocalSettings.php.

Install Calendar Templates

Copy / paste the following list of articles to Special:export and import the resulting XML text into your wiki:

Current events
Template:Calendar month
Template:CalendarSingle
Template:Calendar link
Template:Calendar/MonthStartMon
Template:Calendar/MonthStartTue
Template:Calendar/MonthStartWed
Template:Calendar/MonthStartThu
Template:Calendar/MonthStartFri
Template:Calendar/MonthStartSat
Template:Calendar/MonthStartSun
Template:!
Template:(!
Template:!)
Template:Event template
Event intro
Template:Event
Template:Create Event

Using the calendar

Create new documents which describe events. You can do this by clicking on the DATE in the calendar or in the conventional way.

  • Follow the naming convention: The name must start with the date (YYYY-MM-DD, followed by some short text describing the event
    Example: "2007-10-31 some important event"
  • Note that your document must belong to category 'Events'. This will automatically be the case if you include the template "Event" in the first line of your event description.
  • You can add your document to other categories as well; these will show up in the event table below the calendar
  • You can define yearly recurring events by using 'YYYY' instead of the exact year.
    Example: "YYYY-12-24 Christmas Evening"
  • In a similar way you can define monthly recurring events by using 'YYYY-MM' instead of year and month.
    Example: "YYYY-MM-01 start of month"

Currently it is not possible to define other regular patterns.

Customizing

To customize the list of events that are displayed below each calendar, take a close look in the DPL manual at the include parameter and the format parameter. In our example in template Template:calendar month, we have:

#Summary,#Participants,#Location

which means to take the content of Summary, Participants and Location sections.

You could modify the name of sections, the number of sections or even take the parameters of a template inside the event page. Again, see the DPL manual.

Demo

Now we are going to include Current events which will give us the actual calendar right here. Current events understands the following parameters:

  • year - defaults to the current year
  • month - defaults to the current month
  • purpose - empty or a string which will be used as a category filter. Only events belonging to that category will be shown. You can even specify a group of purposes by using the broken pipe (¦) character as a separator.
  • namespace - empty or a namespace string. Only event defined in articles in that namespace will be shown; new events will be created in an article which belongs to that namespace
  • show - empty or the name of a chpater in the event articles; the contents of that chapter will be included below the title of the article. The chapter can also contain an image.
  • eventList = {no|current|all}, defaults to 'current'; produces a tabular report of the selected events
  • width = empty or a width specification for the table, e.g. '500px' or '100%'; default is to make the calendar as small as possible
  • noadd = empty or '1'; when set to '1' the calendar will not offer a link to create an event page
  • nolink = empty or '1'; when set to '1' the calendar will not contain a link to the event page. Instead the day number will link to the event list. Using this option with "eventList=no" does not make sense. If nolinks is set to '1', noadd is implicitly set to '1'.

{{#vardefine:year|2019}}{{#vardefine:month|03}} {{#vardefine:width|}}{{#vardefine:noadd|}}{{#vardefine:nolink|}}{{#vardefine:purpose|}}{{#vardefine:show|}}{{#vardefine:namespace|}}

{{Calendar/MonthStartError: Invalid time.
[[Special:Call/:Current events,year=Error: Invalid time.,month=Error: Invalid time.,basepage=Current events,eventList=current,purpose={{#var:purpose}},nolink={{#var:nolink}},noadd={{#var:noadd}},show={{#var:show}},namespace={{#var:namespace}},width={{#var:width}}|<<]]

Error: Invalid time.
{{#replace:{{#replace:{{#replace:²²:Category:{{#var:purpose}}³³|¦|³³, ²²:Category:}}|²|[}}|³|]}}

[[Special:Call/:Current events,year=Error: Invalid time.,month=Error: Invalid time.,basepage=Current events,eventList=current,purpose={{#var:purpose}},nolink={{#var:nolink}},noadd={{#var:noadd}},show={{#var:show}},namespace={{#var:namespace}},width={{#var:width}}|>>]]
Mo Tu We Th Fr Sa Su
01=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

01
02=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

02
03=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

03
04=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

04
05=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

05
06=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

06
07=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

07
08=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

08
09=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

09
10=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

10
11=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

11
12=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

12
13=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

13
14=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

14
15=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

15
16=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

16
17=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

17
18=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

18
19=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

19
20=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

20
21=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

21
22=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

22
23=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

23
24=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

24
25=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

25{{{#var:show.default|%PAGE%=YYYY-MM-25 prepare plan for next month|%TITLE%=YYYY-MM-25 prepare plan for next month|%DATE%=|%USER%=}}
26=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

26
27=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

27{{{#var:show.default|%PAGE%=YYYY-MM-27 Test calendar|%TITLE%=YYYY-MM-27 Test calendar|%DATE%=|%USER%=}}
28=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

28
29=Expression error: Unexpected < operator. 30=Expression error: Unexpected < operator. 31=Expression error: Unexpected < operator. year={{#var:year}}

}}

{{#var:year}}
   

[[Special:Call/Calendar month,eventList=all,basepage=Current events,year={{#var:year}},month={{#var:month}},purpose={{#var:purpose}}|all events]]

There are 2 events planned this month.

Date / Event name Event summary Participants Location Categories
YYYY-MM-25 prepare plan for next month

By the 25th of each month we have to publish the planned excursions for next month

blackboard in the entrance hall

Events
YYYY-MM-27 Test calendar

Describe the event here lit...

Enter the participants here ...

Enter the place here ...

Events


DPL Calendar code generater

{{#form: name=demo |action={{#replace:/dpldemo/index.php?title=Calendar

                           |%^([\/]\S*[index.php])([\/])([Calendar]\S*)%
                           |\1
                          }}|

{{#input: name= title |type= hidden | value = Special:Call/DPL Calendar code generater zh-tw }}

語言(Language)  {{#input: name=lang | type=select | value = |
  • 中文
  • English

}}

指定年份(year)  {{#input: name=year | value = }}
指定月份(month)  {{#input: name=month | value = }}
指定名字空間(namespace)  {{#input: name=namespace | value = }}
用途(purpose)  {{#input: name=purpose | value = }} 例「張三記事,李四記事」 (e.g: Michael's events,dpl group's event)
顯示指定章節(show)  {{#input: name=show | value = }}
顯示報表(eventList)  {{#input: name=eventList | type=select | value = |

  • current
  • no
  • all

}}

本月份(current),不顯示(no),顯示全部(all)
寛度 (width)  {{#input: name=width | value = 500px }}例: "100%" 或 "500px"
無法新增記事(noadd)  {{#input: name=noadd | type=select | value = |
  • 0
  • 1

}}

不顯示記事之超連結(nolink)  {{#input: name=nolink | type=select | value = |
  • 0
  • 1

}}

 {{#input: type = submit | value = 產生(Generate)}} 放棄(reset)   graph

}}


{{#vardefine:year|2019}}{{#vardefine:month|03}} {{#vardefine:width|}}{{#vardefine:noadd|}}{{#vardefine:nolink|}}{{#vardefine:purpose|{{#replace:|,|¦}}}}{{#vardefine:show|}}{{#vardefine:namespace|}}

{{Calendar/MonthStartError: Invalid time.
[[Special:Call/:Current events,year=Error: Invalid time.,month=Error: Invalid time.,basepage=Current events,eventList=,purpose={{#var:purpose}},nolink={{#var:nolink}},noadd={{#var:noadd}},show={{#var:show}},namespace={{#var:namespace}},width={{#var:width}}|<<]]

Error: Invalid time.
{{#replace:{{#replace:{{#replace:²²:Category:{{#var:purpose}}³³|¦|³³, ²²:Category:}}|²|[}}|³|]}}

[[Special:Call/:Current events,year=Error: Invalid time.,month=Error: Invalid time.,basepage=Current events,eventList=,purpose={{#var:purpose}},nolink={{#var:nolink}},noadd={{#var:noadd}},show={{#var:show}},namespace={{#var:namespace}},width={{#var:width}}|>>]]
Mo Tu We Th Fr Sa Su
01=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

01
02=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

02
03=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

03
04=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

04
05=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

05
06=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

06
07=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

07
08=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

08
09=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

09
10=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

10
11=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

11
12=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

12
13=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

13
14=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

14
15=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

15
16=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

16
17=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

17
18=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

18
19=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

19
20=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

20
21=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

21
22=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

22
23=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

23
24=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

24
25=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

25{{{#var:show.default|%PAGE%=YYYY-MM-25 prepare plan for next month|%TITLE%=YYYY-MM-25 prepare plan for next month|%DATE%=|%USER%=}}
26=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

26
27=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

27{{{#var:show.default|%PAGE%=YYYY-MM-27 Test calendar|%TITLE%=YYYY-MM-27 Test calendar|%DATE%=|%USER%=}}
28=

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:purpose}}' for parameter 'category'.

28
29=Expression error: Unexpected < operator. 30=Expression error: Unexpected < operator. 31=Expression error: Unexpected < operator. year={{#var:year}}

}}

{{#var:year}}
   

No events planned.



Your query used the following parameters:
{{:Current events
|width=
|noadd=
|nolink=
}}