Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • project/recurring_events
  • issue/recurring_events-3183502
  • issue/recurring_events-3183463
  • issue/recurring_events-3183483
  • issue/recurring_events-3190526
  • issue/recurring_events-3191715
  • issue/recurring_events-3190833
  • issue/recurring_events-3188808
  • issue/recurring_events-3180479
  • issue/recurring_events-3122823
  • issue/recurring_events-3196649
  • issue/recurring_events-3196428
  • issue/recurring_events-3196702
  • issue/recurring_events-3196704
  • issue/recurring_events-3198532
  • issue/recurring_events-3164409
  • issue/recurring_events-3206960
  • issue/recurring_events-3115678
  • issue/recurring_events-3218496
  • issue/recurring_events-3207435
  • issue/recurring_events-3219082
  • issue/recurring_events-3217367
  • issue/recurring_events-3229514
  • issue/recurring_events-3231841
  • issue/recurring_events-3238591
  • issue/recurring_events-3282502
  • issue/recurring_events-3283128
  • issue/recurring_events-3240862
  • issue/recurring_events-3247034
  • issue/recurring_events-3071679
  • issue/recurring_events-3264621
  • issue/recurring_events-3266436
  • issue/recurring_events-3268690
  • issue/recurring_events-3269555
  • issue/recurring_events-3271328
  • issue/recurring_events-3272361
  • issue/recurring_events-3163804
  • issue/recurring_events-3297681
  • issue/recurring_events-3299575
  • issue/recurring_events-3300786
  • issue/recurring_events-3302916
  • issue/recurring_events-3304286
  • issue/recurring_events-3298679
  • issue/recurring_events-3309652
  • issue/recurring_events-3310360
  • issue/recurring_events-3311843
  • issue/recurring_events-3311712
  • issue/recurring_events-3312003
  • issue/recurring_events-3312084
  • issue/recurring_events-3312242
  • issue/recurring_events-3316080
  • issue/recurring_events-3295367
  • issue/recurring_events-3196417
  • issue/recurring_events-3309859
  • issue/recurring_events-3318590
  • issue/recurring_events-3244975
  • issue/recurring_events-3318998
  • issue/recurring_events-3321269
  • issue/recurring_events-3320512
  • issue/recurring_events-3321235
  • issue/recurring_events-3321550
  • issue/recurring_events-3322998
  • issue/recurring_events-3315836
  • issue/recurring_events-3324055
  • issue/recurring_events-3328907
  • issue/recurring_events-3318490
  • issue/recurring_events-3339288
  • issue/recurring_events-3345618
  • issue/recurring_events-3347935
  • issue/recurring_events-3362297
  • issue/recurring_events-3359696
  • issue/recurring_events-3318666
  • issue/recurring_events-3366907
  • issue/recurring_events-3366910
  • issue/recurring_events-3403064
  • issue/recurring_events-3404311
  • issue/recurring_events-3405567
  • issue/recurring_events-3376639
  • issue/recurring_events-3384836
  • issue/recurring_events-3382387
  • issue/recurring_events-3384389
  • issue/recurring_events-3315503
  • issue/recurring_events-3411229
  • issue/recurring_events-3415222
  • issue/recurring_events-3415308
  • issue/recurring_events-3172514
  • issue/recurring_events-3419694
  • issue/recurring_events-3178696
  • issue/recurring_events-3408924
  • issue/recurring_events-3447130
  • issue/recurring_events-3416436
  • issue/recurring_events-3451613
  • issue/recurring_events-3452632
  • issue/recurring_events-3453086
  • issue/recurring_events-3452641
  • issue/recurring_events-3454012
  • issue/recurring_events-3455716
  • issue/recurring_events-3456300
  • issue/recurring_events-3456641
  • issue/recurring_events-3462327
  • issue/recurring_events-3463467
  • issue/recurring_events-3463979
  • issue/recurring_events-3462480
  • issue/recurring_events-3464792
  • issue/recurring_events-3456045
  • issue/recurring_events-3468300
  • issue/recurring_events-3468521
  • issue/recurring_events-3475611
  • issue/recurring_events-3477247
  • issue/recurring_events-3477047
  • issue/recurring_events-3477650
  • issue/recurring_events-3257502
  • issue/recurring_events-3090186
  • issue/recurring_events-3478802
  • issue/recurring_events-3479449
  • issue/recurring_events-3479843
  • issue/recurring_events-3479860
  • issue/recurring_events-3480495
  • issue/recurring_events-3480500
  • issue/recurring_events-3480746
  • issue/recurring_events-3480973
  • issue/recurring_events-3481021
  • issue/recurring_events-3481722
  • issue/recurring_events-3482804
  • issue/recurring_events-3483283
  • issue/recurring_events-3484209
  • issue/recurring_events-3170156
  • issue/recurring_events-3484558
  • issue/recurring_events-3485904
  • issue/recurring_events-3485935
  • issue/recurring_events-3487412
  • issue/recurring_events-3496270
  • issue/recurring_events-3480508
  • issue/recurring_events-3499792
  • issue/recurring_events-3500920
  • issue/recurring_events-3510919
  • issue/recurring_events-3510942
  • issue/recurring_events-3478268
