From 326378e2fc4c9a8de700a1c15d61dcadb9b10d30 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Tue, 13 Jul 2021 09:31:01 +0200 Subject: [PATCH] Allow to reference events from event This might be useful to allow editors and integrators to create something like "you might also be interested in" or "related events". --- Classes/Domain/Model/Event.php | 14 ++++++++++++++ .../TCA/tx_events_domain_model_event.php | 16 ++++++++++++++++ .../Private/Language/de.locallang_csh_event.xlf | 4 ++++ .../Private/Language/locallang_csh_event.xlf | 3 +++ ext_tables.sql | 1 + 5 files changed, 38 insertions(+) diff --git a/Classes/Domain/Model/Event.php b/Classes/Domain/Model/Event.php index 79d5772..3afcebe 100644 --- a/Classes/Domain/Model/Event.php +++ b/Classes/Domain/Model/Event.php @@ -217,6 +217,11 @@ class Event extends AbstractEntity */ protected $partner; + /** + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage + */ + protected $referencesEvents; + /** * @var int */ @@ -251,6 +256,7 @@ class Event extends AbstractEntity protected function initStorageObjects() { $this->dates = new ObjectStorage(); + $this->referencesEvents = new ObjectStorage(); } /** @@ -674,6 +680,14 @@ class Event extends AbstractEntity return $this->partner; } + /** + * @return ObjectStorage + */ + public function getReferencesEvents(): ObjectStorage + { + return $this->referencesEvents; + } + /** * @param \Wrm\Events\Domain\Model\Organizer $organizer * @return void diff --git a/Configuration/TCA/tx_events_domain_model_event.php b/Configuration/TCA/tx_events_domain_model_event.php index 216d84f..0570c5f 100644 --- a/Configuration/TCA/tx_events_domain_model_event.php +++ b/Configuration/TCA/tx_events_domain_model_event.php @@ -63,6 +63,7 @@ return [ region, partner, categories, + references_events, pages, --div--;' . $l10nPath . ':tx_events_domain_model_event.tabs.media, images, @@ -524,6 +525,21 @@ return [ ], ], + 'references_events' => [ + 'exclude' => true, + 'label' => $l10nPath . ':tx_events_domain_model_event.references_events', + 'config' => [ + 'type' => 'group', + 'internal_type' => 'db', + 'allowed' => 'tx_events_domain_model_event', + 'suggestOptions' => [ + 'tx_events_domain_model_event' => [ + 'searchCondition' => 'tx_events_domain_model_event.sys_language_uid IN (0, -1)', + ], + ], + ], + ], + 'partner' => [ 'exclude' => true, 'label' => $l10nPath . ':tx_events_domain_model_event.partner', diff --git a/Resources/Private/Language/de.locallang_csh_event.xlf b/Resources/Private/Language/de.locallang_csh_event.xlf index ced4f75..59e8704 100644 --- a/Resources/Private/Language/de.locallang_csh_event.xlf +++ b/Resources/Private/Language/de.locallang_csh_event.xlf @@ -159,6 +159,10 @@ Partner Partner + + Related Events + Ähnliche Veranstaltungen + diff --git a/Resources/Private/Language/locallang_csh_event.xlf b/Resources/Private/Language/locallang_csh_event.xlf index 32c079c..97cb2f0 100644 --- a/Resources/Private/Language/locallang_csh_event.xlf +++ b/Resources/Private/Language/locallang_csh_event.xlf @@ -117,6 +117,9 @@ Partner + + Related Events + diff --git a/ext_tables.sql b/ext_tables.sql index 06dc017..5ec72fb 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -32,6 +32,7 @@ CREATE TABLE tx_events_domain_model_event ( organizer int(11) unsigned DEFAULT '0', partner text, region int(11) unsigned DEFAULT '0', + references_events text, KEY dataHandler (l10n_parent, t3ver_oid, deleted, t3ver_wsid, t3ver_state) );