Jump to content

Extension:CampaignEvents: Difference between revisions

From mediawiki.org
Content deleted Content added
m rm redundant mw and php versions from infobox
+virtual domain
 
(37 intermediate revisions by 12 users not shown)
Line 1: Line 1:
<languages />
{{distinguish|Extension:Campaigns}}
{{Extension
{{Extension
|status = experimental
|status = stable
|type1 = special
|type1 = special
|type2 = skin
|type2 = skin
|author = [[:m:Campaigns/Foundation Product Team|Campaigns Team]]
|author = [[m:Special:MyLanguage/Campaigns/Foundation Product Team|<translate><!--T:15--> Campaigns Team</translate>]]
|description = Provides features for campaign organizers and participants
|description = <translate><!--T:16--> Provides features for event organizers and participants</translate>
|download = {{WikimediaDownload}}
|download = {{WikimediaDownload}}
|compatibility policy = rel
|compatibility policy = rel
|phabricator = CampaignEvents
|phabricator = CampaignEvents
|virtual domain = virtual-campaignevents
|table1 = campaign_events
|table1 = campaign_events
|table2 = ce_participants
|table2 = ce_participants
|table3 = ce_organizers
|table3 = ce_organizers
|table4 = ceo_roles
|table4 = ce_address
|table5 = ce_event_address
|table6 = ce_tracking_tools
}}
}}


'''CampaignEvents''' is a MediaWiki extension, created and maintained by the Wikimedia Foundation [[m:Special:MyLanguage/Campaigns/Foundation Product Team|Campaigns Team]], which provides tools for organizing and running events, including registration, communication and an organizer dashboard.
== Installation ==
See [[m:Special:MyLanguage/Campaigns/Foundation Product Team/Registration|Registration]] for more information.
{{ExtensionInstall|registration=required}}


