DPL CMS module for integration with the pretix ticketing platform.
Builds on ideas and experiences from https://github.com/itk-dev/itk_pretix.
https://www.drupal.org/project/dpl_pretix
Enable the module and go to /admin/config/dpl_pretix to configure the module.
The module will add a "pretix" section on all events.
pretix settings: /admin/config/dpl_pretix
Log messages: /admin/reports/dblog?type[]=dpl_pretix
We need a template event in pretix, and this template event will be cloned to create new events in pretix.
The template event must
- be a multiple dates event
- have a single subevent (date)
DPL CMS uses the Recurring Events module to create and manage events. Technically, a event actually consists of an event series entity and a number of associated event instance entities. See the Recurring Events module page and documentation pages, e.g. Recurring Events Main Module, for further details and explanations.
An event instance in DPL CMS is mapped to an event in pretix, and an event instances are mapped to a dates (sub-events). As a special case, an event series with only one instance can be mapped to a singular event in pretix, i.e. the single instance is not mapped to an object in pretix. See the pretix User Guide for details on pretix and its events.
So far, so good … how this is actually done is a little (more) complicated.
Warning
Incomplete section ahead!
A number of Drupal hooks are implemented to make event and dates in pretix reflect event series and instances in DPL CMS.
First, the obvious ones:
And them a less obvious one (from Recurring Events) used to make everything fall into place:
Warning
Incomplete section ahead!
Warning
Incomplete section ahead!
As of now, we cannot composer require dependencies when building custom modules for DPL CMS, and therefore we use a
slightly customized version of itk-dev/pretix-api-client-php to talk to pretix.
Two of the dependencies of
itk-dev/pretix-api-client-php
(doctrine/collections and guzzlehttp/guzzle) are (indirectly) required by DPL
CMS.
The dependency on symfony/options-resolver can we,
under duress, choose to live without, and a small patch removes
use of the OptionsResolver component.
See the build:pretix-api-client task in Taskfile.yml for details on how the modified version of
itk-dev/pretix-api-client-php is actually built.
task dev:coding-standards:checkdocker run --rm --volume "$PWD:/mnt" koalaman/shellcheck:stable scripts/create-release scripts/code-analysistask dev:code-analysis[itk-dev/pretix-api-client-phpDPL CMS: https://github.com/danskernesdigitalebibliotek/dpl-cms/ pretix: https://pretix.eu/about/en/ "Ticketing software that cares about your event—all the way."
docker compose build && docker compose run --rm php scripts/create-release dev-testUse Translation extractor to extract translations.
After installing the module in Drupal, run
drush drupal_translation_extractor:translation:extract da --dump-messages --sort asc --force module:dpl_pretix --output=%source/translations/%module.%locale.poto extract translations for the dpl_pretix module. Remove dpl_pretix's vendor folder before extracting
translations.
- On an event series with multiple event instances, the user is forced to edit instances on the “Edit instances“ page
- The “Dates“ group is replaced with a reference to the Edit instances page
- An event instance with pretix orders cannot be deleted
- The “Relevant for ticket manager” field can be disabled
- User roles can be denied access to “Delete event instance“