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
  • issue/recurring_events-3515976
139 results
Show changes
Showing
with 1397 additions and 8 deletions
langcode: en
status: true
dependencies: { }
label: Default
id: default
description: 'A default event instance type.'
......@@ -5,3 +5,11 @@ date_format: 'F jS, Y h:iA'
time_format: 'h:i A'
days: 'monday,tuesday,wednesday,thursday,friday,saturday,sunday'
limit: 10
excludes: 1
includes: 1
enabled_fields: 'consecutive_recurring_date,daily_recurring_date,weekly_recurring_date,monthly_recurring_date,yearly_recurring_date,custom'
threshold_warning: 1
threshold_count: 200
threshold_message: 'Saving this series will create up to @total event instances. This could result in memory exhaustion or site instability.'
threshold_prevent_save: 0
creator_plugin: recurring_events_eventinstance_recreator
langcode: en
status: true
dependencies: { }
label: Default
id: default
description: 'A default event series type.'
recurring_events.eventinstance_type.*:
type: config_entity
label: 'Event instance type config'
mapping:
id:
type: string
label: 'ID'
label:
type: label
label: 'Label'
description:
type: string
label: 'Description'
uuid:
type: string
recurring_events.eventseries_type.*:
type: config_entity
label: 'Event series type config'
mapping:
id:
type: string
label: 'ID'
label:
type: label
label: 'Label'
description:
type: string
label: 'Description'
uuid:
type: string
recurring_events.field_inheritance.*:
recurring_events.excluded_dates.*:
type: config_entity
label: 'Field inheritance config'
label: 'Excluded dates config'
mapping:
id:
type: string
......@@ -10,11 +10,7 @@ recurring_events.field_inheritance.*:
label: 'Label'
uuid:
type: string
type:
start:
type: string
sourceField:
type: string
entityField:
type: string
plugin:
end:
type: string
recurring_events.included_dates.*:
type: config_entity
label: 'Included dates config'
mapping:
id:
type: string
label: 'ID'
label:
type: label
label: 'Label'
uuid:
type: string
start:
type: string
end:
type: string
......@@ -23,6 +23,30 @@ recurring_events.eventseries.config:
limit:
type: integer
label: 'The items per page to show on event series listing'
excludes:
type: integer
label: 'Enable eventseries level excluded dates'
includes:
type: integer
label: 'Enable eventseries level included dates'
enabled_fields:
type: string
label: 'Which recur type fields are available in the creation form'
threshold_warning:
type: integer
label: 'Show a warning when too many event instances are being created'
threshold_count:
type: integer
label: 'The number of event instances to trigger the warning'
threshold_message:
type: string
label: 'The warning to show when too many instances are being created'
threshold_prevent_save:
type: integer
label: 'Prevent saving a series if too many instances are being created'
creator_plugin:
type: string
label: 'The creator plugin used when creating event instances'
recurring_events.eventinstance.config:
type: config_object
......@@ -34,3 +58,17 @@ recurring_events.eventinstance.config:
limit:
type: integer
label: 'The items per page to show on event instance listing'
field.formatter.settings.recurring_events_eventinstance_date:
type: mapping
label: 'Recurring Events Event Instance Date Formatter'
mapping:
link:
type: string
label: 'Whether to format the date as a link'
date_format:
type: string
label: 'The date format to use to display the date'
separator:
type: string
label: 'The separator to use between start and end dates'
/**
* @file
* Javascript functionality for the recurring events create form.
*/
/* eslint-disable */
(function ($, once) {
'use strict';
/**
* Add weekday selection based on date range.
*/
Drupal.behaviors.recurring_events_weekday_selection = {
attach: function (context, settings) {
var weekdays = new Array(7);
weekdays[0] = "sunday";
weekdays[1] = "monday";
weekdays[2] = "tuesday";
weekdays[3] = "wednesday";
weekdays[4] = "thursday";
weekdays[5] = "friday";
weekdays[6] = "saturday";
// When the weekly occurrence start date is changed.
$('#edit-weekly-recurring-date-0-value-date').on('change', function (event) {
var value = $(this).val();
var date_parts = value.split('-');
if (date_parts.length > 0) {
var date = new Date(date_parts[0], date_parts[1] - 1, date_parts[2]);
var weekday = weekdays[date.getDay()];
// Remove all the weekday recurrence options.
$('#edit-weekly-recurring-date-0-days').find('input').each(function (key, item) {
$(item).prop('checked', FALSE);
});
// Set the event to recur on the same day of the week as the start
// date.
$('#edit-weekly-recurring-date-0-days-' + weekday).prop('checked', TRUE);
}
});
// When the monthly occurrence start date is changed.
$('#edit-monthly-recurring-date-0-value-date').on('change', function (event) {
var value = $(this).val();
var date_parts = value.split('-');
if (date_parts.length > 0) {
var date = new Date(date_parts[0], date_parts[1] - 1, date_parts[2]);
var weekday = weekdays[date.getDay()];
// Remove all the monthly recurrence options.
$('#edit-monthly-recurring-date-0-days').find('input').each(function (key, item) {
$(item).prop('checked', FALSE);
});
// Set the event to recur on the same day of the week as the start
// date.
$('#edit-monthly-recurring-date-0-days-' + weekday).prop('checked', TRUE);
}
});
}
};
/**
* Set end date for excluded and included dates to be the same as the start.
*/
Drupal.behaviors.recurring_events_excluded_included_dates = {
attach: function (context, settings) {
$(once('edit_excluded_date', $('#edit-excluded-dates-wrapper, #edit-included-dates-wrapper').find('input.form-date'))).on('change', function (e) {
if ($(this).attr('name').includes('[value][date]')) {
var start_date = this;
var parent = $(this).closest('.form-wrapper');
$(parent).find('input.form-date').each(function (index, item) {
if (index == 1) {
if ($(item).val() == '') {
$(item).val($(start_date).val());
}
}
});
}
});
}
};
}(jQuery, once));
/**
* @file
* Javascript functionality for the included/excluded date forms.
*/
/* eslint-disable */
(function ($, once) {
'use strict';
/**
* Set end date for excluded and included dates to be the same as the start.
*/
Drupal.behaviors.recurring_events_excluded_included_config_dates = {
attach: function (context, settings) {
$(once('edit_recurring_events_excluded_included_config_dates', $('#edit-start'))).on('change', function (e) {
if ($('#edit-end').val() == '') {
$('#edit-end').val($(this).val());
}
});
}
};
}(jQuery, once));
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: ^9.3 || ^10
dependencies:
- 'recurring_events: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\Core\Url;
use Drupal\recurring_events\Entity\EventSeriesTypeInterface;
/**
* Implements hook_ENTITY_TYPE_insert().
*/
function group_recurring_events_series_eventseries_type_insert(EventSeriesTypeInterface $eventseries_type) {
if (\Drupal::isConfigSyncing()) {
return;
}
\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;
}
/**
* Implements hook_entity_type_build().
*/
function group_recurring_events_series_entity_type_build(array &$entity_types) {
if (isset($entity_types['eventinstance'])) {
$entity_types['eventinstance']->setHandlerClass('access', 'Drupal\group_recurring_events_series\Access\GroupEventInstanceHandler');
}
}
route_callbacks:
- '\Drupal\group_recurring_events_series\Routing\GroupEventSeriesRouteProvider::getRoutes'
<?php
namespace Drupal\group_recurring_events_series\Access;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\recurring_events\EventInstanceAccessControlHandler;
/**
* The GroupEventInstanceHandler class.
*/
class GroupEventInstanceHandler extends EventInstanceAccessControlHandler {
/**
* Determine access for the group.
*/
protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
$result = parent::checkAccess($entity, $operation, $account);
if (!$result->isAllowed()) {
// Need GroupContentAccessControlHandler not
// EventSeriesAccessControlHandler.
$manager = \Drupal::service('plugin.manager.group_content_enabler');
$type = 'group_recurring_events_series:' . $entity->getType();
if ($manager->hasHandler($type, 'access')) {
$handler = $manager->getAccessControlHandler($type);
$result = $handler->entityAccess($entity->getEventSeries(), $operation, $account, TRUE);
}
}
return $result;
}
}
<?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\Core\TempStore\PrivateTempStoreFactory;
use Drupal\group\Entity\Controller\GroupContentController;
use Drupal\group\Entity\GroupInterface;
use Drupal\group\Plugin\GroupContentEnablerManagerInterface;
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;
}
}