138 results
Show changes
Commits on Source (52)
Showing
with 1584 additions and 89 deletions
......@@ -13,7 +13,7 @@ job-build: &job-build
steps:
- checkout
- run: |
sudo -E apt-get update && sudo -E apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev jq \
sudo -E apt-get --allow-releaseinfo-change update && sudo -E apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev jq \
&& sudo -E docker-php-ext-install -j$(nproc) iconv \
&& if [ "$(php -r "echo PHP_MAJOR_VERSION;")" -gt 5 ] && [ "$(php -r "echo PHP_MINOR_VERSION;")" -gt 3 ] ; then sudo -E docker-php-ext-configure gd --with-freetype --with-jpeg; else sudo -E docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/; fi \
&& sudo -E docker-php-ext-install -j$(nproc) gd
......@@ -50,7 +50,7 @@ jobs:
build-php-7.4-legacy:
<<: *container_config
environment:
DRUPAL_VERSION: 8.8.10
DRUPAL_VERSION: 8.9.18
DRUPAL_PROJECT_SHA: 8.x
<<: *job-build
......@@ -59,7 +59,7 @@ jobs:
docker:
- image: circleci/php:7.3-cli-browsers
environment:
DRUPAL_VERSION: 8.8.10
DRUPAL_VERSION: 8.9.18
DRUPAL_PROJECT_SHA: 8.x
<<: *job-build
......@@ -68,7 +68,7 @@ jobs:
docker:
- image: circleci/php:7.2-cli-browsers
environment:
DRUPAL_VERSION: 8.8.10
DRUPAL_VERSION: 8.9.18
DRUPAL_PROJECT_SHA: 8.x
<<: *job-build
......
......@@ -228,3 +228,9 @@ therefore can be overridden or extended, without affecting the rest of the
series. This module also comes with a registration submodule, including the
ability to register either for an entire series, or individual events.
Using `date_recur` that would not be possible as there is only one entity.
### Getting Started
- Configure the Events Series and Event Instances at /admin/structure/events.
- Add an event entity by going to Content -> Events -> Add Event (/events/add). Note: If you already have an Events node type, there may be some route collisions, and you may now see two menu items with a title of "Events". See the recurring_events.routing.yml for the existing routes.
- Note: If you try to add the newly created Event fields types (Consecutive Event, Daily Event, Monthly Event, Weekly Event) directly on a node/entity, you're doing it wrong and it will complain about missing plugin types.
access group_recurring_events_series overview:
title: 'Access group recurring events series overview'
description: 'Access the overview of all group recurring events series, regardless of type'
name: 'Group recurring events'
description: 'Enables Group functionality for the Recurring events module'
package: 'Group'
type: 'module'
core_version_requirement: ^8.9 || ^9
dependencies:
- 'drupal:recurring_events'
- 'group:group'
<?php
/**
* @file
* Install, and update functions for group recurring events series module.
*/
group_content.group_recurring_events_series_relate_page:
route_name: 'entity.group_content.group_recurring_events_series_relate_page'
title: 'Add existing events'
appears_on:
- 'view.group_recurring_events_series.page_1'
group_content.group_recurring_events_series_add_page:
route_name: 'entity.group_content.group_recurring_events_series_add_page'
title: 'Add new events'
appears_on:
- 'view.group_recurring_events_series.page_1'
<?php
/**
* @file
* Enables Group functionality for the Recurring events module.
*/
use Drupal\Core\Entity\EntityInterface;
use Drupal\recurring_events\Entity\EventSeriesTypeInterface;
use Drupal\Core\Url;
/**
* Implements hook_ENTITY_TYPE_insert().
*/
function group_recurring_events_series_eventseries_type_insert(EventSeriesTypeInterface $eventserices_type) {
\Drupal::service('plugin.manager.group_content_enabler')->clearCachedDefinitions();
}
/**
* Implements hook_entity_operation().
*/
function group_recurring_events_series_entity_operation(EntityInterface $entity) {
$operations = [];
if ($entity->getEntityTypeId() == 'group' && \Drupal::moduleHandler()->moduleExists('views')) {
/** @var \Drupal\group\Entity\GroupInterface $entity */
if ($entity->hasPermission('access group_recurring_events_series overview', \Drupal::currentUser())) {
/** @var \Symfony\Component\Routing\RouterInterface $router */
$router = \Drupal::service('router.no_access_checks');
if ($router->getRouteCollection()->get('view.group_recurring_events_series.page_1') !== NULL) {
$operations['recurring_events_series'] = [
'title' => t('Events series'),
'weight' => 20,
'url' => Url::fromRoute('view.group_recurring_events_series.page_1', ['group' => $entity->id()]),
];
}
}
}
return $operations;
}
route_callbacks:
- '\Drupal\group_recurring_events_series\Routing\GroupEventSeriesRouteProvider::getRoutes'
<?php
namespace Drupal\group_recurring_events_series\Controller;
use Drupal\Core\Entity\EntityFormBuilderInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Render\RendererInterface;
use Drupal\group\Entity\Controller\GroupContentController;
use Drupal\group\Entity\GroupInterface;
use Drupal\group\Plugin\GroupContentEnablerManagerInterface;
use Drupal\Core\TempStore\PrivateTempStoreFactory;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Returns responses for 'group_recurring_events_series' GroupContent routes.
*/
class GroupEventSeriesController extends GroupContentController {
/**
* The group content plugin manager.
*
* @var \Drupal\group\Plugin\GroupContentEnablerManagerInterface
*/
protected $pluginManager;
/**
* Constructs a new GroupEventSeriesController.
*
* @param \Drupal\group\Plugin\GroupContentEnablerManagerInterface $plugin_manager
* The group content plugin manager.
* @param \Drupal\Core\TempStore\PrivateTempStoreFactory $temp_store_factory
* The private store factory.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
* @param \Drupal\Core\Entity\EntityFormBuilderInterface $entity_form_builder
* The entity form builder.
* @param \Drupal\Core\Render\RendererInterface $renderer
* The renderer.
*/
public function __construct(GroupContentEnablerManagerInterface $plugin_manager, PrivateTempStoreFactory $temp_store_factory, EntityTypeManagerInterface $entity_type_manager, EntityFormBuilderInterface $entity_form_builder, RendererInterface $renderer) {
parent::__construct($temp_store_factory, $entity_type_manager, $entity_form_builder, $renderer);
$this->pluginManager = $plugin_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.group_content_enabler'),
$container->get('tempstore.private'),
$container->get('entity_type.manager'),
$container->get('entity.form_builder'),
$container->get('renderer')
);
}
/**
* {@inheritdoc}
*/
public function addPage(GroupInterface $group, $create_mode = FALSE) {
$build = parent::addPage($group, $create_mode);
// Do not interfere with redirects.
if (!is_array($build)) {
return $build;
}
// Overwrite the label and description for all of the displayed bundles.
$storage_handler = $this->entityTypeManager->getStorage('eventseries_type');
foreach ($this->addPageBundles($group, $create_mode) as $plugin_id => $bundle_name) {
if (!empty($build['#bundles'][$bundle_name])) {
$plugin = $group->getGroupType()->getContentPlugin($plugin_id);
$bundle_label = $storage_handler->load($plugin->getEntityBundle())->label();
$t_args = ['%eventseries_type' => $bundle_label];
$description = $create_mode
? $this->t('Add new content of type %eventseries_type to the group.', $t_args)
: $this->t('Add existing content of type %eventseries_type to the group.', $t_args);
$build['#bundles'][$bundle_name]['label'] = $bundle_label;
$build['#bundles'][$bundle_name]['description'] = $description;
}
}
return $build;
}
/**
* {@inheritdoc}
*/
protected function addPageBundles(GroupInterface $group, $create_mode) {
$bundles = [];
// Retrieve all group_recurring_events_series plugins for the group's type.
$plugin_ids = $this->pluginManager->getInstalledIds($group->getGroupType());
foreach ($plugin_ids as $key => $plugin_id) {
if (strpos($plugin_id, 'group_recurring_events_series:') !== 0) {
unset($plugin_ids[$key]);
}
}
// Retrieve all of the responsible group content types, keyed by plugin ID.
$storage = $this->entityTypeManager->getStorage('group_content_type');
$properties = [
'group_type' => $group->bundle(),
'content_plugin' => $plugin_ids,
];
foreach ($storage->loadByProperties($properties) as $bundle => $group_content_type) {
/** @var \Drupal\group\Entity\GroupContentTypeInterface $group_content_type */
$bundles[$group_content_type->getContentPluginId()] = $bundle;
}
return $bundles;
}
}
<?php
namespace Drupal\group_recurring_events_series\Plugin\GroupContentEnabler;
use Drupal\group\Entity\GroupInterface;
use Drupal\group\Plugin\GroupContentEnablerBase;
use Drupal\recurring_events\Entity\EventSeriesType;
use Drupal\Core\Url;
use Drupal\Core\Form\FormStateInterface;
/**
* Provides a content enabler for event series.
*
* @GroupContentEnabler(
* id = "group_recurring_events_series",
* label = @Translation("Group event series"),
* description = @Translation("Adds event series to groups both publicly and privately."),
* entity_type_id = "eventseries",
* entity_access = TRUE,
* reference_label = @Translation("Title"),
* reference_description = @Translation("The title of the event series to add to the group"),
* deriver = "Drupal\group_recurring_events_series\Plugin\GroupContentEnabler\GroupEventSeriesDeriver",
* handlers = {
* "access" = "Drupal\group\Plugin\GroupContentAccessControlHandler",
* "permission_provider" = "Drupal\group_recurring_events_series\Plugin\GroupEventSeriesPermissionProvider",
* }
* )
*/
class GroupEventSeries extends GroupContentEnablerBase {
/**
* Retrieves the event series type this plugin supports.
*
* @return \Drupal\recurring_events\Entity\EventSeriesType
* The event series type this plugin supports.
*/
protected function getEventSeriesType() {
return EventSeriesType::load($this->getEntityBundle());
}
/**
* {@inheritdoc}
*/
public function getGroupOperations(GroupInterface $group) {
$account = \Drupal::currentUser();
$plugin_id = $this->getPluginId();
$type = $this->getEntityBundle();
$operations = [];
if ($group->hasPermission("create $plugin_id entity", $account)) {
$route_params = ['group' => $group->id(), 'plugin_id' => $plugin_id];
$operations["group_recurring_events_series-create-$type"] = [
'title' => $this->t('Add @type', ['@type' => $this->getEventSeriesType()->label()]),
'url' => new Url('entity.group_content.create_form', $route_params),
'weight' => 30,
];
}
return $operations;
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
$config = parent::defaultConfiguration();
$config['entity_cardinality'] = 1;
return $config;
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form = parent::buildConfigurationForm($form, $form_state);
// Disable the entity cardinality field as the functionality of this module
// relies on a cardinality of 1. We don't just hide it, though, to keep a UI
// that's consistent with other content enabler plugins.
$info = $this->t("This field has been disabled by the plugin to guarantee the functionality that's expected of it.");
$form['entity_cardinality']['#disabled'] = TRUE;
$form['entity_cardinality']['#description'] .= '<br /><em>' . $info . '</em>';
return $form;
}
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
$dependencies = parent::calculateDependencies();
$dependencies['config'][] = 'recurring_events.eventseries_type.' . $this->getEntityBundle();
return $dependencies;
}
}
<?php
namespace Drupal\group_recurring_events_series\Plugin\GroupContentEnabler;
use Drupal\recurring_events\Entity\EventSeriesType;
use Drupal\Component\Plugin\Derivative\DeriverBase;
use Drupal\Core\StringTranslation\StringTranslationTrait;
/**
* Provides a deriver for group event series entities.
*/
class GroupEventSeriesDeriver extends DeriverBase {
use StringTranslationTrait;
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$this->derivatives = [];
foreach (EventSeriesType::loadMultiple() as $name => $eventseries_type) {
$label = $eventseries_type->label();
$this->derivatives[$name] = [
'entity_bundle' => $name,
'label' => $this->t('Group event series (@type)', ['@type' => $label]),
'description' => $this->t('Adds %type content to groups both publicly and privately.', ['%type' => $label]),
] + $base_plugin_definition;
}
return $this->derivatives;
}
}
<?php
namespace Drupal\group_recurring_events_series\Plugin;
use Drupal\group\Plugin\GroupContentPermissionProvider;
/**
* Provides group permissions for events series GroupContent entities.
*/
class GroupEventSeriesPermissionProvider extends GroupContentPermissionProvider {
/**
* {@inheritdoc}
*/
public function getEntityViewUnpublishedPermission($scope = 'any') {
if ($scope === 'any') {
// Backwards compatible permission name for 'any' scope.
return "view unpublished $this->pluginId entity";
}
return parent::getEntityViewUnpublishedPermission($scope);
}
/**
* {@inheritdoc}
*
* Note:
* The recurring_events module uses "edit" as an operation while the group
* module expect "update" to be used. Because of this, we need to translate
* the value before checking the permission.
*
* @todo If recurring_events changes its operation string, this function can be removed.
*/
public function getPermission($operation, $target, $scope = 'any') {
if ($operation == 'edit') {
$operation = 'update';
}
return parent::getPermission($operation, $target, $scope);
}
}
<?php
namespace Drupal\group_recurring_events_series\Routing;
use Drupal\recurring_events\Entity\EventSeriesType;
use Symfony\Component\Routing\Route;
/**
* Provides routes for group_recurring_events_series group content.
*/
class GroupEventSeriesRouteProvider {
/**
* Provides the shared collection route for group event series plugins.
*/
public function getRoutes() {
$routes = $plugin_ids = $permissions_add = $permissions_create = [];
foreach (EventSeriesType::loadMultiple() as $name => $eventseries_type) {
$plugin_id = "group_recurring_events_series:$name";
$plugin_ids[] = $plugin_id;
$permissions_add[] = "create $plugin_id content";
$permissions_create[] = "create $plugin_id entity";
}
// If there are no event series types yet, we cannot have any plugin IDs
// and should therefore exit early because we cannot have any routes for
// them either.
if (empty($plugin_ids)) {
return $routes;
}
$routes['entity.group_content.group_recurring_events_series_relate_page'] = new Route('group/{group}/eventseries/add');
$routes['entity.group_content.group_recurring_events_series_relate_page']
->setDefaults([
'_title' => 'Add existing content',
'_controller' => '\Drupal\group_recurring_events_series\Controller\GroupEventSeriesController::addPage',
])
->setRequirement('_group_permission', implode('+', $permissions_add))
->setRequirement('_group_installed_content', implode('+', $plugin_ids))
->setOption('_group_operation_route', TRUE);
$routes['entity.group_content.group_recurring_events_series_add_page'] = new Route('group/{group}/eventseries/create');
$routes['entity.group_content.group_recurring_events_series_add_page']
->setDefaults([
'_title' => 'Add new content',
'_controller' => '\Drupal\group_recurring_events_series\Controller\GroupEventSeriesController::addPage',
'create_mode' => TRUE,
])
->setRequirement('_group_permission', implode('+', $permissions_create))
->setRequirement('_group_installed_content', implode('+', $plugin_ids))
->setOption('_group_operation_route', TRUE);
return $routes;
}
}
<?php
namespace Drupal\Tests\group_recurring_events_series\Functional;
use Drupal\Tests\group\Functional\EntityOperationsTest as GroupEntityOperationsTest;
/**
* Tests that entity operations (do not) show up on the group overview.
*
* @see group_recurring_events_series_entity_operation()
*
* @group group_recurring_events_series
*/
class EntityOperationsTest extends GroupEntityOperationsTest {
/**
* {@inheritdoc}
*/
public static $modules = ['group_recurring_events_series'];
/**
* {@inheritdoc}
*/
public function provideEntityOperationScenarios() {
$scenarios['withoutAccess'] = [
[],
['group/1/eventseries' => 'Event series'],
];
$scenarios['withAccess'] = [
[],
['group/1/eventseries' => 'Event series'],
['access group_recurring_events_series overview'],
];
$scenarios['withAccessAndViews'] = [
['group/1/eventseries' => 'Event series'],
[],
['access group_recurring_events_series overview'],
['views'],
];
return $scenarios;
}
}
<?php
namespace Drupal\Tests\group_recurring_events_series\Kernel;
use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
/**
* Tests that all config provided by this module passes validation.
*
* @group group_recurring_events_series
*/
class GroupEntityseriesConfigTest extends EntityKernelTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = [
'group',
'options',
'entity',
'variationcache',
'recurring_events',
'group_recurring_events_series',
'views',
];
/**
* Tests that the module's config installs properly.
*/
public function testConfig() {
$this->installConfig(['group_recurring_events_series']);
}
}
......@@ -9,24 +9,32 @@ successfully_updated: Registrant successfully updated.
successfully_updated_waitlist: Successfully updated waitlist registrant.
already_registered: User already registered for this event.
registration_closed: Unfortunately, registration is not available at this time.
registration_notification_enabled: true
registration_notification_subject: 'You''ve Successfully Registered'
registration_notification_body: "Your registration for the [eventinstance:title] [eventinstance:reg_type] was successful.\r\n\r\nModify your registration: [registrant:edit_url]\r\nDelete your registration: [registrant:delete_url]"
waitlist_notification_enabled: true
waitlist_notification_subject: 'You''ve Been Added To The Waitlist'
waitlist_notification_body: "You have been added to the waitlist for the [eventinstance:title] [eventinstance:reg_type].\r\n\r\nModify your registration: [registrant:edit_url]\r\nDelete your registration: [registrant:delete_url]"
promotion_notification_enabled: true
promotion_notification_subject: 'You''ve Been Added To The Registration List'
promotion_notification_body: "You have been promoted from the waitlist to the registration list for the [eventinstance:title] [eventinstance:reg_type].\r\n\r\nModify your registration: [registrant:edit_url]\r\nDelete your registration: [registrant:delete_url]"
instance_deletion_notification_enabled: true
instance_deletion_notification_subject: 'An Event Has Been Deleted'
instance_deletion_notification_body: 'Unfortunately, the [eventinstance:title] [eventinstance:reg_type] has been deleted. Your registration has been deleted.'
series_deletion_notification_enabled: true
series_deletion_notification_subject: 'An Event Series Has Been Deleted'
series_deletion_notification_body: 'Unfortunately, the [eventinstance:title] [eventinstance:reg_type] has been deleted. Your registration has been deleted.'
instance_modification_notification_enabled: true
instance_modification_notification_subject: 'An Event Has Been Modified'
instance_modification_notification_body: "The [eventinstance:title] [eventinstance:reg_type] has been modified, please check back for details.\r\n\r\nModify your registration: [registrant:edit_url]\r\nDelete your registration: [registrant:delete_url]"
series_modification_notification_enabled: true
series_modification_notification_subject: 'An Event Series Has Been Modified'
series_modification_notification_body: 'The [eventinstance:title] [eventinstance:reg_type] has been modified, and all instances have been removed, and your registration has been deleted.'
notifications:
registration_notification:
enabled: true
subject: 'You''ve Successfully Registered'
body: "Your registration for the [eventinstance:title] [eventinstance:reg_type] was successful.\r\n\r\nModify your registration: [registrant:edit_url]\r\nDelete your registration: [registrant:delete_url]"
waitlist_notification:
enabled: true
subject: 'You''ve Been Added To The Waitlist'
body: "You have been added to the waitlist for the [eventinstance:title] [eventinstance:reg_type].\r\n\r\nModify your registration: [registrant:edit_url]\r\nDelete your registration: [registrant:delete_url]"
promotion_notification:
enabled: true
subject: 'You''ve Been Added To The Registration List'
body: "You have been promoted from the waitlist to the registration list for the [eventinstance:title] [eventinstance:reg_type].\r\n\r\nModify your registration: [registrant:edit_url]\r\nDelete your registration: [registrant:delete_url]"
instance_deletion_notification:
enabled: true
subject: 'An Event Has Been Deleted'
body: 'Unfortunately, the [eventinstance:title] [eventinstance:reg_type] has been deleted. Your registration has been deleted.'
series_deletion_notification:
enabled: true
subject: 'An Event Series Has Been Deleted'
body: 'Unfortunately, the [eventinstance:title] [eventinstance:reg_type] has been deleted. Your registration has been deleted.'
instance_modification_notification:
enabled: true
subject: 'An Event Has Been Modified'
body: "The [eventinstance:title] [eventinstance:reg_type] has been modified, please check back for details.\r\n\r\nModify your registration: [registrant:edit_url]\r\nDelete your registration: [registrant:delete_url]"
series_modification_notification:
enabled: true
subject: 'An Event Series Has Been Modified'
body: 'The [eventinstance:title] [eventinstance:reg_type] has been modified, and all instances have been removed, and your registration has been deleted.'
......@@ -17,70 +17,20 @@ recurring_events_registration.registrant.config:
email_notifications:
type: boolean
label: 'Whether to enable email notifications'
registration_notification_enabled:
type: boolean
label: 'Whether to enable registration email notifications'
registration_notification_subject:
type: string
label: 'The email subject for the registration emails'
registration_notification_body:
type: string
label: 'The email body for the registration emails'
waitlist_notification_enabled:
type: boolean
label: 'Whether to enable waitlist email notifications'
waitlist_notification_subject:
type: string
label: 'The email subject for the waitlist emails'
waitlist_notification_body:
type: string
label: 'The email body for the waitlist emails'
promotion_notification_enabled:
type: boolean
label: 'Whether to enable promotion email notifications'
promotion_notification_subject:
type: string
label: 'The email subject for the promotion emails'
promotion_notification_body:
type: string
label: 'The email body for the promotion emails'
instance_deletion_notification_enabled:
type: boolean
label: 'Whether to enable instance deletion email notifications'
instance_deletion_notification_subject:
type: string
label: 'The email subject for the instance deletion emails'
instance_deletion_notification_body:
type: string
label: 'The email body for the instance deletion emails'
series_deletion_notification_enabled:
type: boolean
label: 'Whether to enable series deletion email notifications'
series_deletion_notification_subject:
type: string
label: 'The email subject for the series deletion emails'
series_deletion_notification_body:
type: string
label: 'The email body for the series deletion emails'
instance_modification_notification_enabled:
type: boolean
label: 'Whether to enable instance modification email notifications'
instance_modification_notification_subject:
type: string
label: 'The email subject for the instance modification emails'
instance_modification_notification_body:
type: string
label: 'The email body for the instance modification emails'
series_modification_notification_enabled:
type: boolean
label: 'Whether to enable series modification email notifications'
series_modification_notification_subject:
type: string
label: 'The email subject for the series modification emails'
series_modification_notification_body:
type: string
label: 'The email body for the series modification emails'
notifications:
type: sequence
sequence:
type: mapping
mapping:
enabled:
type: boolean
label: 'Whether to enable these notifications'
subject:
type: string
label: 'The email subject for these notifications'
body:
type: string
label: 'The email body for these notifications'
field.widget.settings.event_registration:
type: mapping
label: 'Recurring Events Show Enable Waitlist'
......
name: Recurring Events Registration Reminders
type: module
description: Enables reminders to be sent for upcoming events.
package: Recurring Events
core_version_requirement: ^8.9 || ^9
dependencies:
- recurring_events:recurring_events
- recurring_events:recurring_events_registration
<?php
/**
* @file
* Install and update functions for the Registration Reminders submodule.
*/
use Drupal\Core\Field\BaseFieldDefinition;
/**
* Install the schema updates for eventseries entities to add registration.
*
* @see hook_install()
*/
function recurring_events_reminders_install() {
// Add the registration reminders custom field to eventseries.
$storage_definition = BaseFieldDefinition::create('registration_reminders')
->setName('registration_reminders')
->setLabel(t('Event Registration Reminders'))
->setDescription('The event registration reminders configuration.')
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE)
->setRevisionable(TRUE)
->setTranslatable(FALSE)
->setCardinality(1)
->setRequired(FALSE)
->setDisplayOptions('form', [
'type' => 'registration_reminders',
'weight' => 11,
]);
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('registration_reminders', 'eventseries', 'eventseries', $storage_definition);
// Add a field to eventinstances to store the desired reminder date.
$storage_definition = BaseFieldDefinition::create('timestamp')
->setName('reminder_date')
->setLabel(t('Reminder Date'))
->setDescription('The date that reminders should be sent.')
->setDisplayConfigurable('form', FALSE)
->setDisplayConfigurable('view', FALSE)
->setRevisionable(FALSE)
->setTranslatable(FALSE)
->setCardinality(1)
->setRequired(FALSE);
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('reminder_date', 'eventinstance', 'eventinstance', $storage_definition);
// Add a field to eventinstances to store date reminders were sent.
$storage_definition = BaseFieldDefinition::create('timestamp')
->setName('reminder_sent')
->setLabel(t('Reminder Sent'))
->setDescription('The date that reminders were sent.')
->setDisplayConfigurable('form', FALSE)
->setDisplayConfigurable('view', FALSE)
->setRevisionable(FALSE)
->setTranslatable(FALSE)
->setCardinality(1)
->setRequired(FALSE);
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('reminder_sent', 'eventinstance', 'eventinstance', $storage_definition);
// Set the default reminder email subject and body config.
$config = \Drupal::configFactory()->getEditable('recurring_events_registration.registrant.config');
$values = $config->get('notifications');
$values['registration_reminder'] = [
'enabled' => TRUE,
'subject' => 'Upcoming Event Reminder',
'body' => '[eventseries:reminder_message]',
];
$config->set('notifications', $values);
$config->save(TRUE);
}