Open main menu

Extension:RecurrentEventCalendar

MediaWiki extensions manual
OOjs UI icon advanced.svg
RecurrentEventCalendar
Release status: stable
Implementation Tag , Page action
Description Allows users to generate single or recurrent multiple event calendar pages with one form.
Author(s) Michele Fella <michele.fella@gmail.com> (Michele.Fellatalk)
Latest version 0.1.0 (2014-05-05)
MediaWiki 1.19+
Database changes No
License Apache License
Download
<RecurrentEventCalendar>
Translate the RecurrentEventCalendar extension if it is available at translatewiki.net
Check usage and version matrix.
Issues Open tasks · Report a bug

The RecurrentEventCalendar extension allows user to generate single or recurrent multiple event calendar pages with one form and query those events using SMW..

It was implemented by Mik.

Contents

InstallationEdit

  • Download and place the file(s) in a directory called RecurrentEventCalendar in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/RecurrentEventCalendar/RecurrentEventCalendar.php";
    
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

ExampleEdit

List of sample templates, form, properties and reclink test page are included in the examples folder within RecurrentEventCalendar package downloadable from GIT.

Wiki codeEdit

{{#reclink:
form=Event
|link text=Create event series
|link type=button
|iterator=date
|startday=Event[EventStartDay]
|endday=Event[EventEndDay]
|starttime=Event[EventStartTime]
|endtime=Event[EventEndTime]
|isrecurrent=Event[EventRecurrent]
|recurrentstart=Event[EventRecurrentStart]
|recurrentend=Event[EventRecurrentEnd]
|recurrentunit=Event[EventRecurrentUnit]
|recurrentperiod=Event[EventRecurrentPeriod]
|new window
|autofield=
|autofill=
}}

General syntaxEdit

In order to work users should define:

* a Template for a single event representing the following information:
 EventStartDay: Defines the day when the single event starts
 EventEndDay: Defines the day when the single event ends
 EventStartTime: Defines the time when the single event starts 
 EventEndTime: Defines the time when the single event ends
 EventRecurrent: Defines if the event is recurrent (it must contain one of the value Yes or No)
 EventRecurrentStart: Defines the start of the recurrent event (consider it as the first day of the recurrent event)
 EventRecurrentEnd: Defines the end of the recurrent event (consider it as the last day the recurrent event can take place)
 EventRecurrentPeriod: Defines the interval between the start of a single event and the next occurrence (it is a numeric value greater t han zero)
 EventRecurrentUnit: Defines the interval unit between the start of a single event and the next occurrence (it must be one value between day, week, month, year)
* a Form implementing one step process mapped to the single event Template wich allows user to specify optional values if recurrent event. (see example)
* a recinput button where the mandatory REC fields are mapped on the Event form. (see example)
User should properly map semantic information within the Template in order to work with SMW.
User would want to define semantic properties to limit the input possible values.
Please consider that the examples templates, form, properties might need to be adjusted according to yout mediawiki configuration.

RecurrentEventCalendar are constructed like this:

{{#reclink:
form=Event
|link text=Create event series
|link type=button
|iterator=date
|startday=Event[EventStartDay]
|endday=Event[EventEndDay]
|starttime=Event[EventStartTime]
|endtime=Event[EventEndTime]
|isrecurrent=Event[EventRecurrent]
|recurrentstart=Event[EventRecurrentStart]
|recurrentend=Event[EventRecurrentEnd]
|recurrentunit=Event[EventRecurrentUnit]
|recurrentperiod=Event[EventRecurrentPeriod]
|new window
}}

ParametersEdit

Parameter Mandatory Description Notes
form= Yes Shuold point to the user defined event form
link text= Yes Sets the name of the reclink button which opens the form when clicked.
link type= Yes Only button value allowed at the moment.
iterator= Yes Only date value allowed at the moment.
startday= Yes Form field name containing the start day of the single event. This must be returned also by the form
endday= Yes Form field name containing the end day of the single event (if not specified it . If this value is not returned by the form this will automatically be assigned wiht the value of startday
starttime= Yes Form field name containing the start time of the single event. If this value is not returned by the form the time value will be taken by the startday field. If startday fiels contains no value the value 00:00 will be automatically assigned.
endtime= Yes Form field name containing the end time of the single event. If this value is not returned by the form the time value will be taken by the endday field. If endday fiels contains no value the value 23:59 will be automatically assigned.
isrecurrent= Yes Form field name defining whether the event is recurrent or not. Possible values should be yes or No. If none of possible values is returned by the form (or no value at all) the value 23:59 will be automatically assigned.
recurrentstart= Yes Form field name containing the start day range for the recurrent event. When page will be created this value will always be equal to the startday value (whether or not it is returned by the form.
recurrentend= Yes Form field name containing the end day range for the recurrent event. If this value is not returned by the form and isrecurrent value is equal to Yes an error willl be showed.
recurrentunit= Yes Form field name containing the unit between the startday of each recurrent event. If this value is not returned by the form and isrecurrent value is equal to Yes an it will take a default value of 1.
recurrentperiod= Yes Form field name containing the period of unit. Possible values are day, week, month and year. If this value is not returned by the form and isrecurrent value is equal to Yes an it will take a default value of day.
new window= No Sets whether or not the form shuold be opened in a new window.
autofield= No To be used for autofill, allow to define a parameter name for one field of the form.

Example: param1=formname[fieldname];param2=formname[fieldname]; and so on.

Multiple parameters shold be separated by ";" on the same line.

Example of declaration is as param1:Form[FormField];param2:Form[FormField];..
autofill= No Allows to override any of the form field after the form submission. The changes are applied accordind to the rules specified in this field.

Each rule contains four part separated by ":" = target:formvalue:match:newvalue

and should be read as "If formvalue is equal to the string match the target field will assume the newvalue.

Multiple rules shold be separated by ";" on the same line. (rule1;rule2..)

Within a rule use "." (dot) character to separate param names and strings.

The syntax is of one rule is:

autofill=target:paramX.paramY:"ValueToMatchForParamX"."ValueToMatchForParamY":ParamZ."a static string".AnotherParamValue."one more string".OneMoreFormValue;

Use only String or Params in this fiels. All the Params shold be mapped in autofield with their corresponding form field from which the value will be taken.

Configuration parametersEdit

The following settings may be used:

  • $recgPageGenerationLimits to specify the maximum number of pages that may be
 generated per request by a member of a user group. If a user is in more than
 one group, the highest number is used.
 Default setting:
   $recgPageGenerationLimits = array(
     '*' => 0,
     'user' => 10,
     'sysop' => REC_NOLIMIT
   );

If you want to use these settings, just include them in LocalSettings.php AFTER the require_once("$IP/extensions/RecurrentEventCalendar/RecurrentEventCalendar.php");

See alsoEdit