<translate>
== Installation == <!--T:17-->
</translate>
{{ExtensionInstall
|registration=required
|db-update=yes
|custom-steps=
*<translate><!--T:18--> Schedule a cronjob that runs the [[<tvar name=1>#script to update timezones</tvar>|#script to update timezones]] (optional), and one for the [[<tvar name=2>#script to aggregate participant answers</tvar>|#script to aggregate participant answers]].</translate>
}}


<translate>
== Configuration ==
== Configuration == <!--T:19-->


=== User rights ===
=== User rights === <!--T:20-->
</translate>
{| class="wikitable prettytable"
{| class="wikitable prettytable"
! <translate><!--T:21--> Right</translate>
! Right
! Description
! <translate><!--T:22--> Description</translate>
|-
|-
| campaignevents-create-registration || <!-- TODO {{int|right-campaignevents-create-registration}} -->
| campaignevents-enable-registration || <translate><!--T:23--> Enable event registrations</translate>
|-
| campaignevents-delete-registration || <translate><!--T:24--> Delete event registrations</translate>
|-
| campaignevents-organize-events || <translate><!--T:25--> Organize events</translate>
|-
| campaignevents-email-participants || <translate><!--T:26--> Email event participants</translate>
|}
|}


<translate>
=== Parameters ===
=== Parameters === <!--T:27-->
</translate>
{| class="wikitable prettytable"
{| class="wikitable prettytable"
! Variable name
! <translate><!--T:28--> Variable name</translate>
! Default value
! <translate><!--T:29--> Default value</translate>
! Description
! <translate><!--T:30--> Description</translate>
|-
|-
| <code>$wgCampaignEventsDatabaseCluster</code>
| <code>$wgCampaignEventsProgramsAndEventsDashboardInstance</code>
| {{phpi|null}}
| <syntaxhighlight lang="php">false</syntaxhighlight>
| <translate><!--T:31--> Determines which instance of the [[<tvar name=1>m:Special:MyLanguage/Programs & Events Dashboard</tvar>|P&E Dashboard]] should be used, if any. Supported values are <tvar name=2>{{phpi|'production'}}</tvar>, <tvar name=3>{{phpi|'staging'}}</tvar>, or <tvar name=4>{{phpi|null}}</tvar> to not use the dashboard.</translate>
| The database cluster to use. False means the cluster of the current wiki will be used.
|-
|-
| <code>$wgCampaignEventsDatabaseName</code>
| <code>$wgCampaignEventsProgramsAndEventsDashboardAPISecret</code>
| {{phpi|null}}
| <syntaxhighlight lang="php">false</syntaxhighlight>
| <translate><!--T:32--> API secret to use with the selected P&E Dashboard instance.</translate> <translate><!--T:33--> Must be configured if you intend to use the P&E Dashboard.</translate>
| The database to use. False means the database of the current wiki will be used.
|-
| <code>$wgCampaignEventsEnableWikimediaParticipantQuestions</code>
| {{phpi|true}}
| <translate><!--T:34--> Whether to enable Wikimedia-specific questions that can be asked to participants, such as whether they belong to a Wikimedia affiliate.</translate>
|}
|}


<translate><!--T:35--> The extension can be configured to store data into a database other than the main wiki DB.</translate>
== API ==
<translate><!--T:36--> You do so by configuring the <tvar name=1><code>virtual-campaignevents</code></tvar> domain, see <tvar name=2>{{ll|Manual:$wgVirtualDomainsMapping|Manual:$wgVirtualDomainsMapping}}</tvar>.</translate>
See [[/Api]] for the list of API endpoints provided by this extension.
<translate><!--T:37--> For instance:</translate>

<syntaxhighlight lang="php">
$wgVirtualDomainsMapping['virtual-campaignevents'] = [ 'db' => 'my_central_db' ];
</syntaxhighlight>

<translate><!--T:38--> This is especially useful in combination with a central database that stores event for a whole wiki family.</translate>
<translate><!--T:39--> Note, if you do so, that the wiki farm needs to use {{<tvar name=1>ll|Manual:Central ID</tvar>|central user IDs}}.</translate>

<translate>
== API == <!--T:40-->

<!--T:41-->
{{<tvar name=1>ll|Extension:CampaignEvents/Api</tvar>|Documentation of all the API endpoints}} is available.

==Maintenance scripts== <!--T:42-->

=== Script to update timezones === <!--T:43-->
</translate>
The extension stores the local time and timezone for each event, to guarantee that the local time remains accurate even if time zone rules change.
However,internally it also stores UTC timestamps so that certain operations like sorting are possible.
The UTC timestamps may go out of sync with the local ones if time zone rules change, which happens more commonly than you may think.
<translate><!--T:44--> You can [[<tvar name=1>:phab:T314871</tvar>|read more details]].</translate>
<translate><!--T:45--> In order to mitigate that, the extension provides a [<tvar name=url>https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CampaignEvents/+/refs/heads/master/maintenance/UpdateUTCTimestamps.php</tvar> maintenance script] that recomputes the UTC timestamps for all events according to the latest timezone rules, and stores them back into the database.</translate>

In order for this to work, you have to make sure that PHP has access to the latest version of the [[w:tz database|tz database]].
<translate><!--T:46--> The PHP manual [<tvar name=url>https://www.php.net/function.timezone-version-get</tvar> provides] some context about this.</translate>
<translate><!--T:47--> The easiest solution is to install the <tvar name=1>[https://pecl.php.net/package/timezonedb timezonedb]</tvar> PECL package and make sure to keep it up-to-date.</translate>

<translate><!--T:48--> Assuming that PHP has access to the latest timezone rules, you can run the script with:</translate>

<syntaxhighlight lang="shell-session">
$ php maintenance/run.php ./extensions/CampaignEvents/maintenance/UpdateUTCTimestamps.php
</syntaxhighlight>

<translate><!--T:49--> The script also takes an optional <tvar name=1><code>--timezone</code></tvar> parameter where you can specify the name of a time zone whose rules changed; this parameter can be repeated multiple times.</translate>
<translate><!--T:50--> If passed, the script will only update events whose timezone matches one of the timezones specified via this parameter.</translate>

<translate>
<!--T:51-->
If you upgrade the time zone database automatically (e.g., with a cronjob), you can make that job also execute this script, so that you don't have to do it manually every time you upgrade the time zone database.

===Script to aggregate participant answers=== <!--T:52-->

<!--T:53-->
The extension provides a maintenance script that aggregates participant answers after a 90 day period. The script can be run with:
</translate>

<syntaxhighlight lang="shell-session">
$ php maintenance/run.php ./extensions/CampaignEvents/maintenance/AggregateParticipantAnswers.php
</syntaxhighlight>

<translate>
<!--T:54-->
The script should be configured to run automatically (e.g., as a cronjob) to make sure that PII isn't retained for longer than it needs to.

== See also == <!--T:55-->
</translate>
* [[m:Special:MyLanguage/Campaigns/Foundation Product Team/Registration|<translate><!--T:56--> High-level project overview on meta</translate>]]
* {{ll|Extension:WikimediaCampaignEvents}} - <translate><!--T:57--> provides Wikimedia-specific add-ons</translate>

{{OnWikimedia}}

Latest revision as of 14:33, 27 August 2024

Not to be confused with Extension:Campaigns.
MediaWiki extensions manual
CampaignEvents
Release status: stable
Implementation Special page , Skin
Description Provides features for event organizers and participants
Author(s) Campaigns Team
Compatibility policy Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki >= 1.43
Database changes Yes
Virtual domain virtual-campaignevents
Tables campaign_events
ce_participants
ce_organizers
ce_address
ce_event_address
ce_tracking_tools
License GNU General Public License 2.0 or later
Download
Help Help:Extension:CampaignEvents
  • $wgCampaignEventsEnableEventInvitation
  • $wgCampaignEventsProgramsAndEventsDashboardInstance
  • $wgCampaignEventsProgramsAndEventsDashboardAPISecret
  • $wgCampaignEventsEnableWikimediaParticipantQuestions
  • $wgCampaignEventsShowEventInvitationSpecialPages
  • campaignevents-enable-registration
  • campaignevents-delete-registration
  • campaignevents-organize-events
  • campaignevents-email-participants
Quarterly downloads 2 (Ranked 137th)
Translate the CampaignEvents extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

CampaignEvents is a MediaWiki extension, created and maintained by the Wikimedia Foundation Campaigns Team, which provides tools for organizing and running events, including registration, communication and an organizer dashboard. See Registration for more information.

Installation

[edit]
  • Download and move the extracted CampaignEvents folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CampaignEvents
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'CampaignEvents' );
    
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • Schedule a cronjob that runs the #script to update timezones (optional), and one for the #script to aggregate participant answers.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

[edit]

User rights

[edit]
Right Description
campaignevents-enable-registration Enable event registrations
campaignevents-delete-registration Delete event registrations
campaignevents-organize-events Organize events
campaignevents-email-participants Email event participants

Parameters

[edit]
Variable name Default value Description
$wgCampaignEventsProgramsAndEventsDashboardInstance null Determines which instance of the P&E Dashboard should be used, if any. Supported values are 'production', 'staging', or null to not use the dashboard.
$wgCampaignEventsProgramsAndEventsDashboardAPISecret null API secret to use with the selected P&E Dashboard instance. Must be configured if you intend to use the P&E Dashboard.
$wgCampaignEventsEnableWikimediaParticipantQuestions true Whether to enable Wikimedia-specific questions that can be asked to participants, such as whether they belong to a Wikimedia affiliate.

The extension can be configured to store data into a database other than the main wiki DB. You do so by configuring the virtual-campaignevents domain, see Manual:$wgVirtualDomainsMapping . For instance:

$wgVirtualDomainsMapping['virtual-campaignevents'] = [ 'db' => 'my_central_db' ];

This is especially useful in combination with a central database that stores event for a whole wiki family. Note, if you do so, that the wiki farm needs to use central user IDs .

API

[edit]

Documentation of all the API endpoints is available.

Maintenance scripts

[edit]

Script to update timezones

[edit]

The extension stores the local time and timezone for each event, to guarantee that the local time remains accurate even if time zone rules change. However,internally it also stores UTC timestamps so that certain operations like sorting are possible. The UTC timestamps may go out of sync with the local ones if time zone rules change, which happens more commonly than you may think. You can read more details. In order to mitigate that, the extension provides a maintenance script that recomputes the UTC timestamps for all events according to the latest timezone rules, and stores them back into the database.

In order for this to work, you have to make sure that PHP has access to the latest version of the tz database. The PHP manual provides some context about this. The easiest solution is to install the timezonedb PECL package and make sure to keep it up-to-date.

Assuming that PHP has access to the latest timezone rules, you can run the script with:

$ php maintenance/run.php ./extensions/CampaignEvents/maintenance/UpdateUTCTimestamps.php

The script also takes an optional --timezone parameter where you can specify the name of a time zone whose rules changed; this parameter can be repeated multiple times. If passed, the script will only update events whose timezone matches one of the timezones specified via this parameter.

If you upgrade the time zone database automatically (e.g., with a cronjob), you can make that job also execute this script, so that you don't have to do it manually every time you upgrade the time zone database.

Script to aggregate participant answers

[edit]

The extension provides a maintenance script that aggregates participant answers after a 90 day period. The script can be run with:

$ php maintenance/run.php ./extensions/CampaignEvents/maintenance/AggregateParticipantAnswers.php

The script should be configured to run automatically (e.g., as a cronjob) to make sure that PII isn't retained for longer than it needs to.

See also

[edit]