Merge branch 'feature/typo3-v10' into 'master'

State compatibility with v10

See merge request typo3/events!8
This commit is contained in:
Dirk Koritnik 2021-09-07 06:12:57 +00:00
commit 919db32131
84 changed files with 2198 additions and 1478 deletions

2
.gitignore vendored
View file

@ -1 +1,3 @@
/composer.lock
/public/
/vendor/ /vendor/

View file

@ -1,18 +1,18 @@
<?php <?php
namespace Wrm\Events\Command; namespace Wrm\Events\Command;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Core\Bootstrap; use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Extbase\Object\ObjectManager;
use Wrm\Events\Service\DestinationDataImportService; use Wrm\Events\Service\DestinationDataImportService;
class DestinationDataImportCommand extends Command { class DestinationDataImportCommand extends Command
{
public function configure() public function configure()
{ {
@ -31,12 +31,14 @@ class DestinationDataImportCommand extends Command {
'What is the region uid?', 'What is the region uid?',
'1' '1'
); );
$this->addArgument('rest-experience', $this->addArgument(
'rest-experience',
InputArgument::OPTIONAL, InputArgument::OPTIONAL,
'What is the rest experience?', 'What is the rest experience?',
'stadtmarketing-erfurt' 'stadtmarketing-erfurt'
); );
$this->addArgument('files-folder', $this->addArgument(
'files-folder',
InputArgument::OPTIONAL, InputArgument::OPTIONAL,
'Where to save the image files?', 'Where to save the image files?',
'staedte/erfurt/events/' 'staedte/erfurt/events/'

View file

@ -1,4 +1,5 @@
<?php <?php
namespace Wrm\Events\Command; namespace Wrm\Events\Command;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
@ -21,8 +22,10 @@ class RemoveAllCommand extends Command
{ {
Bootstrap::initializeBackendAuthentication(); Bootstrap::initializeBackendAuthentication();
return GeneralUtility::makeInstance(ObjectManager::class) GeneralUtility::makeInstance(ObjectManager::class)
->get(CleanupService::class) ->get(CleanupService::class)
->deleteAllData(); ->deleteAllData();
return 0;
} }
} }

View file

@ -1,4 +1,5 @@
<?php <?php
namespace Wrm\Events\Command; namespace Wrm\Events\Command;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;

View file

@ -0,0 +1,44 @@
<?php
namespace Wrm\Events\Controller;
/*
* Copyright (C) 2021 Daniel Siepmann <coding@daniel-siepmann.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
class AbstractController extends ActionController
{
/**
* Extend original to also add data from current cobject if available.
*/
protected function resolveView()
{
$view = parent::resolveView();
$view->assign('data', []);
$cObject = $this->configurationManager->getContentObject();
if ($cObject instanceof ContentObjectRenderer && is_array($cObject->data)) {
$view->assign('data', $cObject->data);
}
return $view;
}
}

View file

@ -1,19 +1,22 @@
<?php <?php
namespace Wrm\Events\Controller; namespace Wrm\Events\Controller;
use TYPO3\CMS\Core\Database\QueryGenerator;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Annotation as Extbase;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use Wrm\Events\Domain\Model\Date;
use Wrm\Events\Domain\Model\Dto\DateDemand; use Wrm\Events\Domain\Model\Dto\DateDemand;
use Wrm\Events\Domain\Repository\CategoryRepository; use Wrm\Events\Domain\Repository\CategoryRepository;
use Wrm\Events\Domain\Repository\DateRepository; use Wrm\Events\Domain\Repository\DateRepository;
use Wrm\Events\Domain\Repository\RegionRepository; use Wrm\Events\Domain\Repository\RegionRepository;
use TYPO3\CMS\Core\Database\QueryGenerator; use Wrm\Events\Service\DataProcessingForModels;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
/** /**
* DateController * DateController
*/ */
class DateController extends ActionController class DateController extends AbstractController
{ {
/** /**
@ -36,6 +39,11 @@ class DateController extends ActionController
*/ */
protected $queryGenerator; protected $queryGenerator;
/**
* @var DataProcessingForModels
*/
protected $dataProcessing;
/** /**
* @var array * @var array
*/ */
@ -56,11 +64,20 @@ class DateController extends ActionController
$this->categoryRepository = $categoryRepository; $this->categoryRepository = $categoryRepository;
} }
/**
* @param DataProcessingForModels $dataProcessing
*/
public function injectDataProcessingForModels(DataProcessingForModels $dataProcessing)
{
$this->dataProcessing = $dataProcessing;
}
/** /**
* Action initializer * Action initializer
*/ */
protected function initializeAction() protected function initializeAction()
{ {
$this->dataProcessing->setConfigurationManager($this->configurationManager);
$this->pluginSettings = $this->configurationManager->getConfiguration( $this->pluginSettings = $this->configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK
); );
@ -124,10 +141,12 @@ class DateController extends ActionController
/** /**
* action show * action show
* *
* @Extbase\IgnoreValidation("date")
*
* @param \Wrm\Events\Domain\Model\Date $date * @param \Wrm\Events\Domain\Model\Date $date
* @return void * @return void
*/ */
public function showAction(\Wrm\Events\Domain\Model\Date $date) public function showAction(Date $date)
{ {
$this->view->assign('date', $date); $this->view->assign('date', $date);
} }
@ -147,6 +166,8 @@ class DateController extends ActionController
$demand->setSortBy((string)$this->settings['sortByDate']); $demand->setSortBy((string)$this->settings['sortByDate']);
$demand->setSortOrder((string)$this->settings['sortOrder']); $demand->setSortOrder((string)$this->settings['sortOrder']);
$demand->setHighlight((int)$this->settings['highlight']); $demand->setHighlight((int)$this->settings['highlight']);
$demand->setStart((string)$this->settings['start'] ?? '');
$demand->setEnd((string)$this->settings['end'] ?? '');
if (!empty($this->settings['limit'])) { if (!empty($this->settings['limit'])) {
$demand->setLimit($this->settings['limit']); $demand->setLimit($this->settings['limit']);

View file

@ -1,130 +1,75 @@
<?php <?php
namespace Wrm\Events\Controller; namespace Wrm\Events\Controller;
use TYPO3\CMS\Extbase\Annotation as Extbase;
use Wrm\Events\Domain\Model\Dto\EventDemand; use Wrm\Events\Domain\Model\Dto\EventDemand;
use Wrm\Events\Domain\Model\Dto\EventDemandFactory;
use Wrm\Events\Domain\Model\Event; use Wrm\Events\Domain\Model\Event;
use Wrm\Events\Domain\Repository\EventRepository; use Wrm\Events\Domain\Repository\EventRepository;
use TYPO3\CMS\Core\Database\QueryGenerator; use Wrm\Events\Service\DataProcessingForModels;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
/** class EventController extends AbstractController
* EventController
*/
class EventController extends ActionController
{ {
/**
* @var EventRepository
*/
protected $eventRepository;
/** /**
* @var eventRepository * @var DataProcessingForModels
*/ */
protected $eventRepository = null; protected $dataProcessing;
/** /**
* @var QueryGenerator * @var EventDemandFactory
*/ */
protected $queryGenerator; protected $demandFactory;
/** public function __construct(
* @var array EventRepository $eventRepository,
*/ DataProcessingForModels $dataProcessing,
protected $pluginSettings; EventDemandFactory $demandFactory
) {
/**
* @param EventRepository $eventRepository
*/
public function injectEventRepository(EventRepository $eventRepository)
{
$this->eventRepository = $eventRepository; $this->eventRepository = $eventRepository;
$this->dataProcessing = $dataProcessing;
$this->demandFactory = $demandFactory;
} }
/**
* Action initializer
*/
protected function initializeAction() protected function initializeAction()
{ {
$this->pluginSettings = $this->configurationManager->getConfiguration( $this->dataProcessing->setConfigurationManager($this->configurationManager);
ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK
);
} }
/** public function listAction(): void
* Action list
*
* @return void
*/
public function listAction()
{ {
$demand = $this->demandFactory->fromSettings($this->settings);
$demand = $this->createDemandFromSettings();
$events = $this->eventRepository->findByDemand($demand); $events = $this->eventRepository->findByDemand($demand);
$this->view->assign('events', $events); $this->view->assign('events', $events);
} }
/** /**
* Action show * @Extbase\IgnoreValidation("event")
*
* @param Event $event
* @return void
*/ */
public function showAction(Event $event) public function showAction(Event $event): void
{ {
$this->view->assign('event', $event); $this->view->assign('event', $event);
} }
/** /**
* action teaser * @deprecated Use listAction instead and configure settings properly.
* * Use Settings or something else to switch between list and teaser rendering.
* @return void
*/ */
public function teaserAction() public function teaserAction(): void
{ {
$events = $this->eventRepository->findByUids($this->settings['eventUids']); $this->view->assignMultiple([
$this->view->assign('events', $events); 'events' => $this->eventRepository->findByUids($this->settings['eventUids']),
]);
} }
/** public function searchAction(string $search = ''): void
* @param string $search
*/
public function searchAction(): void
{ {
$search = '';
if ($this->request->hasArgument('search')) {
$search = $this->request->getArgument('search');
}
$this->view->assign('search', $search); $this->view->assign('search', $search);
$this->view->assign('events', $this->eventRepository->findSearchWord($search)); $this->view->assign('events', $this->eventRepository->findSearchWord($search));
}
/**
* @return EventDemand
*/
protected function createDemandFromSettings(): EventDemand
{
$demand = $this->objectManager->get(EventDemand::class);
$demand->setRegion((string)$this->settings['region']);
$demand->setCategories((string)$this->settings['categories']);
$categoryCombination = (int)$this->settings['categoryCombination'] === 1 ? 'or' : 'and';
$demand->setCategoryCombination($categoryCombination);
$demand->setIncludeSubCategories((bool)$this->settings['includeSubcategories']);
$demand->setSortBy((string)$this->settings['sortByEvent']);
$demand->setSortOrder((string)$this->settings['sortOrder']);
$demand->setHighlight((bool)$this->settings['highlight']);
if (!empty($this->settings['limit'])) {
$demand->setLimit($this->settings['limit']);
}
return $demand;
} }
} }

View file

@ -0,0 +1,40 @@
<?php
namespace Wrm\Events\Domain\Model;
/*
* Copyright (C) 2021 Daniel Siepmann <coding@daniel-siepmann.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
use TYPO3\CMS\Extbase\Domain\Model\Category as ExtbaseCategory;
/**
* Extend original model to include furher properties.
*/
class Category extends ExtbaseCategory
{
/**
* @var int
*/
protected $sorting = 0;
public function getSorting(): int
{
return $this->sorting;
}
}

View file

@ -1,11 +1,13 @@
<?php <?php
namespace Wrm\Events\Domain\Model; namespace Wrm\Events\Domain\Model;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
/** /**
* Date * Date
*/ */
class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity class Date extends AbstractEntity
{ {
/** /**
@ -18,11 +20,31 @@ class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/ */
protected $end = null; protected $end = null;
/**
* @var string
*/
protected $canceled = "no";
/**
* @var null|Date
*/
protected $postponedDate;
/**
* @var null|Date
*/
protected $originalDate;
/** /**
* @var \Wrm\Events\Domain\Model\Event * @var \Wrm\Events\Domain\Model\Event
*/ */
protected $event = null; protected $event = null;
/**
* @var string
*/
protected $canceledLink = '';
/** /**
* @var int * @var int
*/ */
@ -62,6 +84,8 @@ class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
$this->end = $end; $this->end = $end;
} }
/** /**
* @return Event * @return Event
*/ */
@ -83,15 +107,56 @@ class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param int $languageUid * @param int $languageUid
* @return void * @return void
*/ */
public function setLanguageUid($languageUid) { public function setLanguageUid($languageUid)
{
$this->_languageUid = $languageUid; $this->_languageUid = $languageUid;
} }
/** /**
* @return int * @return int
*/ */
public function getLanguageUid() { public function getLanguageUid()
{
return $this->_languageUid; return $this->_languageUid;
} }
/**
* @return string
*/
public function getCanceled(): string
{
return $this->canceled;
}
/**
* @param string $canceled
* @return void
*/
public function setCanceled(string $canceled)
{
$this->canceled = $canceled;
}
public function getPostponedDate(): ?Date
{
if ($this->getCanceled() === 'postponed') {
return $this->postponedDate;
}
return null;
}
public function getOriginalDate(): ?Date
{
return $this->originalDate;
}
public function getCanceledLink(): string
{
if ($this->getCanceled() === 'canceled') {
return $this->canceledLink;
}
return '';
}
} }

View file

@ -4,7 +4,8 @@ namespace Wrm\Events\Domain\Model\Dto;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
class DateDemand { class DateDemand
{
/** /**
* @var string * @var string

View file

@ -2,7 +2,8 @@
namespace Wrm\Events\Domain\Model\Dto; namespace Wrm\Events\Domain\Model\Dto;
class EventDemand { class EventDemand
{
/** /**
* @var string * @var string
@ -44,6 +45,11 @@ class EventDemand {
*/ */
protected $limit = ''; protected $limit = '';
/**
* @var array
*/
protected $recordUids = [];
/** /**
* @return string * @return string
*/ */
@ -172,6 +178,19 @@ class EventDemand {
$this->limit = $limit; $this->limit = $limit;
} }
/**
* @return array
*/
public function getRecordUids(): array
{
return $this->recordUids;
}
/**
* @param array $recordUids
*/
public function setRecordUids(array $recordUids): void
{
$this->recordUids = $recordUids;
}
} }

View file

@ -0,0 +1,58 @@
<?php
namespace Wrm\Events\Domain\Model\Dto;
/*
* Copyright (C) 2021 Daniel Siepmann <coding@daniel-siepmann.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
use TYPO3\CMS\Core\Utility\GeneralUtility;
class EventDemandFactory
{
public function fromSettings(array $settings): EventDemand
{
/** @var EventDemand $demand */
$demand = GeneralUtility::makeInstance(EventDemand::class);
$demand->setRegion((string)$settings['region']);
$demand->setCategories((string)$settings['categories']);
$categoryCombination = 'and';
if ((int)$settings['categoryCombination'] === 1) {
$categoryCombination = 'or';
}
$demand->setCategoryCombination($categoryCombination);
$demand->setIncludeSubCategories((bool)$settings['includeSubcategories']);
$demand->setSortBy((string)$settings['sortByEvent']);
$demand->setSortOrder((string)$settings['sortOrder']);
$demand->setHighlight((bool)$settings['highlight']);
$demand->setRecordUids(GeneralUtility::intExplode(',', $settings['selectedRecords'], true));
if (!empty($settings['limit'])) {
$demand->setLimit($settings['limit']);
}
return $demand;
}
}

View file

@ -1,12 +1,14 @@
<?php <?php
namespace Wrm\Events\Domain\Model; namespace Wrm\Events\Domain\Model;
use \Wrm\Events\Domain\Repository\DateRepository;
use \TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Annotation as Extbase; use TYPO3\CMS\Extbase\Annotation as Extbase;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Extbase\Object\ObjectManager;
use \TYPO3\CMS\Extbase\Persistence\ObjectStorage; use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
use Wrm\Events\Domain\Repository\DateRepository;
use Wrm\Events\Service\DataProcessingForModels;
/** /**
* Event * Event
@ -21,6 +23,13 @@ class Event extends AbstractEntity
*/ */
protected $title = ''; protected $title = '';
/**
* subtitle
*
* @var string
*/
protected $subtitle = '';
/** /**
* globalId * globalId
* *
@ -164,18 +173,18 @@ class Event extends AbstractEntity
/** /**
* images * images
* *
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference * @var ObjectStorage<FileReference>
* @cascade remove * @Extbase\ORM\Cascade remove
*/ */
protected $images = null; protected $images;
/** /**
* dates * dates
* *
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Wrm\Events\Domain\Model\Date> * @var ObjectStorage<Date>
* @cascade remove * @Extbase\ORM\Cascade remove
*/ */
protected $dates = null; protected $dates;
/** /**
* organizer * organizer
@ -187,29 +196,57 @@ class Event extends AbstractEntity
/** /**
* region * region
* *
* @var \Wrm\Events\Domain\Model\Region * @var Region
*/ */
protected $region = null; protected $region = null;
/**
* @var string
*/
protected $pages = '';
/** /**
* categories * categories
* *
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category> * @var ObjectStorage<Category>
*/ */
protected $categories; protected $categories;
/**
* @var ObjectStorage<Partner>
*/
protected $partner;
/**
* @var ObjectStorage<Event>
*/
protected $referencesEvents;
/** /**
* @var int * @var int
*/ */
protected $_languageUid; protected $_languageUid;
/** /**
* __construct * @var DataProcessingForModels
*/ */
protected $dataProcessing = null;
public function __construct() public function __construct()
{ {
$this->initStorageObjects();
}
//Do not remove the next line: It would break the functionality /**
* @param DataProcessingForModels $dataProcessing
*/
public function injectDataProcessingForModels(DataProcessingForModels $dataProcessing)
{
$this->dataProcessing = $dataProcessing;
}
public function initializeObject()
{
$this->initStorageObjects(); $this->initStorageObjects();
} }
@ -218,7 +255,11 @@ class Event extends AbstractEntity
*/ */
protected function initStorageObjects() protected function initStorageObjects()
{ {
$this->images = new ObjectStorage();
$this->dates = new ObjectStorage(); $this->dates = new ObjectStorage();
$this->categories = new ObjectStorage();
$this->partner = new ObjectStorage();
$this->referencesEvents = new ObjectStorage();
} }
/** /**
@ -257,6 +298,23 @@ class Event extends AbstractEntity
$this->title = $title; $this->title = $title;
} }
/**
* @return string $subtitle
*/
public function getSubtitle()
{
return $this->subtitle;
}
/**
* @param string $subtitle
* @return void
*/
public function setSubtitle($subtitle)
{
$this->subtitle = $subtitle;
}
/** /**
* @return string $teaser * @return string $teaser
*/ */
@ -528,18 +586,18 @@ class Event extends AbstractEntity
} }
/** /**
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $images * @return ObjectStorage<FileReference> $images
*/ */
public function getImages() public function getImages(): ObjectStorage
{ {
return $this->images; return $this->images;
} }
/** /**
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $images * @param ObjectStorage<FileReference> $images
* @return void * @return void
*/ */
public function setImages(\TYPO3\CMS\Extbase\Domain\Model\FileReference $images) public function setImages(FileReference $images)
{ {
$this->images = $images; $this->images = $images;
} }
@ -604,7 +662,8 @@ class Event extends AbstractEntity
* @param ObjectStorage $dates * @param ObjectStorage $dates
* @return void * @return void
*/ */
public function removeAllDates(ObjectStorage $dates) { public function removeAllDates(ObjectStorage $dates)
{
$this->dates->removeAll($dates); $this->dates->removeAll($dates);
} }
@ -616,11 +675,27 @@ class Event extends AbstractEntity
return $this->organizer; return $this->organizer;
} }
/**
* @return ObjectStorage<Partner>
*/
public function getPartner(): ObjectStorage
{
return $this->partner;
}
/**
* @return ObjectStorage<Event>
*/
public function getReferencesEvents(): ObjectStorage
{
return $this->referencesEvents;
}
/** /**
* @param \Wrm\Events\Domain\Model\Organizer $organizer * @param \Wrm\Events\Domain\Model\Organizer $organizer
* @return void * @return void
*/ */
public function setOrganizer(\Wrm\Events\Domain\Model\Organizer $organizer) public function setOrganizer(Organizer $organizer)
{ {
$this->organizer = $organizer; $this->organizer = $organizer;
} }
@ -637,7 +712,7 @@ class Event extends AbstractEntity
* @param \Wrm\Events\Domain\Model\Region $region * @param \Wrm\Events\Domain\Model\Region $region
* @return void * @return void
*/ */
public function setRegion(\Wrm\Events\Domain\Model\Region $region) public function setRegion(Region $region)
{ {
$this->region = $region; $this->region = $region;
} }
@ -684,20 +759,35 @@ class Event extends AbstractEntity
$this->country = $country; $this->country = $country;
} }
public function getPages(): array
{
static $pages = null;
if (is_array($pages)) {
return $pages;
}
$pages = $this->dataProcessing->process($this);
return $pages;
}
/** /**
* @param \TYPO3\CMS\Extbase\Domain\Model\Category<\TYPO3\CMS\Extbase\Domain\Model\Category> $category * @param \TYPO3\CMS\Extbase\Domain\Model\Category<\TYPO3\CMS\Extbase\Domain\Model\Category> $category
*/ */
public function addCategory(\TYPO3\CMS\Extbase\Domain\Model\Category $category) public function addCategory(Category $category)
{ {
$this->categories->attach($category); $this->categories->attach($category);
} }
/** public function getCategories(): array
* @return $categories
*/
public function getCategories()
{ {
return $this->categories; $categories = $this->categories->toArray();
usort($categories, function (Category $catA, Category $catB) {
return $catA->getSorting() <=> $catB->getSorting();
});
return $categories;
} }
/** /**
@ -712,14 +802,24 @@ class Event extends AbstractEntity
* @param int $languageUid * @param int $languageUid
* @return void * @return void
*/ */
public function setLanguageUid($languageUid) { public function setLanguageUid($languageUid)
{
$this->_languageUid = $languageUid; $this->_languageUid = $languageUid;
} }
/** /**
* @return int * @return int
*/ */
public function getLanguageUid() { public function getLanguageUid()
{
return $this->_languageUid; return $this->_languageUid;
} }
/**
* @return int
*/
public function getLocalizedUid()
{
return $this->_localizedUid;
}
} }

View file

@ -1,8 +1,8 @@
<?php <?php
namespace Wrm\Events\Domain\Model; namespace Wrm\Events\Domain\Model;
/*
/***
* *
* This file is part of the "DD Events" Extension for TYPO3 CMS. * This file is part of the "DD Events" Extension for TYPO3 CMS.
* *
@ -11,11 +11,14 @@ namespace Wrm\Events\Domain\Model;
* *
* (c) 2019 Dirk Koritnik <koritnik@werkraum-media.de> * (c) 2019 Dirk Koritnik <koritnik@werkraum-media.de>
* *
***/ */
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
/** /**
* Organizer * Organizer
*/ */
class Organizer extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity class Organizer extends AbstractEntity
{ {
/** /**
@ -273,14 +276,16 @@ class Organizer extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param int $languageUid * @param int $languageUid
* @return void * @return void
*/ */
public function setLanguageUid($languageUid) { public function setLanguageUid($languageUid)
{
$this->_languageUid = $languageUid; $this->_languageUid = $languageUid;
} }
/** /**
* @return int * @return int
*/ */
public function getLanguageUid() { public function getLanguageUid()
{
return $this->_languageUid; return $this->_languageUid;
} }
} }

View file

@ -0,0 +1,59 @@
<?php
namespace Wrm\Events\Domain\Model;
/*
* Copyright (C) 2021 Daniel Siepmann <coding@daniel-siepmann.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
class Partner extends AbstractEntity
{
/**
* @var string
*/
protected $title = '';
/**
* @var string
*/
protected $link = '';
/**
* @var ObjectStorage<FileReference>
*/
protected $images = null;
public function getTitle(): string
{
return $this->title;
}
public function getLink(): string
{
return $this->link;
}
public function getImages(): ObjectStorage
{
return $this->images;
}
}

View file

@ -1,8 +1,8 @@
<?php <?php
namespace Wrm\Events\Domain\Model; namespace Wrm\Events\Domain\Model;
/*
/***
* *
* This file is part of the "DD Events" Extension for TYPO3 CMS. * This file is part of the "DD Events" Extension for TYPO3 CMS.
* *
@ -11,11 +11,14 @@ namespace Wrm\Events\Domain\Model;
* *
* (c) 2019 Dirk Koritnik <koritnik@werkraum-media.de> * (c) 2019 Dirk Koritnik <koritnik@werkraum-media.de>
* *
***/ */
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
/** /**
* Region * Region
*/ */
class Region extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity class Region extends AbstractEntity
{ {
/** /**
@ -77,14 +80,16 @@ class Region extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param int $languageUid * @param int $languageUid
* @return void * @return void
*/ */
public function setLanguageUid($languageUid) { public function setLanguageUid($languageUid)
{
$this->_languageUid = $languageUid; $this->_languageUid = $languageUid;
} }
/** /**
* @return int * @return int
*/ */
public function getLanguageUid() { public function getLanguageUid()
{
return $this->_languageUid; return $this->_languageUid;
} }
} }

View file

@ -1,15 +1,17 @@
<?php <?php
namespace Wrm\Events\Domain\Repository; namespace Wrm\Events\Domain\Repository;
use TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface;
use Wrm\Events\Domain\Model\Dto\DateDemand;
use Wrm\Events\Service\CategoryService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface;
use TYPO3\CMS\Extbase\Persistence\QueryInterface; use TYPO3\CMS\Extbase\Persistence\QueryInterface;
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
use TYPO3\CMS\Extbase\Persistence\Repository;
use Wrm\Events\Domain\Model\Dto\DateDemand;
use Wrm\Events\Service\CategoryService;
class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository class DateRepository extends Repository
{ {
/** /**
@ -66,7 +68,7 @@ class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
$constraints['region'] = $query->equals('event.region', $demand->getRegion()); $constraints['region'] = $query->equals('event.region', $demand->getRegion());
} }
if ($demand->getHighlight() !== FALSE) { if ($demand->getHighlight() !== false) {
$constraints['highlight'] = $query->equals('event.highlight', $demand->getHighlight()); $constraints['highlight'] = $query->equals('event.highlight', $demand->getHighlight());
} }
@ -78,14 +80,14 @@ class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
$constraints['userCategories'] = $query->in('event.categories.uid', $demand->getUserCategories()); $constraints['userCategories'] = $query->in('event.categories.uid', $demand->getUserCategories());
} }
if ($demand->getStart() !== '' && $demand->getEnd() != '') { if ($demand->getStart() !== '') {
$constraints['daterange'] = $query->logicalAnd( $constraints['starts'] = $query->greaterThanOrEqual('start', $demand->getStart());
[ }
$query->greaterThanOrEqual('start', $demand->getStart()), if ($demand->getEnd() != '') {
$query->lessThanOrEqual('end', $demand->getEnd()) $constraints['ends'] = $query->lessThanOrEqual('end', $demand->getEnd());
] }
);
} else { if ($demand->getStart() === '' && $demand->getEnd() === '') {
$now = new \DateTime('now', new \DateTimeZone('Europe/Berlin')); $now = new \DateTime('now', new \DateTimeZone('Europe/Berlin'));
$constraints['untilnow'] = $query->greaterThanOrEqual('start', $now); $constraints['untilnow'] = $query->greaterThanOrEqual('start', $now);
} }
@ -182,5 +184,4 @@ class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
return $statement->execute()->fetchAll(); return $statement->execute()->fetchAll();
} }
} }

View file

@ -1,7 +1,8 @@
<?php <?php
namespace Wrm\Events\Domain\Repository; namespace Wrm\Events\Domain\Repository;
/** /*
* This file is part of the TYPO3 CMS project. * This file is part of the TYPO3 CMS project.
* *
* It is free software; you can redistribute it and/or modify it under * It is free software; you can redistribute it and/or modify it under
@ -14,76 +15,111 @@ namespace Wrm\Events\Domain\Repository;
* The TYPO3 project - inspiring people to share! * The TYPO3 project - inspiring people to share!
*/ */
use Wrm\Events\Domain\Model\Dto\EventDemand;
use Wrm\Events\Service\CategoryService;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface;
use TYPO3\CMS\Extbase\Persistence\QueryInterface; use TYPO3\CMS\Extbase\Persistence\QueryInterface;
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
use TYPO3\CMS\Extbase\Persistence\Repository;
use Wrm\Events\Domain\Model\Dto\EventDemand;
use Wrm\Events\Domain\Model\Event;
use Wrm\Events\Service\CategoryService;
class EventRepository extends \TYPO3\CMS\Extbase\Persistence\Repository class EventRepository extends Repository
{ {
public function findByUids(string $uids): QueryResultInterface
/**
* Find all products based on selected uids
*
* @param string $uids
*
* @return array
*/
public function findByUids($uids)
{ {
$uids = explode(',', $uids);
$query = $this->createQuery(); $query = $this->createQuery();
//$query->getQuerySettings()->setRespectStoragePage(false); $query->matching($query->in('uid', GeneralUtility::intExplode(',', $uids)));
$query->matching(
$query->in('uid', $uids)
);
//return $this->orderByField($query->execute(), $uids);
return $query->execute(); return $query->execute();
} }
/** /**
* @param EventDemand $demand * @return QueryResultInterface|array
* @return QueryResultInterface
* @throws InvalidQueryException * @throws InvalidQueryException
*/ */
public function findByDemand(EventDemand $demand) public function findByDemand(EventDemand $demand)
{ {
$query = $this->createDemandQuery($demand); $query = $this->createDemandQuery($demand);
if ($demand->getRecordUids() !== [] && $demand->getSortBy() === 'default') {
return $this->sortByDemand($query, $demand);
}
return $query->execute(); return $query->execute();
} }
/** /**
* @param EventDemand $demand
* @return QueryInterface
* @throws InvalidQueryException * @throws InvalidQueryException
*/ */
protected function createDemandQuery(EventDemand $demand): QueryInterface protected function createDemandQuery(EventDemand $demand): QueryInterface
{ {
$query = $this->createQuery(); $query = $this->createQuery();
$query = $this->setOrderings($query, $demand);
// sorting $constraints = $this->getConstraints($query, $demand);
$sortBy = $demand->getSortBy(); if (!empty($constraints)) {
if ($sortBy && $sortBy !== 'singleSelection' && $sortBy !== 'default') { $query->matching($query->logicalAnd($constraints));
$order = strtolower($demand->getSortOrder()) === 'desc' ? QueryInterface::ORDER_DESCENDING : QueryInterface::ORDER_ASCENDING;
$query->setOrderings([$sortBy => $order]);
} }
if ($demand->getLimit() !== '') {
$query->setLimit((int) $demand->getLimit());
}
return $query;
}
private function setOrderings(QueryInterface $query, EventDemand $demand): QueryInterface
{
$sortBy = $demand->getSortBy();
$sortingsToIgnore = ['singleSelection', 'default'];
if (!$sortBy || in_array($sortBy, $sortingsToIgnore)) {
return $query;
}
$order = QueryInterface::ORDER_ASCENDING;
if (strtolower($demand->getSortOrder()) === 'desc') {
$order = QueryInterface::ORDER_DESCENDING;
}
$query->setOrderings([$sortBy => $order]);
return $query;
}
private function sortByDemand(QueryInterface $query, EventDemand $demand): array
{
$result = $query->execute()->toArray();
$expectedSorting = $demand->getRecordUids();
usort($result, function (Event $eventA, Event $eventB) use ($expectedSorting) {
$positionOfA = array_search($eventA->getUid(), $expectedSorting);
if ($positionOfA === false) {
$positionOfA = array_search($eventA->getLocalizedUid(), $expectedSorting);
}
$positionOfB = array_search($eventB->getUid(), $expectedSorting);
if ($positionOfB === false) {
$positionOfB = array_search($eventB->getLocalizedUid(), $expectedSorting);
}
return $positionOfA <=> $positionOfB;
});
return $result;
}
private function getConstraints(QueryInterface $query, EventDemand $demand): array
{
$constraints = []; $constraints = [];
$categories = $demand->getCategories(); if ($demand->getCategories()) {
$constraints['categories'] = $this->createCategoryConstraint($query, $demand);
}
if ($categories) { if ($demand->getRecordUids() !== []) {
$categoryConstraints = $this->createCategoryConstraint($query, $categories, $demand->getIncludeSubCategories()); $constraints['recordUids'] = $query->in('uid', $demand->getRecordUids());
if ($demand->getCategoryCombination() === 'or') {
$constraints['categories'] = $query->logicalOr($categoryConstraints);
} else {
$constraints['categories'] = $query->logicalAnd($categoryConstraints);
}
} }
if ($demand->getRegion() !== '') { if ($demand->getRegion() !== '') {
@ -94,53 +130,42 @@ class EventRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
$constraints['highlight'] = $query->equals('highlight', $demand->getHighlight()); $constraints['highlight'] = $query->equals('highlight', $demand->getHighlight());
} }
if ($demand->getLimit() !== '') { return $constraints;
$query->setLimit((int) $demand->getLimit());
}
if (!empty($constraints)) {
$query->matching($query->logicalAnd($constraints));
}
return $query;
} }
/** /**
* @param QueryInterface $query
* @param string $categories
* @param bool $includeSubCategories
* @return array
* @throws InvalidQueryException * @throws InvalidQueryException
*/ */
protected function createCategoryConstraint(QueryInterface $query, $categories, bool $includeSubCategories = false): array protected function createCategoryConstraint(QueryInterface $query, EventDemand $demand): ConstraintInterface
{ {
$constraints = []; $constraints = [];
if ($includeSubCategories) { $allCategories = GeneralUtility::intExplode(',', $demand->getCategories(), true);
if ($demand->getIncludeSubCategories()) {
$categoryService = GeneralUtility::makeInstance(CategoryService::class); $categoryService = GeneralUtility::makeInstance(CategoryService::class);
$allCategories = $categoryService->getChildrenCategories($categories); $allCategories = $categoryService->getChildrenCategories($demand->getCategories());
if (!\is_array($allCategories)) { if (!\is_array($allCategories)) {
$allCategories = GeneralUtility::intExplode(',', $allCategories, true); $allCategories = GeneralUtility::intExplode(',', $allCategories, true);
} }
} else {
$allCategories = GeneralUtility::intExplode(',', $categories, true);
} }
foreach ($allCategories as $category) { foreach ($allCategories as $category) {
$constraints[] = $query->contains('categories', $category); $constraints[] = $query->contains('categories', $category);
} }
return $constraints;
}
if ($demand->getCategoryCombination() === 'or') {
return $query->logicalOr($constraints);
}
return $query->logicalAnd($constraints);
}
public function findSearchWord($search) public function findSearchWord($search)
{ {
$query = $this->createQuery(); $query = $this->createQuery();
$query->matching( $query->matching($query->like('title', '%' . $search . '%'));
$query->like('title', '%' . $search . '%')
);
$query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]); $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
$query->setLimit(20); $query->setLimit(20);
return $query->execute(); return $query->execute();
} }
} }

View file

@ -1,7 +1,8 @@
<?php <?php
namespace Wrm\Events\Domain\Repository; namespace Wrm\Events\Domain\Repository;
/** /*
* This file is part of the TYPO3 CMS project. * This file is part of the TYPO3 CMS project.
* *
* It is free software; you can redistribute it and/or modify it under * It is free software; you can redistribute it and/or modify it under
@ -14,9 +15,9 @@ namespace Wrm\Events\Domain\Repository;
* The TYPO3 project - inspiring people to share! * The TYPO3 project - inspiring people to share!
*/ */
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; use TYPO3\CMS\Extbase\Persistence\Repository;
class OrganizerRepository extends \TYPO3\CMS\Extbase\Persistence\Repository class OrganizerRepository extends Repository
{ {
} }

View file

@ -1,7 +1,8 @@
<?php <?php
namespace Wrm\Events\Domain\Repository; namespace Wrm\Events\Domain\Repository;
/** /*
* This file is part of the TYPO3 CMS project. * This file is part of the TYPO3 CMS project.
* *
* It is free software; you can redistribute it and/or modify it under * It is free software; you can redistribute it and/or modify it under
@ -14,9 +15,9 @@ namespace Wrm\Events\Domain\Repository;
* The TYPO3 project - inspiring people to share! * The TYPO3 project - inspiring people to share!
*/ */
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; use TYPO3\CMS\Extbase\Persistence\Repository;
class RegionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository class RegionRepository extends Repository
{ {
} }

View file

@ -0,0 +1,90 @@
<?php
namespace Wrm\Events\Extbase;
/*
* Copyright (C) 2021 Daniel Siepmann <coding@daniel-siepmann.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Extbase\Event\Persistence\AfterObjectThawedEvent;
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper;
use Wrm\Events\Domain\Model\Date;
class AddSpecialProperties
{
/**
* @var ConnectionPool
*/
private $connectionPool;
/**
* @var DataMapper
*/
private $dataMapper;
/**
* Internal info to speed things up if we know there are none.
* @var bool
*/
private $doPostponedDatesExist = true;
public function __construct(
ConnectionPool $connectionPool,
DataMapper $dataMapper
) {
$this->connectionPool = $connectionPool;
$this->dataMapper = $dataMapper;
$qb = $this->connectionPool->getQueryBuilderForTable('tx_events_domain_model_date');
$qb->count('uid');
$qb->from('tx_events_domain_model_date');
$qb->where($qb->expr()->gt('postponed_date', $qb->createNamedParameter(0)));
$this->doPostponedDatesExist = $qb->execute()->fetchColumn() > 0;
}
public function __invoke(AfterObjectThawedEvent $event): void
{
if (
$this->doPostponedDatesExist
&& $event->getObject() instanceof Date
) {
/** @var Date $date */
$date = $event->getObject();
$date->_setProperty('originalDate', $this->getOriginalDate($date->_getProperty('_localizedUid')));
}
}
private function getOriginalDate(int $uidOfReferencedDate): ?Date
{
$qb = $this->connectionPool->getQueryBuilderForTable('tx_events_domain_model_date');
$qb->select('*');
$qb->from('tx_events_domain_model_date');
$qb->where($qb->expr()->eq('postponed_date', $uidOfReferencedDate));
$qb->setMaxResults(1);
$result = $qb->execute()->fetch();
if ($result === false) {
return null;
}
$dates = $this->dataMapper->map(Date::class, [$result]);
return $dates[0] ?? null;
}
}

View file

@ -21,7 +21,7 @@ class CategoryService
public function __construct() public function __construct()
{ {
$this->timeTracker = GeneralUtility::makeInstance(TimeTracker::class); $this->timeTracker = GeneralUtility::makeInstance(TimeTracker::class);
$this->cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_Events_category'); $this->cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('events_category');
} }
/** /**

View file

@ -0,0 +1,176 @@
<?php
namespace Wrm\Events\Service;
/*
* Copyright (C) 2021 Daniel Siepmann <coding@daniel-siepmann.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\TypoScript\TypoScriptService;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory;
use TYPO3\CMS\Frontend\ContentObject\ContentDataProcessor;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
/**
* Used by models to apply data processing.
* This allows for flexibility of integrators.
*
* E.g. pages are saved for each event.
* An integrator now can resolve them via data processing to arrays or menus.
*
* dataProcessing is configured via TypoScript for each plugin or whole extension via
* settings.dataProcessing.fqcn, e.g.:
*
* plugin.tx_events {
* settings {
* dataProcessing {
* Wrm\Events\Domain\Model\Event {
* 10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
* 10 {
* special = list
* special.value.field = pages
* dataProcessing {
* 10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
* 10 {
* references.fieldName = media
* }
* }
* }
* }
* }
* }
* }
*
* Currently supported by:
*
* - Event->getPages()
*/
class DataProcessingForModels implements SingletonInterface
{
/**
* @var ContentObjectRenderer
*/
private $cObject;
/**
* @var ContentDataProcessor
*/
private $processorHandler;
/**
* @var Connection
*/
private $connection;
/**
* @var DataMapFactory
*/
private $dataMapFactory;
/**
* @var ConfigurationManagerInterface|null
*/
private $configurationManager;
/**
* @var TypoScriptService
*/
private $typoScriptService;
public function __construct(
ContentDataProcessor $processorHandler,
ConnectionPool $connectionPool,
DataMapFactory $dataMapFactory,
TypoScriptService $typoScriptService
) {
$this->cObject = GeneralUtility::makeInstance(ContentObjectRenderer::class);
$this->processorHandler = $processorHandler;
$this->connection = $connectionPool->getConnectionByName('Default');
$this->dataMapFactory = $dataMapFactory;
$this->typoScriptService = $typoScriptService;
}
/**
* Used to set current configuration from within plugin.
*
* Inject and call this method, e.g. within initializeAction.
* Necessary to get plugin configuration containing dataProcessing configuration.
*/
public function setConfigurationManager(ConfigurationManagerInterface $configurationManager): void
{
$this->configurationManager = $configurationManager;
}
public function process(
AbstractEntity $entity
): array {
$configuration = $this->getConfiguration($entity);
if ($configuration === []) {
return [];
}
$this->cObject->start($this->getData($entity), $this->getTable($entity));
return $this->processorHandler->process($this->cObject, $configuration, []);
}
private function getData(AbstractEntity $entity): array
{
$row = $this->connection->select(['*'], $this->getTable($entity), ['uid' => $entity->getUid()])->fetch();
if (is_array($row)) {
return $row;
}
return [];
}
private function getTable(AbstractEntity $entity): string
{
$dataMap = $this->dataMapFactory->buildDataMap(get_class($entity));
return $dataMap->getTableName();
}
private function getConfiguration(AbstractEntity $entity): array
{
if ($this->configurationManager === null) {
return [];
}
$className = get_class($entity);
$settings = $this->configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS
);
if (ArrayUtility::isValidPath($settings, 'dataProcessing.' . $className, '.') === false) {
return [];
}
$configuration = ArrayUtility::getValueByPath($settings, 'dataProcessing.' . $className, '.');
$configuration = $this->typoScriptService->convertPlainArrayToTypoScriptArray($configuration);
return [
'dataProcessing.' => $configuration,
];
}
}

View file

@ -3,28 +3,32 @@
namespace Wrm\Events\Service; namespace Wrm\Events\Service;
use TYPO3\CMS\Core\Core\Environment; use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\DataHandling\SlugHelper;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Log\LogManager;
use TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException;
use TYPO3\CMS\Core\Resource\FileRepository; use TYPO3\CMS\Core\Resource\FileRepository;
use TYPO3\CMS\Core\Resource\Index\MetaDataRepository; use TYPO3\CMS\Core\Resource\Index\MetaDataRepository;
use TYPO3\CMS\Core\Resource\ResourceFactory; use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\DataHandling\SlugHelper;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Log\LogManager;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository; use TYPO3\CMS\Extbase\Domain\Model\Category;
use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage; use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
use Wrm\Events\Domain\Model\Date;
use Wrm\Events\Domain\Model\Event;
use Wrm\Events\Domain\Model\Organizer;
use Wrm\Events\Domain\Repository\CategoryRepository;
use Wrm\Events\Domain\Repository\DateRepository; use Wrm\Events\Domain\Repository\DateRepository;
use Wrm\Events\Domain\Repository\EventRepository; use Wrm\Events\Domain\Repository\EventRepository;
use Wrm\Events\Domain\Repository\OrganizerRepository; use Wrm\Events\Domain\Repository\OrganizerRepository;
use Wrm\Events\Domain\Repository\RegionRepository; use Wrm\Events\Domain\Repository\RegionRepository;
class DestinationDataImportService
class DestinationDataImportService { {
/** /**
* @var * @var
@ -205,7 +209,8 @@ class DestinationDataImportService {
* @param $regionUid * @param $regionUid
* @param $filesFolder * @param $filesFolder
*/ */
public function import($restExperience, $storagePid, $regionUid, $filesFolder) { public function import($restExperience, $storagePid, $regionUid, $filesFolder)
{
$this->restExperience = $restExperience; $this->restExperience = $restExperience;
$this->storagePid = $storagePid; $this->storagePid = $storagePid;
@ -232,21 +237,21 @@ class DestinationDataImportService {
$restUrl = $this->restUrl . '?experience=' . $this->restExperience . '&licensekey=' . $this->restLicenseKey . '&type=' . $this->restType . '&mode=' . $this->restMode . '&limit=' . $this->restLimit . '&template=' . $this->restTemplate; $restUrl = $this->restUrl . '?experience=' . $this->restExperience . '&licensekey=' . $this->restLicenseKey . '&type=' . $this->restType . '&mode=' . $this->restMode . '&limit=' . $this->restLimit . '&template=' . $this->restTemplate;
$this->logger->info('Try to get data from ' . $restUrl); $this->logger->info('Try to get data from ' . $restUrl);
if ($jsonResponse = json_decode(file_get_contents($restUrl),true)) { if ($jsonResponse = json_decode(file_get_contents($restUrl), true)) {
$this->logger->info('Received data with ' . count($jsonResponse['items']) . ' items'); $this->logger->info('Received data with ' . count($jsonResponse['items']) . ' items');
return $this->processData($jsonResponse); return $this->processData($jsonResponse);
} else { } else {
$this->logger->error('Could not receive data.'); $this->logger->error('Could not receive data.');
return 1; return 1;
} }
} }
/** /**
* @param $data * @param $data
* @return int * @return int
*/ */
public function processData($data) { public function processData($data)
{
$this->logger->info('Processing json ' . count($data['items'])); $this->logger->info('Processing json ' . count($data['items']));
@ -254,7 +259,6 @@ class DestinationDataImportService {
$selectedRegion = $this->regionRepository->findByUid($this->regionUid); $selectedRegion = $this->regionRepository->findByUid($this->regionUid);
foreach ($data['items'] as $event) { foreach ($data['items'] as $event) {
$this->logger->info('Processing event ' . substr($event['title'], 0, 20)); $this->logger->info('Processing event ' . substr($event['title'], 0, 20));
// Event already exists? If not create one! // Event already exists? If not create one!
@ -270,50 +274,59 @@ class DestinationDataImportService {
$this->tmpCurrentEvent->setTitle(substr($event['title'], 0, 254)); $this->tmpCurrentEvent->setTitle(substr($event['title'], 0, 254));
// Set Highlight (Is only set in rest if true) // Set Highlight (Is only set in rest if true)
if($event['highlight']) if ($event['highlight']) {
$this->tmpCurrentEvent->setHighlight($event['highlight']); $this->tmpCurrentEvent->setHighlight($event['highlight']);
}
// Set Texts // Set Texts
if($event['texts']) if ($event['texts']) {
$this->setTexts($event['texts']); $this->setTexts($event['texts']);
}
// Set address and geo data // Set address and geo data
if($event['name'] || $event['street'] || $event['city'] || $event['zip'] || $event['country'] || $event['web']) if ($event['name'] || $event['street'] || $event['city'] || $event['zip'] || $event['country'] || $event['web']) {
$this->setAddress($event); $this->setAddress($event);
}
// Set LatLng // Set LatLng
if($event['geo']['main']['latitude'] && $event['geo']['main']['longitude']) if ($event['geo']['main']['latitude'] && $event['geo']['main']['longitude']) {
$this->setLatLng($event['geo']['main']['latitude'], $event['geo']['main']['longitude']); $this->setLatLng($event['geo']['main']['latitude'], $event['geo']['main']['longitude']);
}
// Set Categories // Set Categories
if($event['categories']) if ($event['categories']) {
$this->setCategories($event['categories']); $this->setCategories($event['categories']);
}
// Set Organizer // Set Organizer
if($event['addresses']) if ($event['addresses']) {
$this->setOrganizer($event['addresses']); $this->setOrganizer($event['addresses']);
}
// Set Social // Set Social
if($event['media_objects']) if ($event['media_objects']) {
$this->setSocial($event['media_objects']); $this->setSocial($event['media_objects']);
}
// Set Tickets // Set Tickets
if($event['media_objects']) if ($event['media_objects']) {
$this->setTickets($event['media_objects']); $this->setTickets($event['media_objects']);
}
// Set Dates // Set Dates
if($event['timeIntervals']) if ($event['timeIntervals']) {
$this->setDates($event['timeIntervals']); $this->setDates($event['timeIntervals']);
}
// Set Assets // Set Assets
if($event['media_objects']) if ($event['media_objects']) {
$this->setAssets($event['media_objects']); $this->setAssets($event['media_objects']);
}
// Update and persist // Update and persist
$this->logger->info('Persist database'); $this->logger->info('Persist database');
$this->eventRepository->update($this->tmpCurrentEvent); $this->eventRepository->update($this->tmpCurrentEvent);
$this->persistenceManager->persistAll(); $this->persistenceManager->persistAll();
} }
$this->doSlugUpdate(); $this->doSlugUpdate();
$this->logger->info('Finished import'); $this->logger->info('Finished import');
@ -324,13 +337,14 @@ class DestinationDataImportService {
* *
* @param array $categories * @param array $categories
*/ */
protected function setCategories(Array $categories) { protected function setCategories(array $categories)
{
$sysParentCategory = $this->sysCategoriesRepository->findByUid($this->categoryParentUid); $sysParentCategory = $this->sysCategoriesRepository->findByUid($this->categoryParentUid);
foreach ($categories as $categoryTitle) { foreach ($categories as $categoryTitle) {
$tmpSysCategory = $this->sysCategoriesRepository->findOneByTitle($categoryTitle); $tmpSysCategory = $this->sysCategoriesRepository->findOneByTitle($categoryTitle);
if (!$tmpSysCategory) { if (!$tmpSysCategory) {
$this->logger->info('Creating new category: ' . $categoryTitle); $this->logger->info('Creating new category: ' . $categoryTitle);
$tmpSysCategory = $this->objectManager->get(\TYPO3\CMS\Extbase\Domain\Model\Category::class); $tmpSysCategory = $this->objectManager->get(Category::class);
$tmpSysCategory->setTitle($categoryTitle); $tmpSysCategory->setTitle($categoryTitle);
$tmpSysCategory->setParent($sysParentCategory); $tmpSysCategory->setParent($sysParentCategory);
$tmpSysCategory->setPid($this->sysCategoriesPid); $tmpSysCategory->setPid($this->sysCategoriesPid);
@ -346,7 +360,8 @@ class DestinationDataImportService {
* @param array $timeIntervals * @param array $timeIntervals
* @TODO: split into functions * @TODO: split into functions
*/ */
protected function setDates(Array $timeIntervals) { protected function setDates(array $timeIntervals)
{
// @TODO: does not seem to work --> // @TODO: does not seem to work -->
//$currentEventDates = $this->tmpCurrentEvent->getDates(); //$currentEventDates = $this->tmpCurrentEvent->getDates();
@ -365,13 +380,11 @@ class DestinationDataImportService {
$today = $today->getTimestamp(); $today = $today->getTimestamp();
foreach ($timeIntervals as $date) { foreach ($timeIntervals as $date) {
// Check if dates are given as interval or not // Check if dates are given as interval or not
if (empty($date['interval'])) { if (empty($date['interval'])) {
if (strtotime($date['start']) > $today) { if (strtotime($date['start']) > $today) {
$this->logger->info('Setup single date'); $this->logger->info('Setup single date');
$dateObj = $this->objectManager->get(\Wrm\Events\Domain\Model\Date::class); $dateObj = $this->objectManager->get(Date::class);
$start = new \DateTime($date['start'], new \DateTimeZone($date['tz'])); $start = new \DateTime($date['start'], new \DateTimeZone($date['tz']));
$end = new \DateTime($date['end'], new \DateTimeZone($date['tz'])); $end = new \DateTime($date['end'], new \DateTimeZone($date['tz']));
$this->logger->info('Start transformed ' . $start->format('Y-m-d H:i')); $this->logger->info('Start transformed ' . $start->format('Y-m-d H:i'));
@ -382,18 +395,15 @@ class DestinationDataImportService {
$dateObj->setEnd($end); $dateObj->setEnd($end);
$this->tmpCurrentEvent->addDate($dateObj); $this->tmpCurrentEvent->addDate($dateObj);
} }
} else { } else {
if ($date['freq'] == 'Daily' && empty($date['weekdays']) && !empty($date['repeatUntil'])) { if ($date['freq'] == 'Daily' && empty($date['weekdays']) && !empty($date['repeatUntil'])) {
$this->logger->info('Setup daily interval dates'); $this->logger->info('Setup daily interval dates');
$this->logger->info('Start ' . $date['start']); $this->logger->info('Start ' . $date['start']);
$this->logger->info('End ' . $date['repeatUntil']); $this->logger->info('End ' . $date['repeatUntil']);
$start = new \DateTime($date['start'], new \DateTimeZone($date['tz'])); $start = new \DateTime($date['start'], new \DateTimeZone($date['tz']));
$until = new \DateTime($date['repeatUntil'], new \DateTimeZone($date['tz'])); $until = new \DateTime($date['repeatUntil'], new \DateTimeZone($date['tz']));
for($i = strtotime($start->format('l'), $start->getTimestamp()); $i <= $until->getTimestamp(); $i = strtotime('+1 day', $i)) { for ($i = strtotime($start->format('l'), $start->getTimestamp()); $i <= $until->getTimestamp(); $i = strtotime('+1 day', $i)) {
if ($i >= $today) { if ($i >= $today) {
$eventStart = new \DateTime(); $eventStart = new \DateTime();
$eventStart->setTimestamp($i); $eventStart->setTimestamp($i);
@ -401,17 +411,14 @@ class DestinationDataImportService {
$eventEnd = new \DateTime(); $eventEnd = new \DateTime();
$eventEnd->setTimestamp($i); $eventEnd->setTimestamp($i);
$eventEnd->setTime($until->format('H'), $until->format('i')); $eventEnd->setTime($until->format('H'), $until->format('i'));
$dateObj = $this->objectManager->get(\Wrm\Events\Domain\Model\Date::class); $dateObj = $this->objectManager->get(Date::class);
$dateObj->setLanguageUid(-1); $dateObj->setLanguageUid(-1);
$dateObj->setStart($eventStart); $dateObj->setStart($eventStart);
$dateObj->setEnd($eventEnd); $dateObj->setEnd($eventEnd);
$this->tmpCurrentEvent->addDate($dateObj); $this->tmpCurrentEvent->addDate($dateObj);
} }
} }
} elseif ($date['freq'] == 'Weekly' && !empty($date['weekdays']) && !empty($date['repeatUntil'])) {
}
else if ($date['freq'] == 'Weekly' && !empty($date['weekdays']) && !empty($date['repeatUntil'])) {
foreach ($date['weekdays'] as $day) { foreach ($date['weekdays'] as $day) {
$this->logger->info('Setup weekly interval dates for ' . $day); $this->logger->info('Setup weekly interval dates for ' . $day);
$this->logger->info('Start ' . $date['start']); $this->logger->info('Start ' . $date['start']);
@ -419,7 +426,7 @@ class DestinationDataImportService {
$start = new \DateTime($date['start'], new \DateTimeZone($date['tz'])); $start = new \DateTime($date['start'], new \DateTimeZone($date['tz']));
$until = new \DateTime($date['repeatUntil'], new \DateTimeZone($date['tz'])); $until = new \DateTime($date['repeatUntil'], new \DateTimeZone($date['tz']));
for($i = strtotime($day, $start->getTimestamp()); $i <= $until->getTimestamp(); $i = strtotime('+1 week', $i)) { for ($i = strtotime($day, $start->getTimestamp()); $i <= $until->getTimestamp(); $i = strtotime('+1 week', $i)) {
if ($i >= $today) { if ($i >= $today) {
$eventStart = new \DateTime(); $eventStart = new \DateTime();
$eventStart->setTimestamp($i); $eventStart->setTimestamp($i);
@ -427,7 +434,7 @@ class DestinationDataImportService {
$eventEnd = new \DateTime(); $eventEnd = new \DateTime();
$eventEnd->setTimestamp($i); $eventEnd->setTimestamp($i);
$eventEnd->setTime($until->format('H'), $until->format('i')); $eventEnd->setTime($until->format('H'), $until->format('i'));
$dateObj = $this->objectManager->get(\Wrm\Events\Domain\Model\Date::class); $dateObj = $this->objectManager->get(Date::class);
$dateObj->setLanguageUid(-1); $dateObj->setLanguageUid(-1);
$dateObj->setStart($eventStart); $dateObj->setStart($eventStart);
$dateObj->setEnd($eventEnd); $dateObj->setEnd($eventEnd);
@ -444,16 +451,16 @@ class DestinationDataImportService {
/** /**
* @param array $addresses * @param array $addresses
*/ */
protected function setOrganizer(Array $addresses) { protected function setOrganizer(array $addresses)
foreach ($addresses as $address) {
{ foreach ($addresses as $address) {
if ($address['rel'] == "organizer") { if ($address['rel'] == "organizer") {
$tmpOrganizer = $this->organizerRepository->findOneByName($address['name']); $tmpOrganizer = $this->organizerRepository->findOneByName($address['name']);
if ($tmpOrganizer) { if ($tmpOrganizer) {
$this->tmpCurrentEvent->setOrganizer($tmpOrganizer); $this->tmpCurrentEvent->setOrganizer($tmpOrganizer);
continue; continue;
} }
$tmpOrganizer = $this->objectManager->get(\Wrm\Events\Domain\Model\Organizer::class); $tmpOrganizer = $this->objectManager->get(Organizer::class);
$tmpOrganizer->setLanguageUid(-1); $tmpOrganizer->setLanguageUid(-1);
$tmpOrganizer->setName($address['name']); $tmpOrganizer->setName($address['name']);
$tmpOrganizer->setCity($address['city']); $tmpOrganizer->setCity($address['city']);
@ -472,44 +479,55 @@ class DestinationDataImportService {
/** /**
* @param array $event * @param array $event
*/ */
protected function setAddress(Array $event) { protected function setAddress(array $event)
if (!empty($event['name'])) {
if (!empty($event['name'])) {
$this->tmpCurrentEvent->setName($event['name']); $this->tmpCurrentEvent->setName($event['name']);
if (!empty($event['street'])) }
if (!empty($event['street'])) {
$this->tmpCurrentEvent->setStreet($event['street']); $this->tmpCurrentEvent->setStreet($event['street']);
if (!empty($event['city'])) }
if (!empty($event['city'])) {
$this->tmpCurrentEvent->setCity($event['city']); $this->tmpCurrentEvent->setCity($event['city']);
if (!empty($event['zip'])) }
if (!empty($event['zip'])) {
$this->tmpCurrentEvent->setZip($event['zip']); $this->tmpCurrentEvent->setZip($event['zip']);
if (!empty($event['country'])) }
if (!empty($event['country'])) {
$this->tmpCurrentEvent->setCountry($event['country']); $this->tmpCurrentEvent->setCountry($event['country']);
if (!empty($event['phone'])) }
if (!empty($event['phone'])) {
$this->tmpCurrentEvent->setPhone($event['phone']); $this->tmpCurrentEvent->setPhone($event['phone']);
if (!empty($event['web'])) }
if (!empty($event['web'])) {
$this->tmpCurrentEvent->setWeb($event['web']); $this->tmpCurrentEvent->setWeb($event['web']);
}
/**
* @param array $media
*/
protected function setSocial(Array $media) {
foreach ($media as $link)
{
if ($link['rel'] == "socialmedia" && $link['value'] == "Facebook")
$this->tmpCurrentEvent->setFacebook($link['url']);
if ($link['rel'] == "socialmedia" && $link['value'] == "YouTube")
$this->tmpCurrentEvent->setYouTube($link['url']);
if ($link['rel'] == "socialmedia" && $link['value'] == "Instagram")
$this->tmpCurrentEvent->setInstagram($link['url']);
} }
} }
/** /**
* @param array $media * @param array $media
*/ */
protected function setTickets(Array $media) { protected function setSocial(array $media)
foreach ($media as $link) {
{ foreach ($media as $link) {
if ($link['rel'] == "socialmedia" && $link['value'] == "Facebook") {
$this->tmpCurrentEvent->setFacebook($link['url']);
}
if ($link['rel'] == "socialmedia" && $link['value'] == "YouTube") {
$this->tmpCurrentEvent->setYouTube($link['url']);
}
if ($link['rel'] == "socialmedia" && $link['value'] == "Instagram") {
$this->tmpCurrentEvent->setInstagram($link['url']);
}
}
}
/**
* @param array $media
*/
protected function setTickets(array $media)
{
foreach ($media as $link) {
if ($link['rel'] == "ticket") { if ($link['rel'] == "ticket") {
$this->tmpCurrentEvent->setTicket($link['url']); $this->tmpCurrentEvent->setTicket($link['url']);
break; break;
@ -526,14 +544,15 @@ class DestinationDataImportService {
* @param string $needle * @param string $needle
* @param array $haystack * @param array $haystack
*/ */
protected function multi_array_key_exists( $needle, $haystack ) { protected function multi_array_key_exists($needle, $haystack)
{
foreach ( $haystack as $key => $value ) { foreach ($haystack as $key => $value) {
if ( $needle == $key ) { if ($needle == $key) {
return true; return true;
} }
if ( is_array( $value ) ) { if (is_array($value)) {
if ( $this->multi_array_key_exists( $needle, $value ) == true ) { if ($this->multi_array_key_exists($needle, $value) == true) {
return true; return true;
} }
} }
@ -545,7 +564,8 @@ class DestinationDataImportService {
* @param string $lat * @param string $lat
* @param string $lng * @param string $lng
*/ */
protected function setLatLng(String $lat, String $lng) { protected function setLatLng(string $lat, string $lng)
{
$this->tmpCurrentEvent->setLatitude($lat); $this->tmpCurrentEvent->setLatitude($lat);
$this->tmpCurrentEvent->setLongitude($lng); $this->tmpCurrentEvent->setLongitude($lng);
} }
@ -554,9 +574,9 @@ class DestinationDataImportService {
* Set Texts * Set Texts
* @param Array $texts * @param Array $texts
*/ */
protected function setTexts(Array $texts) { protected function setTexts(array $texts)
foreach ($texts as $text) {
{ foreach ($texts as $text) {
if ($text['rel'] == "details" && $text['type'] == "text/plain") { if ($text['rel'] == "details" && $text['type'] == "text/plain") {
$this->tmpCurrentEvent->setDetails(str_replace('\n\n', '\n', $text['value'])); $this->tmpCurrentEvent->setDetails(str_replace('\n\n', '\n', $text['value']));
} }
@ -574,7 +594,8 @@ class DestinationDataImportService {
* @param String $globalId * @param String $globalId
* @param String $title * @param String $title
*/ */
protected function getOrCreateEvent(String $globalId, String $title) { protected function getOrCreateEvent(string $globalId, string $title)
{
$event = $this->eventRepository->findOneByGlobalId($globalId); $event = $this->eventRepository->findOneByGlobalId($globalId);
@ -587,7 +608,7 @@ class DestinationDataImportService {
// New event is created // New event is created
$this->logger->info(substr($title, 0, 20) . ' does not exist'); $this->logger->info(substr($title, 0, 20) . ' does not exist');
$event = $this->objectManager->get(\Wrm\Events\Domain\Model\Event::class); $event = $this->objectManager->get(Event::class);
// Create event and persist // Create event and persist
$event->setGlobalId($globalId); $event->setGlobalId($globalId);
$event->setCategories(new ObjectStorage()); $event->setCategories(new ObjectStorage());
@ -600,16 +621,15 @@ class DestinationDataImportService {
/** /**
* @param array $assets * @param array $assets
*/ */
protected function setAssets(Array $assets) { protected function setAssets(array $assets)
{
$this->logger->info("Set assets"); $this->logger->info("Set assets");
$error = false; $error = false;
foreach ($assets as $media_object) foreach ($assets as $media_object) {
{ if ($media_object['rel'] == "default" && $media_object['type'] == "image/jpeg") {
if($media_object['rel'] == "default" && $media_object['type'] == "image/jpeg") {
$this->storage = $this->resourceFactory->getDefaultStorage(); $this->storage = $this->resourceFactory->getDefaultStorage();
$orgFileUrl = urldecode($media_object['url']); $orgFileUrl = urldecode($media_object['url']);
@ -637,24 +657,30 @@ class DestinationDataImportService {
if ($file = $this->loadFile($orgFileUrl)) { if ($file = $this->loadFile($orgFileUrl)) {
// Move file to defined folder // Move file to defined folder
$this->logger->info('Adding file ' . $file); $this->logger->info('Adding file ' . $file);
$this->storage->addFile($this->environment->getPublicPath() . "/uploads/tx_events/" . $file, $this->storage->getFolder($this->filesFolder));
try {
$targetFolder = $this->storage->getFolder($this->filesFolder);
} catch (FolderDoesNotExistException $e) {
$targetFolder = $this->storage->createFolder($this->filesFolder);
}
$this->storage->addFile($this->environment->getPublicPath() . "/uploads/tx_events/" . $file, $targetFolder);
} else { } else {
$error = true; $error = true;
} }
} }
if ($error !== true) { if ($error !== true) {
if ($this->tmpCurrentEvent->getImages() !== null) { if ($this->tmpCurrentEvent->getImages()->count() > 0) {
$this->logger->info('Relation found'); $this->logger->info('Relation found');
// TODO: How to delete file references? // TODO: How to delete file references?
} else { } else {
$this->logger->info('No relation found'); $this->logger->info('No relation found');
$file = $this->storage->getFile($this->filesFolder . $orgFileNameSanitized); $file = $this->storage->getFile($this->filesFolder . $orgFileNameSanitized);
$this->metaDataRepository->update($file->getUid(), array('title' => $media_object['value'], 'description' => $media_object['description'], 'alternative' => 'DD Import')); $this->metaDataRepository->update($file->getUid(), array('title' => $media_object['value'], 'description' => $media_object['description'], 'alternative' => 'DD Import'));
$this->createFileRelations($file->getUid(), 'tx_events_domain_model_event', $this->tmpCurrentEvent->getUid(), 'images', $this->storagePid); $this->createFileRelations($file->getUid(), 'tx_events_domain_model_event', $this->tmpCurrentEvent->getUid(), 'images', $this->storagePid);
} }
} }
} }
$error = false; $error = false;
} }
@ -665,7 +691,8 @@ class DestinationDataImportService {
* @param string $file * @param string $file
* @return string * @return string
*/ */
protected function loadFile($file) { protected function loadFile($file)
{
$directory = $this->environment->getPublicPath() . "/uploads/tx_events/"; $directory = $this->environment->getPublicPath() . "/uploads/tx_events/";
$filename = basename($file); $filename = basename($file);
$this->logger->info('Getting file ' . $file . ' as ' . $filename); $this->logger->info('Getting file ' . $file . ' as ' . $filename);
@ -687,7 +714,8 @@ class DestinationDataImportService {
* @param string $storagePid * @param string $storagePid
* @return bool * @return bool
*/ */
protected function createFileRelations($uid_local, $tablenames, $uid_foreign, $fieldname, $storagePid) { protected function createFileRelations($uid_local, $tablenames, $uid_foreign, $fieldname, $storagePid)
{
$newId = 'NEW1234'; $newId = 'NEW1234';
@ -706,7 +734,7 @@ class DestinationDataImportService {
$fieldname => $newId $fieldname => $newId
); );
$dataHandler = $this->objectManager->get(\TYPO3\CMS\Core\DataHandling\DataHandler::class); $dataHandler = $this->objectManager->get(DataHandler::class);
$dataHandler->start($data, array()); $dataHandler->start($data, array());
$dataHandler->process_datamap(); $dataHandler->process_datamap();
@ -714,7 +742,7 @@ class DestinationDataImportService {
return true; return true;
} }
foreach($dataHandler->errorLog as $error) { foreach ($dataHandler->errorLog as $error) {
$this->logger->info($error); $this->logger->info($error);
} }
return false; return false;

View file

@ -2,8 +2,10 @@
namespace Wrm\Events\ViewHelpers; namespace Wrm\Events\ViewHelpers;
class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper { class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper
protected function renderHiddenReferrerFields(){ {
protected function renderHiddenReferrerFields()
{
return ''; return '';
} }
} }

View file

@ -1,12 +0,0 @@
<?php
return [
'events:destinationdataimport' => [
'class' => \Wrm\Events\Command\DestinationDataImportCommand::class
],
'events:removeAll' => [
'class' => \Wrm\Events\Command\RemoveAllCommand::class
],
'events:removePast' => [
'class' => \Wrm\Events\Command\RemovePastCommand::class
],
];

View file

@ -0,0 +1,9 @@
<?php
declare(strict_types=1);
return [
\Wrm\Events\Domain\Model\Category::class => [
'tableName' => 'sys_category',
],
];

View file

@ -1,101 +0,0 @@
#
# Extension Builder settings for extension events
# generated 2019-04-01T14:33:00Z
#
# See http://www.yaml.org/spec/1.2/spec.html
#
---
########### Overwrite settings ###########
#
# These settings only apply, if the roundtrip feature of the extension builder
# is enabled in the extension manager
#
# Usage:
# nesting reflects the file structure
# a setting applies to a file or recursive to all files and subfolders
#
# merge:
# means for classes: All properties ,methods and method bodies
# of the existing class will be modified according to the new settings
# but not overwritten
#
# for locallang xlf files: Existing keys and labels are always
# preserved (renaming a property or DomainObject will result in new keys and new labels)
#
# for other files: You will find a Split token at the end of the file
# see: \EBT\ExtensionBuilder\Service\RoundTrip::SPLIT_TOKEN
#
# After this token you can write whatever you want and it will be appended
# everytime the code is generated
#
# keep:
# files are never overwritten
# These settings may break the functionality of the extension builder!
# Handle with care!
#
#
############ extension settings ##############
overwriteSettings:
Classes:
Controller: merge
Domain:
Model: merge
Repository: merge
Configuration:
#TCA merge not possible - use overrides directory
#TypoScript: keep
Resources:
Private:
#Language: merge
#Templates: keep
user_extension.svg: keep
# ext_localconf.php: merge
# ext_tables.php: merge
# ext_tables.sql: merge
## use static date attribute in xliff files ##
#staticDateInXliffFiles: 2019-04-01T14:33:00Z
## skip docComment (license header) ##
#skipDocComment
## list of error codes for warnings that should be ignored ##
#ignoreWarnings:
#503
######### settings for classBuilder #############################
#
# here you may define default parent classes for your classes
# these settings only apply for new generated classes
# you may also just change the parent class in the generated class file.
# It will be kept on next code generation, if the overwrite settings
# are configured to merge it
#
#################################################################
classBuilder:
Controller:
parentClass: \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
Model:
AbstractEntity:
parentClass: \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
AbstractValueObject:
parentClass: \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject
Repository:
parentClass: \TYPO3\CMS\Extbase\Persistence\Repository
setDefaultValuesForClassProperties: true

View file

@ -13,6 +13,7 @@
<label>Sort By</label> <label>Sort By</label>
<config> <config>
<type>select</type> <type>select</type>
<renderType>selectSingle</renderType>
<items type="array"> <items type="array">
<numIndex index="0" type="array"> <numIndex index="0" type="array">
<numIndex index="0">Start</numIndex> <numIndex index="0">Start</numIndex>
@ -33,6 +34,7 @@
<label>Sort Order</label> <label>Sort Order</label>
<config> <config>
<type>select</type> <type>select</type>
<renderType>selectSingle</renderType>
<items type="array"> <items type="array">
<numIndex index="0" type="array"> <numIndex index="0" type="array">
<numIndex index="0"> <numIndex index="0">
@ -128,6 +130,7 @@
<label>Layout option</label> <label>Layout option</label>
<config> <config>
<type>select</type> <type>select</type>
<renderType>selectSingle</renderType>
<items type="array"> <items type="array">
<numIndex index="0" type="array"> <numIndex index="0" type="array">
<numIndex index="0">Default</numIndex> <numIndex index="0">Default</numIndex>
@ -164,11 +167,12 @@
<label>Region</label> <label>Region</label>
<config> <config>
<type>select</type> <type>select</type>
<renderType>selectSingle</renderType>
<foreign_table>tx_events_domain_model_region</foreign_table> <foreign_table>tx_events_domain_model_region</foreign_table>
<foreign_table_where>AND tx_events_domain_model_region.deleted = 0 AND tx_events_domain_model_region.hidden = 0</foreign_table_where> <foreign_table_where>AND tx_events_domain_model_region.deleted = 0 AND tx_events_domain_model_region.hidden = 0</foreign_table_where>
<size>3</size> <size>1</size>
<minitems>0</minitems> <minitems>0</minitems>
<maxitems>2</maxitems> <maxitems>1</maxitems>
</config> </config>
</TCEforms> </TCEforms>
</settings.region> </settings.region>
@ -179,6 +183,7 @@
<label>Combination</label> <label>Combination</label>
<config> <config>
<type>select</type> <type>select</type>
<renderType>selectSingle</renderType>
<items type="array"> <items type="array">
<numIndex index="0" type="array"> <numIndex index="0" type="array">
<numIndex index="0">And</numIndex> <numIndex index="0">And</numIndex>
@ -202,6 +207,7 @@
</label> </label>
<config> <config>
<type>select</type> <type>select</type>
<renderType>selectTree</renderType>
<autoSizeMax>20</autoSizeMax> <autoSizeMax>20</autoSizeMax>
<foreign_table>sys_category</foreign_table> <foreign_table>sys_category</foreign_table>
<foreign_table_where> AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC</foreign_table_where> <foreign_table_where> AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC</foreign_table_where>

View file

@ -1,402 +0,0 @@
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>Options</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<switchableControllerActions>
<TCEforms>
<label>Controller action</label>
<onChange>reload</onChange>
<config>
<type>select</type>
<items>
<numIndex index="0">
<numIndex index="0">Event List</numIndex>
<numIndex index="1">Event->list</numIndex>
</numIndex>
<numIndex index="1">
<numIndex index="0">Event Teaser</numIndex>
<numIndex index="1">Event->teaser</numIndex>
</numIndex>
<numIndex index="2">
<numIndex index="0">Event Show</numIndex>
<numIndex index="1">Event->show</numIndex>
</numIndex>
<numIndex index="3">
<numIndex index="0">Date List</numIndex>
<numIndex index="1">Date->list</numIndex>
</numIndex>
<!--
<numIndex index="4">
<numIndex index="0">Date Teaser</numIndex>
<numIndex index="1">Date->teaser</numIndex>
</numIndex>
-->
<numIndex index="5">
<numIndex index="0">Date Show</numIndex>
<numIndex index="1">Date->show</numIndex>
</numIndex>
<numIndex index="6">
<numIndex index="0">Event Search</numIndex>
<numIndex index="1">Event->search</numIndex>
</numIndex>
<numIndex index="6">
<numIndex index="0">Date Search</numIndex>
<numIndex index="1">Date->search</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</switchableControllerActions>
<settings.sortByEvent>
<TCEforms>
<exclude>1</exclude>
<label>Sort By</label>
<displayCond>FIELD:switchableControllerActions:=:Event->list</displayCond>
<config>
<type>select</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">Title</numIndex>
<numIndex index="1">title</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">Region</numIndex>
<numIndex index="1">region</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</settings.sortByEvent>
<settings.sortByDate>
<TCEforms>
<exclude>1</exclude>
<label>Sort By</label>
<displayCond>
<OR>
<numIndex index="0">FIELD:switchableControllerActions:=:Date->list</numIndex>
<numIndex index="1">FIELD:switchableControllerActions:=:Date->search</numIndex>
</OR>
</displayCond>
<config>
<type>select</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">Start</numIndex>
<numIndex index="1">start</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">End</numIndex>
<numIndex index="1">end</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</settings.sortByDate>
<settings.sortOrder>
<TCEforms>
<exclude>1</exclude>
<label>Sort Order</label>
<displayCond>
<OR>
<numIndex index="0">FIELD:switchableControllerActions:=:Event->list</numIndex>
<numIndex index="1">FIELD:switchableControllerActions:=:Date->list</numIndex>
<numIndex index="2">FIELD:switchableControllerActions:=:Date->search</numIndex>
</OR>
</displayCond>
<config>
<type>select</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">
Ascending
</numIndex>
<numIndex index="1">ASC</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">
Descending
</numIndex>
<numIndex index="1">DESC</numIndex>
</numIndex>
</items>
<default>ASC</default>
</config>
</TCEforms>
</settings.sortOrder>
<settings.limit>
<TCEforms>
<exclude>1</exclude>
<label>Max Items</label>
<displayCond>
<OR>
<numIndex index="0">FIELD:switchableControllerActions:=:Event->list</numIndex>
<numIndex index="1">FIELD:switchableControllerActions:=:Date->list</numIndex>
<numIndex index="2">FIELD:switchableControllerActions:=:Date->search</numIndex>
</OR>
</displayCond>
<config>
<type>input</type>
<size>10</size>
<max>30</max>
<eval>trim</eval>
</config>
</TCEforms>
</settings.limit>
<settings.highlight>
<TCEforms>
<exclude>1</exclude>
<label>Highlights only</label>
<displayCond>
<OR>
<numIndex index="0">FIELD:switchableControllerActions:=:Event->list</numIndex>
<numIndex index="1">FIELD:switchableControllerActions:=:Date->list</numIndex>
</OR>
</displayCond>
<config>
<type>check</type>
<default>0</default>
</config>
</TCEforms>
</settings.highlight>
<settings.todayOnly>
<TCEforms>
<exclude>1</exclude>
<label>Today only</label>
<displayCond>
<OR>
<numIndex index="0">FIELD:switchableControllerActions:=:Event->list</numIndex>
<numIndex index="1">FIELD:switchableControllerActions:=:Date->list</numIndex>
</OR>
</displayCond>
<config>
<type>check</type>
<default>0</default>
</config>
</TCEforms>
</settings.todayOnly>
<settings.pagination>
<TCEforms>
<exclude>1</exclude>
<label>Show pagination</label>
<displayCond>
<OR>
<numIndex index="0">FIELD:switchableControllerActions:=:Event->list</numIndex>
<numIndex index="1">FIELD:switchableControllerActions:=:Date->list</numIndex>
</OR>
</displayCond>
<config>
<type>check</type>
<default>0</default>
</config>
</TCEforms>
</settings.pagination>
<settings.showPID>
<TCEforms>
<exclude>1</exclude>
<label>Detail page</label>
<displayCond>
<OR>
<numIndex index="0">FIELD:switchableControllerActions:=:Event->list</numIndex>
<numIndex index="1">FIELD:switchableControllerActions:=:Event->teaser</numIndex>
<numIndex index="2">FIELD:switchableControllerActions:=:Event->search</numIndex>
<numIndex index="3">FIELD:switchableControllerActions:=:Date->list</numIndex>
<numIndex index="4">FIELD:switchableControllerActions:=:Date->teaser</numIndex>
<numIndex index="5">FIELD:switchableControllerActions:=:Date->search</numIndex>
</OR>
</displayCond>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>pages</allowed>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
<show_thumbs>1</show_thumbs>
</config>
</TCEforms>
</settings.showPID>
<settings.eventUids>
<TCEforms>
<label>
Event
</label>
<displayCond>
<OR>
<numIndex index="0">FIELD:switchableControllerActions:=:Event->teaser</numIndex>
<numIndex index="1">FIELD:switchableControllerActions:=:Date->teaser</numIndex>
</OR>
</displayCond>
<config>
<type>select</type>
<foreign_table>tx_events_domain_model_event</foreign_table>
<foreign_table_where>AND tx_events_domain_model_event.deleted = 0 AND tx_events_domain_model_event.hidden = 0</foreign_table_where>
<size>3</size>
<enableMultiSelectFilterTextfield>1</enableMultiSelectFilterTextfield>
<minitems>0</minitems>
<maxitems>99</maxitems>
</config>
</TCEforms>
</settings.eventUids>
</el>
</ROOT>
</sDEF>
<sTemplate>
<ROOT>
<TCEforms>
<sheetTitle>Template</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<settings.template>
<exclude>1</exclude>
<label>Layout option</label>
<displayCond>
<OR>
<numIndex index="0">FIELD:sDEF.switchableControllerActions:=:Event->list</numIndex>
<numIndex index="1">FIELD:sDEF.switchableControllerActions:=:Date->list</numIndex>
</OR>
</displayCond>
<config>
<type>select</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">Default</numIndex>
<numIndex index="1">default</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">Costum</numIndex>
<numIndex index="1">costum</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">Table</numIndex>
<numIndex index="1">table</numIndex>
</numIndex>
<numIndex index="3" type="array">
<numIndex index="0">Grid</numIndex>
<numIndex index="1">grid</numIndex>
</numIndex>
</items>
<default>default</default>
</config>
</settings.template>
</el>
</ROOT>
</sTemplate>
<sConstrains>
<ROOT>
<TCEforms>
<sheetTitle>Regions &amp; Categories</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<settings.region>
<TCEforms>
<label>Region</label>
<displayCond>
<OR>
<numIndex index="0">FIELD:sDEF.switchableControllerActions:=:Event->list</numIndex>
<numIndex index="1">FIELD:sDEF.switchableControllerActions:=:Date->list</numIndex>
</OR>
</displayCond>
<config>
<type>select</type>
<foreign_table>tx_events_domain_model_region</foreign_table>
<foreign_table_where>AND tx_events_domain_model_region.deleted = 0 AND tx_events_domain_model_region.hidden = 0</foreign_table_where>
<size>3</size>
<minitems>0</minitems>
<maxitems>2</maxitems>
</config>
</TCEforms>
</settings.region>
<settings.categoryCombination>
<TCEforms>
<exclude>1</exclude>
<label>Combination</label>
<displayCond>
<OR>
<numIndex index="0">FIELD:sDEF.switchableControllerActions:=:Event->list</numIndex>
<numIndex index="1">FIELD:sDEF.switchableControllerActions:=:Date->list</numIndex>
</OR>
</displayCond>
<config>
<type>select</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">And</numIndex>
<numIndex index="1">0</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">Or</numIndex>
<numIndex index="1">1</numIndex>
</numIndex>
</items>
<default>0</default>
</config>
</TCEforms>
</settings.categoryCombination>
<settings.categories>
<TCEforms>
<exclude>1</exclude>
<label>
Category
</label>
<displayCond>
<OR>
<numIndex index="0">FIELD:sDEF.switchableControllerActions:=:Event->list</numIndex>
<numIndex index="1">FIELD:sDEF.switchableControllerActions:=:Date->list</numIndex>
</OR>
</displayCond>
<config>
<type>select</type>
<autoSizeMax>20</autoSizeMax>
<foreign_table>sys_category</foreign_table>
<foreign_table_where> AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC</foreign_table_where>
<maxitems>1</maxitems>
<renderMode>tree</renderMode>
<size>8</size>
<treeConfig>
<appearance>
<expandAll>1</expandAll>
<showHeader>1</showHeader>
</appearance>
<parentField>parent</parentField>
</treeConfig>
</config>
</TCEforms>
</settings.categories>
<settings.includeSubcategories>
<TCEforms>
<exclude>1</exclude>
<label>Include Subcategories</label>
<displayCond>FIELD:sDEF.switchableControllerActions:=:Event->list</displayCond>
<config>
<type>check</type>
<default>0</default>
</config>
</TCEforms>
</settings.includeSubcategories>
</el>
</ROOT>
</sConstrains>
</sheets>
</T3DataStructure>

View file

@ -0,0 +1,24 @@
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<type>array</type>
<el>
<settings.selectedRecords>
<TCEforms>
<exclude>1</exclude>
<label>LLL:EXT:events/Resources/Private/Language/de.locallang_db.xlf:tx_events.flexform.selected.selectedRecords</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>tx_events_domain_model_event</allowed>
<minitems>1</minitems>
<show_thumbs>1</show_thumbs>
</config>
</TCEforms>
</settings.selectedRecords>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>

View file

@ -0,0 +1,34 @@
services:
_defaults:
autowire: true
autoconfigure: true
public: false
Wrm\Events\:
resource: '../Classes/*'
Wrm\Events\Command\DestinationDataImportCommand:
tags:
- name: 'console.command'
command: 'events:destinationdataimport'
events.levacy_comannd_identifier:
class: 'Wrm\Events\Command\DestinationDataImportCommand'
tags:
- name: 'console.command'
command: 'events:destinationdataimport'
Wrm\Events\Command\RemoveAllCommand:
tags:
- name: 'console.command'
command: 'events:removeAll'
Wrm\Events\Command\RemovePastCommand:
tags:
- name: 'console.command'
command: 'events:removePast'
Wrm\Events\Extbase\AddSpecialProperties:
tags:
- name: event.listener
identifier: 'WrmEventsAddSpecialPropertiesToDate'
event: TYPO3\CMS\Extbase\Event\Persistence\AfterObjectThawedEvent

View file

@ -0,0 +1,16 @@
<?php
defined('TYPO3') or die();
(function (string $extKey, string $table) {
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA'][$table], [
'columns' => [
'sorting' => [
'config' => [
// Allow extbase to map this column to model
'type' => 'passthrough',
],
],
],
]);
})('events', 'sys_category');

View file

@ -1,32 +1,16 @@
<?php <?php
defined('TYPO3_MODE') or die(); defined('TYPO3') or die();
call_user_func(function () { call_user_func(function () {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'Wrm.Events',
'Pi1',
'Events Plugin',
'EXT:events/Resources/Public/Icons/user_plugin_events.svg'
);
$pluginSignature = 'events_pi1';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
$pluginSignature,
'FILE:EXT:events/Configuration/FlexForms/Pi1.xml'
);
/* Search Plugin */ /* Search Plugin */
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'Wrm.Events', 'Events',
'DateSearch', 'DateSearch',
'Events: Date Search', 'Events: Date Search',
'EXT:events/Resources/Public/Icons/user_plugin_events.svg' 'EXT:events/Resources/Public/Icons/Extension.svg'
); );
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['events_datesearch'] = 'pi_flexform'; $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['events_datesearch'] = 'pi_flexform';
@ -39,10 +23,10 @@ call_user_func(function () {
/* Date List Plugin */ /* Date List Plugin */
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'Wrm.Events', 'Events',
'DateList', 'DateList',
'Events: Date List', 'Events: Date List',
'EXT:events/Resources/Public/Icons/user_plugin_events.svg' 'EXT:events/Resources/Public/Icons/Extension.svg'
); );
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['events_datelist'] = 'pi_flexform'; $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['events_datelist'] = 'pi_flexform';
@ -55,10 +39,10 @@ call_user_func(function () {
/* Date Show Plugin */ /* Date Show Plugin */
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'Wrm.Events', 'Events',
'DateShow', 'DateShow',
'Events: Date Show', 'Events: Date Show',
'EXT:events/Resources/Public/Icons/user_plugin_events.svg' 'EXT:events/Resources/Public/Icons/Extension.svg'
); );
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['events_dateshow'] = 'pi_flexform'; $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['events_dateshow'] = 'pi_flexform';
@ -69,4 +53,20 @@ call_user_func(function () {
); );
/* Event Selected Plugin */
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'Events',
'Selected',
'Events: Show selected',
'EXT:events/Resources/Public/Icons/Extension.svg'
);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['events_selected'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
'events_selected',
'FILE:EXT:events/Configuration/FlexForms/Selected.xml'
);
}); });

View file

@ -1,16 +1,15 @@
<?php <?php
defined('TYPO3_MODE') or die(); defined('TYPO3') or die();
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable( \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable(
'dd_events', 'events',
'tx_events_domain_model_event', 'tx_events_domain_model_event',
'categories', 'categories',
[ [
'label' => 'Categories', 'label' => 'Categories',
'fieldConfiguration' => [ 'fieldConfiguration' => [
'minitems' => 0, 'minitems' => 0,
'maxitems' => 3,
'multiple' => true, 'multiple' => true,
] ]
] ]

View file

@ -1,8 +1,11 @@
<?php <?php
return [ return [
'ctrl' => [ 'ctrl' => [
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date', 'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date',
'label' => 'start', 'label' => 'start',
'label_alt' => 'end, canceled',
'label_alt_force' => true,
'tstamp' => 'tstamp', 'tstamp' => 'tstamp',
'crdate' => 'crdate', 'crdate' => 'crdate',
'cruser_id' => 'cruser_id', 'cruser_id' => 'cruser_id',
@ -17,13 +20,10 @@ return [
'endtime' => 'endtime', 'endtime' => 'endtime',
], ],
'searchFields' => '', 'searchFields' => '',
'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_date.gif' 'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_date.svg'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, start, end',
], ],
'types' => [ 'types' => [
'1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, start, end, event, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'], '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, start, end, canceled, postponed_date, canceled_link, event, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
], ],
'columns' => [ 'columns' => [
'sys_language_uid' => [ 'sys_language_uid' => [
@ -45,7 +45,6 @@ return [
], ],
'l10n_parent' => [ 'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0', 'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
'config' => [ 'config' => [
'type' => 'select', 'type' => 'select',
@ -140,6 +139,66 @@ return [
'default' => null, 'default' => null,
], ],
], ],
'canceled' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.canceled',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'default' => 'no',
'items' => [
'0' => [
'0' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.canceled.options.no',
'1' => 'no',
],
'1' => [
'0' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.canceled.options.canceled',
'1' => 'canceled',
],
'2' => [
'0' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.canceled.options.postponed',
'1' => 'postponed',
],
],
],
],
'postponed_date' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.postponed_date',
'displayCond' => 'FIELD:canceled:=:postponed',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'tx_events_domain_model_date',
'foreign_table_where' => ' AND {#tx_events_domain_model_date}.{#event} = ###REC_FIELD_event### AND {#tx_events_domain_model_date}.{#uid} != ###THIS_UID###',
'default' => '0',
'items' => [
'0' => [
'0' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.postponed_date.0',
'1' => '0',
],
],
],
],
'canceled_link' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.canceled_link',
'displayCond' => 'FIELD:canceled:=:canceled',
'config' => [
'type' => 'input',
'softref' => 'typolink',
'renderType' => 'inputLink',
'max' => 1024,
'eval' => 'trim',
'fieldControl' => [
'linkPopup' => [
'options' => [
'title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_link_formlabel',
],
],
],
],
],
'event' => array( 'event' => array(
'exclude' => 1, 'exclude' => 1,

View file

@ -1,8 +1,17 @@
<?php <?php
defined('TYPO3_MODE') or die();
$l10nPathGeneral = 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf';
$l10nPathLang = 'LLL:EXT:lang/locallang_core.xlf';
$l10nPathFE = 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf';
$l10nPath = 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf';
return [ return [
'ctrl' => [ 'ctrl' => [
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event', 'title' => $l10nPath . ':tx_events_domain_model_event',
'label' => 'title', 'label' => 'title',
'thumbnail' => 'images',
'tstamp' => 'tstamp', 'tstamp' => 'tstamp',
'crdate' => 'crdate', 'crdate' => 'crdate',
'cruser_id' => 'cruser_id', 'cruser_id' => 'cruser_id',
@ -16,26 +25,69 @@ return [
'starttime' => 'starttime', 'starttime' => 'starttime',
'endtime' => 'endtime', 'endtime' => 'endtime',
], ],
'searchFields' => 'title,global_id,slug,teaser,details,price_info,street,district,city,zip,country,web,booking,ticket,facebook,youtube,latitude,longitude', 'searchFields' => 'title,subtitle,global_id,teaser',
'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_event.gif' 'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_event.svg'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, global_id, slug, highlight, teaser, details, price_info, name, street, district, city, zip, country, phone, web, ticket, facebook, youtube, instagram, latitude, longitude, images, categories, dates, organizer, region',
], ],
'types' => [ 'types' => [
'1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, global_id, slug, highlight, teaser, details, price_info, name, street, district, city, zip, country, phone, web, ticket, facebook, youtube, instagram, latitude, longitude, images, categories, dates, organizer, region, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'], '1' => [
'showitem' => '--palette--;' . $l10nPathFE . ':palette.general;general,
sys_language_uid,
l10n_parent,
l10n_diffsource,
hidden,
highlight,
title,
subtitle,
teaser,
slug,
ticket,
global_id,
--div--;' . $l10nPath . ':tx_events_domain_model_event.tabs.text,
details,
price_info,
--div--;' . $l10nPath . ':tx_events_domain_model_event.tabs.dates,
dates,
--div--;' . $l10nPath . ':tx_events_domain_model_event.tabs.location,
name,
street,
district,
city,
zip,
country,
phone,
web,
latitude,
longitude,
--div--;' . $l10nPath . ':tx_events_domain_model_event.tabs.relations,
organizer,
region,
partner,
categories,
references_events,
pages,
--div--;' . $l10nPath . ':tx_events_domain_model_event.tabs.media,
images,
--div--;' . $l10nPath . ':tx_events_domain_model_event.tabs.social,
facebook,
youtube,
instagram,
--div--;' . $l10nPathFE . ':tabs.access,
starttime,
endtime'
],
], ],
'columns' => [ 'columns' => [
'sys_language_uid' => [ 'sys_language_uid' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', 'label' => $l10nPathGeneral . ':LGL.language',
'config' => [ 'config' => [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'special' => 'languages', 'special' => 'languages',
'items' => [ 'items' => [
[ [
'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', $l10nPathGeneral . ':LGL.allLanguages',
-1, -1,
'flags-multiple' 'flags-multiple'
] ]
@ -45,8 +97,7 @@ return [
], ],
'l10n_parent' => [ 'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0', 'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => true, 'label' => $l10nPathGeneral . ':LGL.l18n_parent',
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
'config' => [ 'config' => [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
@ -64,7 +115,7 @@ return [
], ],
], ],
't3ver_label' => [ 't3ver_label' => [
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel', 'label' => $l10nPathGeneral . ':LGL.versionLabel',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -73,7 +124,7 @@ return [
], ],
'hidden' => [ 'hidden' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', 'label' => $l10nPathGeneral . ':LGL.visible',
'config' => [ 'config' => [
'type' => 'check', 'type' => 'check',
'renderType' => 'checkboxToggle', 'renderType' => 'checkboxToggle',
@ -88,7 +139,7 @@ return [
], ],
'starttime' => [ 'starttime' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 'label' => $l10nPathGeneral . ':LGL.starttime',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'renderType' => 'inputDateTime', 'renderType' => 'inputDateTime',
@ -101,7 +152,7 @@ return [
], ],
'endtime' => [ 'endtime' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 'label' => $l10nPathGeneral . ':LGL.endtime',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'renderType' => 'inputDateTime', 'renderType' => 'inputDateTime',
@ -118,16 +169,27 @@ return [
'title' => [ 'title' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.title', 'label' => $l10nPath . ':tx_events_domain_model_event.title',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'text',
'size' => 30, 'cols' => 40,
'rows' => 2,
'eval' => 'trim'
]
],
'subtitle' => [
'exclude' => true,
'label' => $l10nPath . ':tx_events_domain_model_event.subtitle',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 2,
'eval' => 'trim' 'eval' => 'trim'
] ]
], ],
'global_id' => [ 'global_id' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.global_id', 'label' => $l10nPath . ':tx_events_domain_model_event.global_id',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -136,7 +198,7 @@ return [
], ],
'slug' => [ 'slug' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.slug', 'label' => $l10nPath . ':tx_events_domain_model_event.slug',
'config' => [ 'config' => [
'type' => 'slug', 'type' => 'slug',
'size' => 50, 'size' => 50,
@ -152,12 +214,12 @@ return [
], ],
'highlight' => [ 'highlight' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.highlight', 'label' => $l10nPath . ':tx_events_domain_model_event.highlight',
'config' => [ 'config' => [
'type' => 'check', 'type' => 'check',
'items' => [ 'items' => [
'1' => [ '1' => [
'0' => 'LLL:EXT:lang/locallang_core.xlf:labels.enabled' '0' => $l10nPathLang . ':labels.enabled'
] ]
], ],
'default' => 0, 'default' => 0,
@ -165,21 +227,21 @@ return [
], ],
'teaser' => [ 'teaser' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.teaser', 'label' => $l10nPath . ':tx_events_domain_model_event.teaser',
'config' => [ 'config' => [
'type' => 'text', 'type' => 'text',
'cols' => 40, 'cols' => 30,
'rows' => 15, 'rows' => 5,
'eval' => 'trim' 'eval' => 'trim'
] ]
], ],
'details' => [ 'details' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.details', 'label' => $l10nPath . ':tx_events_domain_model_event.details',
'config' => [ 'config' => [
'type' => 'text', 'type' => 'text',
'enableRichtext' => true, 'enableRichtext' => true,
'richtextConfiguration' => 'default', 'richtextConfiguration' => 'Default',
'fieldControl' => [ 'fieldControl' => [
'fullScreenRichtext' => [ 'fullScreenRichtext' => [
'disabled' => false, 'disabled' => false,
@ -193,7 +255,7 @@ return [
], ],
'price_info' => [ 'price_info' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.price_info', 'label' => $l10nPath . ':tx_events_domain_model_event.price_info',
'config' => [ 'config' => [
'type' => 'text', 'type' => 'text',
'cols' => 40, 'cols' => 40,
@ -203,7 +265,7 @@ return [
], ],
'name' => [ 'name' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.name', 'label' => $l10nPath . ':tx_events_domain_model_event.name',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -212,7 +274,7 @@ return [
], ],
'street' => [ 'street' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.street', 'label' => $l10nPath . ':tx_events_domain_model_event.street',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -221,7 +283,7 @@ return [
], ],
'district' => [ 'district' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.district', 'label' => $l10nPath . ':tx_events_domain_model_event.district',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -230,7 +292,7 @@ return [
], ],
'city' => [ 'city' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.city', 'label' => $l10nPath . ':tx_events_domain_model_event.city',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -239,7 +301,7 @@ return [
], ],
'zip' => [ 'zip' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.zip', 'label' => $l10nPath . ':tx_events_domain_model_event.zip',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -248,7 +310,7 @@ return [
], ],
'country' => [ 'country' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.country', 'label' => $l10nPath . ':tx_events_domain_model_event.country',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -257,7 +319,7 @@ return [
], ],
'phone' => [ 'phone' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.phone', 'label' => $l10nPath . ':tx_events_domain_model_event.phone',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -266,7 +328,7 @@ return [
], ],
'web' => [ 'web' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.web', 'label' => $l10nPath . ':tx_events_domain_model_event.web',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -275,16 +337,19 @@ return [
], ],
'ticket' => [ 'ticket' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.ticket', 'label' => $l10nPath . ':tx_events_domain_model_event.ticket',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'renderType' => 'inputLink',
'eval' => 'trim' 'eval' => 'trim',
'max' => 1024,
'size' => 50,
'softref' => 'typolink',
], ],
], ],
'facebook' => [ 'facebook' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.facebook', 'label' => $l10nPath . ':tx_events_domain_model_event.facebook',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -293,7 +358,7 @@ return [
], ],
'youtube' => [ 'youtube' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.youtube', 'label' => $l10nPath . ':tx_events_domain_model_event.youtube',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -302,7 +367,7 @@ return [
], ],
'instagram' => [ 'instagram' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.instagram', 'label' => $l10nPath . ':tx_events_domain_model_event.instagram',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -311,7 +376,7 @@ return [
], ],
'latitude' => [ 'latitude' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.latitude', 'label' => $l10nPath . ':tx_events_domain_model_event.latitude',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -320,7 +385,7 @@ return [
], ],
'longitude' => [ 'longitude' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.longitude', 'label' => $l10nPath . ':tx_events_domain_model_event.longitude',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
@ -329,12 +394,12 @@ return [
], ],
'images' => [ 'images' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.images', 'label' => $l10nPath . ':tx_events_domain_model_event.images',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'images', 'images',
[ [
'appearance' => [ 'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference', 'createNewRelationLinkTitle' => $l10nPathFE . ':images.addFileReference',
'showPossibleLocalizationRecords' => true, 'showPossibleLocalizationRecords' => true,
'showRemovedLocalizationRecords' => true, 'showRemovedLocalizationRecords' => true,
'showAllLocalizationLink' => true, 'showAllLocalizationLink' => true,
@ -348,44 +413,54 @@ return [
'foreign_types' => [ 'foreign_types' => [
'0' => [ '0' => [
'showitem' => ' 'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, --palette--;' . $l10nPathFE . ':sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette' --palette--;;filePalette'
], ],
\TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
'showitem' => ' 'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, --palette--;' . $l10nPathFE . ':sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette' --palette--;;filePalette'
], ],
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => ' 'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, --palette--;' . $l10nPathFE . ':sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette' --palette--;;filePalette'
], ],
\TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
'showitem' => ' 'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, --palette--;' . $l10nPathFE . ':sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette' --palette--;;filePalette'
], ],
\TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
'showitem' => ' 'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, --palette--;' . $l10nPathFE . ':sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette' --palette--;;filePalette'
], ],
\TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
'showitem' => ' 'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, --palette--;' . $l10nPathFE . ':sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette' --palette--;;filePalette'
] ]
], ],
'maxitems' => 1 'maxitems' => 8
], ],
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
), ),
], ],
'pages' => [
'exclude' => true,
'label' => $l10nPath . ':tx_events_domain_model_event.pages',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'pages',
],
],
'categories' => [ 'categories' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.categories', 'label' => $l10nPath . ':tx_events_domain_model_event.categories',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 4, 'size' => 4,
@ -395,7 +470,7 @@ return [
'dates' => [ 'dates' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.dates', 'label' => $l10nPath . ':tx_events_domain_model_event.dates',
'config' => [ 'config' => [
'type' => 'inline', 'type' => 'inline',
'foreign_table' => 'tx_events_domain_model_date', 'foreign_table' => 'tx_events_domain_model_date',
@ -411,7 +486,7 @@ return [
'dragdrop' => false, 'dragdrop' => false,
'sort' => false, 'sort' => false,
'hide' => false, 'hide' => false,
'delete' => false, 'delete' => true,
'localize' => false, 'localize' => false,
), ),
'levelLinksPosition' => 'top', 'levelLinksPosition' => 'top',
@ -427,26 +502,59 @@ return [
'organizer' => [ 'organizer' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.organizer', 'label' => $l10nPath . ':tx_events_domain_model_event.organizer',
'config' => [ 'config' => [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'foreign_table' => 'tx_events_domain_model_organizer', 'foreign_table' => 'tx_events_domain_model_organizer',
'default' => 0,
'minitems' => 0, 'minitems' => 0,
'maxitems' => 1, 'maxitems' => 1,
], ],
], ],
'region' => [ 'region' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event.region', 'label' => $l10nPath . ':tx_events_domain_model_event.region',
'config' => [ 'config' => [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'foreign_table' => 'tx_events_domain_model_region', 'foreign_table' => 'tx_events_domain_model_region',
'default' => 0,
'minitems' => 0, 'minitems' => 0,
'maxitems' => 1, 'maxitems' => 1,
], ],
], ],
'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',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'tx_events_domain_model_partner',
'fieldControl' => [
'addRecord' => [
'disabled' => false,
'pid' => '###CURRENT_PID###',
'table' => 'tx_events_domain_model_partner',
],
],
],
],
], ],
]; ];

View file

@ -17,10 +17,7 @@ return [
'endtime' => 'endtime', 'endtime' => 'endtime',
], ],
'searchFields' => 'name,street,district,city,zip,phone,web,email', 'searchFields' => 'name,street,district,city,zip,phone,web,email',
'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_organizer.gif' 'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_organizer.svg'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, street, district, city, zip, phone, web, email',
], ],
'types' => [ 'types' => [
'1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, street, district, city, zip, phone, web, email, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'], '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, street, district, city, zip, phone, web, email, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
@ -45,7 +42,6 @@ return [
], ],
'l10n_parent' => [ 'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0', 'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
'config' => [ 'config' => [
'type' => 'select', 'type' => 'select',

View file

@ -0,0 +1,133 @@
<?php
return [
'ctrl' => [
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_partner.xlf:tx_events_domain_model_partner',
'label' => 'title',
'thumbnail' => 'images',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'versioningWS' => true,
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'transOrigDiffSourceField' => 'l10n_diffsource',
'delete' => 'deleted',
'enablecolumns' => [
'disabled' => 'hidden',
],
'searchFields' => 'title',
'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_partner.svg'
],
'types' => [
'1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, link, images, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access'],
],
'columns' => [
'sys_language_uid' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'special' => 'languages',
'items' => [
[
'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages',
-1,
'flags-multiple'
]
],
'default' => 0,
],
],
'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0',
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'default' => 0,
'items' => [
['', 0],
],
'foreign_table' => 'tx_events_domain_model_partner',
'foreign_table_where' => 'AND {#tx_events_domain_model_partner}.{#pid}=###CURRENT_PID### AND {#tx_events_domain_model_partner}.{#sys_language_uid} IN (-1,0)',
],
],
'l10n_diffsource' => [
'config' => [
'type' => 'passthrough',
],
],
't3ver_label' => [
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel',
'config' => [
'type' => 'input',
'size' => 30,
'max' => 255,
],
],
'hidden' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible',
'config' => [
'type' => 'check',
'renderType' => 'checkboxToggle',
'items' => [
[
0 => '',
1 => '',
'invertStateDisplay' => true
]
],
],
],
'title' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_partner.xlf:tx_events_domain_model_partner.title',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
]
],
'link' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_partner.xlf:tx_events_domain_model_partner.link',
'config' => [
'type' => 'input',
'renderType' => 'inputLink',
'eval' => 'trim',
'max' => 1024,
'size' => 50,
'softref' => 'typolink',
],
],
'images' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_partner.xlf:tx_events_domain_model_partner.images',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('images', [
'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
],
// custom configuration for displaying fields in the overlay/reference table
// to use the imageoverlayPalette instead of the basicoverlayPalette
'overrideChildTca' => [
'types' => [
'0' => [
'showitem' => '
--palette--;;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '
--palette--;;imageoverlayPalette,
--palette--;;filePalette'
],
],
],
], $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'])
],
],
];

View file

@ -17,10 +17,7 @@ return [
'endtime' => 'endtime', 'endtime' => 'endtime',
], ],
'searchFields' => 'title', 'searchFields' => 'title',
'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_region.gif' 'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_region.svg'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title',
], ],
'types' => [ 'types' => [
'1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'], '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
@ -45,7 +42,6 @@ return [
], ],
'l10n_parent' => [ 'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0', 'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
'config' => [ 'config' => [
'type' => 'select', 'type' => 'select',

View file

@ -56,6 +56,21 @@ plugin.tx_events {
categoriesPid = {$plugin.tx_events.settings.destinationData.categoriesPid} categoriesPid = {$plugin.tx_events.settings.destinationData.categoriesPid}
categoryParentUid = {$plugin.tx_events.settings.destinationData.categoryParentUid} categoryParentUid = {$plugin.tx_events.settings.destinationData.categoryParentUid}
} }
dataProcessing {
Wrm\Events\Domain\Model\Event {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 {
special = list
special.value.field = pages
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 {
references.fieldName = media
}
}
}
}
}
} }
} }

View file

@ -1,24 +1,52 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0"> <xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events"> <file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
<header/> <header/>
<body> <body>
<trans-unit id="tx_events_domain_model_date"> <trans-unit id="tx_events_domain_model_date">
<source>Date</source> <source>Date</source>
<target>Termin</target> <target>Termin</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_date.start"> <trans-unit id="tx_events_domain_model_date.start">
<source>Start</source> <source>Start</source>
<target>Beginn</target> <target>Beginn</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_date.end"> <trans-unit id="tx_events_domain_model_date.end">
<source>End</source> <source>End</source>
<target>Ende</target> <target>Ende</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_date.event"> <trans-unit id="tx_events_domain_model_date.canceled">
<source>Associated event</source> <source>Canceled or postponed?</source>
<target>Verknüpfte Veranstaltungen</target> <target>Abgesagt oder verschoben?</target>
</trans-unit> </trans-unit>
</body> <trans-unit id="tx_events_domain_model_date.canceled.options.no">
</file> <source>No</source>
<target>Nein</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.canceled.options.canceled">
<source>Canceled</source>
<target>Abgesagt</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.canceled.options.postponed">
<source>Postponed</source>
<target>Verschoben</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.canceled.options.postponed_date">
<source>Postponed date</source>
<target>Verschoben auf folgendes Datum</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.canceled.options.postponed_date.0">
<source>Not defined</source>
<target>Noch nicht definiert</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.options.canceled_link">
<source>Link regarding cancellation</source>
<target>Link bezüglich Absage</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.event">
<source>Associated event</source>
<target>Verknüpfte Veranstaltungen</target>
</trans-unit>
</body>
</file>
</xliff> </xliff>

View file

@ -1,128 +1,168 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0"> <xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events"> <file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
<header/> <header/>
<body> <body>
<trans-unit id="tx_events.name"> <trans-unit id="tx_events.name">
<source>Events</source> <source>Events</source>
<target>Veranstaltungen</target> <target>Veranstaltungen</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events.description"> <trans-unit id="tx_events.description">
<source>Event Modul</source> <source>Event Modul</source>
<target>Veranstaltungs Modul</target> <target>Veranstaltungs Modul</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event"> <trans-unit id="tx_events_domain_model_event.tabs.text">
<source>Event</source> <source>Text</source>
<target>Veranstaltung</target> <target>Texte</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.title"> <trans-unit id="tx_events_domain_model_event.tabs.dates">
<source>Title</source> <source>Dates</source>
<target>Titel</target> <target>Termine</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.global_id"> <trans-unit id="tx_events_domain_model_event.tabs.location">
<source>Global UID</source> <source>Location</source>
<target>Globale UID</target> <target>Veranstaltungsort</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.slug"> <trans-unit id="tx_events_domain_model_event.tabs.relations">
<source>Slug</source> <source>Relations</source>
<target>URL-Segment</target> <target>Relationen</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.highlight"> <trans-unit id="tx_events_domain_model_event.tabs.media">
<source>Highlight</source> <source>Media</source>
<target>Höhepunkt</target> <target>Medien</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.teaser"> <trans-unit id="tx_events_domain_model_event.tabs.social">
<source>Teaser</source> <source>Social Media</source>
<target>Kurztext</target> <target>Social Media</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.details"> <trans-unit id="tx_events_domain_model_event">
<source>Details</source> <source>Event</source>
<target>Text</target> <target>Veranstaltung</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.price_info"> <trans-unit id="tx_events_domain_model_event.title">
<source>Price Info</source> <source>Title</source>
<target>Preis Information</target> <target>Titel</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.name"> <trans-unit id="tx_events_domain_model_event.subtitle">
<source>Name</source> <source>Subtitle</source>
<target>Name</target> <target>Untertitel</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.street"> <trans-unit id="tx_events_domain_model_event.global_id">
<source>Street</source> <source>Global UID</source>
<target>Straße</target> <target>Globale UID</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.district"> <trans-unit id="tx_events_domain_model_event.slug">
<source>District</source> <source>Slug</source>
<target>Bundesland</target> <target>URL-Segment</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.city"> <trans-unit id="tx_events_domain_model_event.highlight">
<source>City</source> <source>Highlight</source>
<target>Stadt</target> <target>Höhepunkt</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.zip"> <trans-unit id="tx_events_domain_model_event.teaser">
<source>Zip</source> <source>Teaser</source>
<target>Postleitzahl</target> <target>Kurztext</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.country"> <trans-unit id="tx_events_domain_model_event.details">
<source>Country</source> <source>Details</source>
<target>Land</target> <target>Text</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.web"> <trans-unit id="tx_events_domain_model_event.price_info">
<source>Web</source> <source>Price Info</source>
<target>Internet</target> <target>Preis Information</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.phone"> <trans-unit id="tx_events_domain_model_event.name">
<source>Phone</source> <source>Name</source>
<target>Telefon</target> <target>Name</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.ticket"> <trans-unit id="tx_events_domain_model_event.street">
<source>Ticket</source> <source>Street</source>
<target>Ticket</target> <target>Straße</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.facebook"> <trans-unit id="tx_events_domain_model_event.district">
<source>Facebook</source> <source>District</source>
<target>Facebook</target> <target>Bundesland</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.youtube"> <trans-unit id="tx_events_domain_model_event.city">
<source>YouTube</source> <source>City</source>
<target>YouTube</target> <target>Stadt</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.instagram"> <trans-unit id="tx_events_domain_model_event.zip">
<source>Instagram</source> <source>Zip</source>
<target>Instagram</target> <target>Postleitzahl</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.latitude"> <trans-unit id="tx_events_domain_model_event.country">
<source>Latitude</source> <source>Country</source>
<target>Breitengrad</target> <target>Land</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.longitude"> <trans-unit id="tx_events_domain_model_event.web">
<source>Longitude</source> <source>Web</source>
<target>Längengrad</target> <target>Internet</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.images"> <trans-unit id="tx_events_domain_model_event.phone">
<source>Images</source> <source>Phone</source>
<target>Bilder</target> <target>Telefon</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.categories"> <trans-unit id="tx_events_domain_model_event.ticket">
<source>Categories</source> <source>Ticket</source>
<target>Kategorien</target> <target>Ticket</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.dates"> <trans-unit id="tx_events_domain_model_event.facebook">
<source>Dates</source> <source>Facebook</source>
<target>Termine</target> <target>Facebook</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.organizer"> <trans-unit id="tx_events_domain_model_event.youtube">
<source>Organizer</source> <source>YouTube</source>
<target>Organisator</target> <target>YouTube</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.region"> <trans-unit id="tx_events_domain_model_event.instagram">
<source>Region</source> <source>Instagram</source>
<target>Region</target> <target>Instagram</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_organizer"> <trans-unit id="tx_events_domain_model_event.latitude">
<source>Organizer</source> <source>Latitude</source>
<target>Organisator</target> <target>Breitengrad</target>
</trans-unit> </trans-unit>
</body> <trans-unit id="tx_events_domain_model_event.longitude">
</file> <source>Longitude</source>
<target>Längengrad</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.images">
<source>Images</source>
<target>Bilder</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.pages">
<source>Pages</source>
<target>Seiten</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.categories">
<source>Categories</source>
<target>Kategorien</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.dates">
<source>Dates</source>
<target>Termine</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.organizer">
<source>Organizer</source>
<target>Organisator</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.region">
<source>Region</source>
<target>Region</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer">
<source>Organizer</source>
<target>Organisator</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.partner">
<source>Partner</source>
<target>Partner</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.references_events">
<source>Related Events</source>
<target>Ähnliche Veranstaltungen</target>
</trans-unit>
</body>
</file>
</xliff> </xliff>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
<header/>
<body>
<trans-unit id="tx_events_domain_model_partner">
<source>Partner</source>
<target>Partner</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_partner.title">
<source>Title</source>
<target>Titel</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_partner.link">
<source>Link</source>
<target>Link</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_partner.images">
<source>Images</source>
<target>Bilder</target>
</trans-unit>
</body>
</file>
</xliff>

View file

@ -1,16 +1,20 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0"> <xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events"> <file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
<header/> <header/>
<body> <body>
<trans-unit id="tx_events.name"> <trans-unit id="tx_events.name">
<source>Events</source> <source>Events</source>
<target>Veranstaltungen</target> <target>Veranstaltungen</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events.description"> <trans-unit id="tx_events.description">
<source>Event Modul</source> <source>Event Modul</source>
<target>Veranstaltungs Modul</target> <target>Veranstaltungs Modul</target>
</trans-unit> </trans-unit>
</body> <trans-unit id="tx_events.flexform.selected.selectedRecords">
</file> <source>Records to show</source>
<target>Anzuzeigende Veranstaltungen</target>
</trans-unit>
</body>
</file>
</xliff> </xliff>

View file

@ -1,20 +1,41 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0"> <xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events"> <file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
<header/> <header/>
<body> <body>
<trans-unit id="tx_events_domain_model_date"> <trans-unit id="tx_events_domain_model_date">
<source>Date</source> <source>Date</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_date.start"> <trans-unit id="tx_events_domain_model_date.start">
<source>Start</source> <source>Start</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_date.end"> <trans-unit id="tx_events_domain_model_date.end">
<source>End</source> <source>End</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_date.event"> <trans-unit id="tx_events_domain_model_date.canceled">
<source>Associated event</source> <source>Canceled or postponed?</source>
</trans-unit> </trans-unit>
</body> <trans-unit id="tx_events_domain_model_date.canceled.options.no">
</file> <source>No</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.canceled.options.canceled">
<source>Canceled</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.canceled.options.postponed">
<source>Postponed</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.canceled.options.postponed_date">
<source>Postponed date</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.canceled.options.postponed_date.0">
<source>Not defined</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.canceled_link">
<source>Link regarding cancellation</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.event">
<source>Associated event</source>
</trans-unit>
</body>
</file>
</xliff> </xliff>

View file

@ -1,95 +1,125 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0"> <xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events"> <file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
<header/> <header/>
<body> <body>
<trans-unit id="tx_events.name"> <trans-unit id="tx_events.name">
<source>Events</source> <source>Events</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events.description"> <trans-unit id="tx_events.description">
<source>Event Modul</source> <source>Event Modul</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event"> <trans-unit id="tx_events_domain_model_event">
<source>Event</source> <source>Event</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.title"> <trans-unit id="tx_events_domain_model_event.tabs.text">
<source>Title</source> <source>Text</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.global_id"> <trans-unit id="tx_events_domain_model_event.tabs.dates">
<source>Global UID</source> <source>Dates</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.slug"> <trans-unit id="tx_events_domain_model_event.tabs.location">
<source>Slug</source> <source>Location</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.highlight"> <trans-unit id="tx_events_domain_model_event.tabs.relations">
<source>Highlight</source> <source>Relations</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.teaser"> <trans-unit id="tx_events_domain_model_event.tabs.media">
<source>Teaser</source> <source>Media</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.details"> <trans-unit id="tx_events_domain_model_event.tabs.social">
<source>Details</source> <source>Social Media</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.price_info"> <trans-unit id="tx_events_domain_model_event.title">
<source>Price Info</source> <source>Title</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.name"> <trans-unit id="tx_events_domain_model_event.subtitle">
<source>Name</source> <source>Subtitle</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.street"> <trans-unit id="tx_events_domain_model_event.global_id">
<source>Street</source> <source>Global UID</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.district"> <trans-unit id="tx_events_domain_model_event.slug">
<source>District</source> <source>Slug</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.city"> <trans-unit id="tx_events_domain_model_event.highlight">
<source>City</source> <source>Highlight</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.zip"> <trans-unit id="tx_events_domain_model_event.teaser">
<source>Zip</source> <source>Teaser</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.country"> <trans-unit id="tx_events_domain_model_event.details">
<source>Country</source> <source>Details</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.web"> <trans-unit id="tx_events_domain_model_event.price_info">
<source>Web</source> <source>Price Info</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.phone"> <trans-unit id="tx_events_domain_model_event.name">
<source>Phone</source> <source>Name</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.ticket"> <trans-unit id="tx_events_domain_model_event.street">
<source>Ticket</source> <source>Street</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.facebook"> <trans-unit id="tx_events_domain_model_event.district">
<source>Facebook</source> <source>District</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.youtube"> <trans-unit id="tx_events_domain_model_event.city">
<source>Youtube</source> <source>City</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.instagram"> <trans-unit id="tx_events_domain_model_event.zip">
<source>Instagram</source> <source>Zip</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.latitude"> <trans-unit id="tx_events_domain_model_event.country">
<source>Latitude</source> <source>Country</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.longitude"> <trans-unit id="tx_events_domain_model_event.web">
<source>Longitude</source> <source>Web</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.images"> <trans-unit id="tx_events_domain_model_event.phone">
<source>Images</source> <source>Phone</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.categories"> <trans-unit id="tx_events_domain_model_event.ticket">
<source>Categories</source> <source>Ticket</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.dates"> <trans-unit id="tx_events_domain_model_event.facebook">
<source>Dates</source> <source>Facebook</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.organizer"> <trans-unit id="tx_events_domain_model_event.youtube">
<source>Organizer</source> <source>Youtube</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.region"> <trans-unit id="tx_events_domain_model_event.instagram">
<source>Region</source> <source>Instagram</source>
</trans-unit> </trans-unit>
</body> <trans-unit id="tx_events_domain_model_event.latitude">
</file> <source>Latitude</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.longitude">
<source>Longitude</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.images">
<source>Images</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.pages">
<source>Pages</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.categories">
<source>Categories</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.dates">
<source>Dates</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.organizer">
<source>Organizer</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.region">
<source>Region</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.partner">
<source>Partner</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.references_events">
<source>Related Events</source>
</trans-unit>
</body>
</file>
</xliff> </xliff>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
<header/>
<body>
<trans-unit id="tx_events_domain_model_partner">
<source>Partner</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_partner.title">
<source>Title</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_partner.link">
<source>Link</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_partner.images">
<source>Images</source>
</trans-unit>
</body>
</file>
</xliff>

View file

@ -1,14 +1,17 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0"> <xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events"> <file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
<header/> <header/>
<body> <body>
<trans-unit id="tx_events.name"> <trans-unit id="tx_events.name">
<source>Events</source> <source>Events</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events.description"> <trans-unit id="tx_events.description">
<source>Event Modul</source> <source>Event Modul</source>
</trans-unit> </trans-unit>
</body> <trans-unit id="tx_events.flexform.selected.selectedRecords">
</file> <source>Records to show</source>
</trans-unit>
</body>
</file>
</xliff> </xliff>

View file

@ -3,10 +3,10 @@
<f:for each="{dates}" as="date"> <f:for each="{dates}" as="date">
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-4"> <div class="col-sm-12 col-md-6 col-lg-4 col-xl-4">
<div class="menu-tile"> <div class="menu-tile">
<f:if condition="{date.event.images}"> <f:if condition="{date.event.images.0}">
<f:then> <f:then>
<f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}"> <f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}">
<f:image src="{date.event.images.originalResource.originalFile.uid}" alt="{date.event.title}" title="{date.event.title}" width="480c" height="320c" class="img-fluid img-thumbnail"/> <f:image image="{date.event.images.0}" alt="{date.event.title}" title="{date.event.title}" width="480c" height="320c" class="img-fluid img-thumbnail"/>
</f:link.action> </f:link.action>
</f:then> </f:then>
<f:else> <f:else>

View file

@ -1,7 +1,7 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true"> <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:widget.paginate objects="{dates}" as="paginatedDates" configuration="{itemsPerPage: 25, insertAbove: 0, insertBelow: 1, maximumNumberOfLinks: 5, addQueryStringMethod: 'POST,GET'}"> <f:widget.paginate objects="{dates}" as="paginatedDates" configuration="{itemsPerPage: 25, insertAbove: 0, insertBelow: 1, maximumNumberOfLinks: 5, addQueryStringMethod: 'GET'}">
<f:for each="{paginatedDates}" as="date" iteration="index"> <f:for each="{paginatedDates}" as="date" iteration="index">
<div class="row mt-3 mb-3 pb-3"> <div class="row mt-3 mb-3 pb-3">
<div class="col-2"> <div class="col-2">
@ -30,10 +30,10 @@
<f:format.crop maxCharacters="150">{date.event.details}</f:format.crop> <f:format.crop maxCharacters="150">{date.event.details}</f:format.crop>
</div> </div>
<div class="col-4"> <div class="col-4">
<f:if condition="{date.event.images}"> <f:if condition="{date.event.images.0}">
<f:then> <f:then>
<f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}"> <f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}">
<f:image src="{date.event.images.originalResource.originalFile.uid}" alt="" width="400c" height="280c" class="img-fluid img-thumbnail"/> <f:image image="{date.event.images.0}" alt="" width="400c" height="280c" class="img-fluid img-thumbnail"/>
</f:link.action> </f:link.action>
</f:then> </f:then>
<f:else> <f:else>

View file

@ -3,9 +3,9 @@
<f:section name="content"> <f:section name="content">
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<f:if condition="{date.event.images}"> <f:if condition="{date.event.images.0}">
<f:then> <f:then>
<f:image src="{date.event.images.originalResource.originalFile.uid}" alt="" width="480c" height="320c" class="img-fluid img-thumbnail"/> <f:image image="{date.event.images.0}" alt="" width="480c" height="320c" class="img-fluid img-thumbnail"/>
</f:then> </f:then>
<f:else> <f:else>
<img src="{settings.defaultImagePath}" alt="Dummy" width="480c" height="320c" class="img-fluid img-thumbnail"/> <img src="{settings.defaultImagePath}" alt="Dummy" width="480c" height="320c" class="img-fluid img-thumbnail"/>
@ -21,8 +21,6 @@
<h2>{date.event.title}</h2> <h2>{date.event.title}</h2>
<h3>{date.event.teaser}</h3> <h3>{date.event.teaser}</h3>
<f:format.html>{date.event.details}</f:format.html> <f:format.html>{date.event.details}</f:format.html>
<p>{event.price_info}</p>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -51,6 +49,7 @@
</div> </div>
<div class="col-4"> <div class="col-4">
<p><b>Veranstaltungsort:</b><br> <p><b>Veranstaltungsort:</b><br>
{date.event.name}<br>
{date.event.street}<br> {date.event.street}<br>
{date.event.zip} {date.event.city}<br> {date.event.zip} {date.event.city}<br>
{date.event.phone}<br> {date.event.phone}<br>

View file

@ -10,10 +10,10 @@
--> -->
</f:comment> </f:comment>
<div class="menu-tile"> <div class="menu-tile">
<f:if condition="{date.event.images}"> <f:if condition="{date.event.images.0}">
<f:then> <f:then>
<f:link.action pageUid="{settings.showPID}" action="show" controller="Event" arguments="{event: event}"> <f:link.action pageUid="{settings.showPID}" action="show" controller="Event" arguments="{event: event}">
<f:image src="{date.event.images.originalResource.originalFile.uid}" alt="{date.event.title}" title="{date.event.title}" width="480c" height="320c" class="img-fluid img-thumbnail"/> <f:image image="{date.event.images.0}" alt="{date.event.title}" title="{date.event.title}" width="480c" height="320c" class="img-fluid img-thumbnail"/>
</f:link.action> </f:link.action>
</f:then> </f:then>
<f:else> <f:else>

View file

@ -6,10 +6,10 @@
<f:for each="{events}" as="event"> <f:for each="{events}" as="event">
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-4"> <div class="col-sm-12 col-md-6 col-lg-4 col-xl-4">
<div class="menu-tile"> <div class="menu-tile">
<f:if condition="{event.images}"> <f:if condition="{event.images.0}">
<f:then> <f:then>
<f:link.action pageUid="{settings.showPID}" action="show" controller="Event" arguments="{event: event}"> <f:link.action pageUid="{settings.showPID}" action="show" controller="Event" arguments="{event: event}">
<f:image src="{event.images.originalResource.originalFile.uid}" alt="{date.event.title}" title="{date.event.title}" width="480c" height="320c" class="img-fluid img-thumbnail"/> <f:image image="{event.images.0}" alt="{date.event.title}" title="{date.event.title}" width="480c" height="320c" class="img-fluid img-thumbnail"/>
</f:link.action> </f:link.action>
</f:then> </f:then>
<f:else> <f:else>

View file

@ -4,10 +4,10 @@
<f:for each="{events}" as="event"> <f:for each="{events}" as="event">
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-4"> <div class="col-sm-12 col-md-6 col-lg-4 col-xl-4">
<div class="menu-tile"> <div class="menu-tile">
<f:if condition="{event.images}"> <f:if condition="{event.images.0}">
<f:then> <f:then>
<f:link.action pageUid="{settings.showPID}" action="show" controller="Event" arguments="{event: event}"> <f:link.action pageUid="{settings.showPID}" action="show" controller="Event" arguments="{event: event}">
<f:image src="{event.images.originalResource.originalFile.uid}" alt="" width="480c" height="320c" class="img-fluid img-thumbnail"/> <f:image image="{event.images.0}" alt="" width="480c" height="320c" class="img-fluid img-thumbnail"/>
</f:link.action> </f:link.action>
</f:then> </f:then>
<f:else> <f:else>

View file

@ -3,10 +3,10 @@
<f:section name="content"> <f:section name="content">
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<f:if condition="{event.images}"> <f:if condition="{event.images.0}">
<f:then> <f:then>
<f:link.action pageUid="{settings.showPID}" action="show" controller="Event" arguments="{event: event}"> <f:link.action pageUid="{settings.showPID}" action="show" controller="Event" arguments="{event: event}">
<f:image src="{event.images.originalResource.originalFile.uid}" alt="" width="480c" height="320c" class="img-fluid img-thumbnail"/> <f:image image="{event.images.0}" alt="" width="480c" height="320c" class="img-fluid img-thumbnail"/>
</f:link.action> </f:link.action>
</f:then> </f:then>
<f:else> <f:else>

View file

@ -6,10 +6,10 @@
<f:for each="{events}" as="event"> <f:for each="{events}" as="event">
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-4"> <div class="col-sm-12 col-md-6 col-lg-4 col-xl-4">
<div class="menu-tile"> <div class="menu-tile">
<f:if condition="{event.images}"> <f:if condition="{event.images.0}">
<f:then> <f:then>
<f:link.action pageUid="{settings.showPID}" action="show" controller="Event" arguments="{event: event}"> <f:link.action pageUid="{settings.showPID}" action="show" controller="Event" arguments="{event: event}">
<f:image src="{event.images.originalResource.originalFile.uid}" alt="{date.event.title}" title="{date.event.title}" width="480c" height="320c" class="img-fluid img-thumbnail"/> <f:image image="{event.images.0}" alt="{date.event.title}" title="{date.event.title}" width="480c" height="320c" class="img-fluid img-thumbnail"/>
</f:link.action> </f:link.action>
</f:then> </f:then>
<f:else> <f:else>

View file

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 83.1 84.17"><title>Extension</title><path d="M106.07,100.13a11.56,11.56,0,0,1-3.55.51c-10.69,0-26.39-37.36-26.39-49.79,0-4.58,1.08-6.1,2.61-7.42C65.67,45,50,49.75,44.95,55.86a12.21,12.21,0,0,0-1.74,7c0,19.41,20.72,63.45,35.33,63.45,6.76,0,18.16-11.11,27.54-26.17" transform="translate(-43.2 -42.12)" style="fill:#ff8700"/><path d="M99.25,42.12c13.52,0,27,2.18,27,9.81,0,15.48-9.82,34.25-14.83,34.25-8.94,0-20.07-24.87-20.07-37.3,0-5.67,2.18-6.76,7.85-6.76" transform="translate(-43.2 -42.12)" style="fill:#ff8700"/></svg> <svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><rect width="16" height="16" fill="#f18519"/><polygon points="9.348 13.939 7.736 13.348 6.403 12.431 4.837 12.323 3.438 11.883 6.98 1.703 8.072 2.083 9.475 3.241 11.293 3.203 12.89 3.759 9.348 13.939" fill="#fff"/><line x1="5.56817" y1="9.89512" x2="6.60766" y2="10.25681" fill="#f18519" stroke="#f18519" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.5"/><line x1="7.75059" y1="10.65449" x2="8.76597" y2="11.00779" fill="#f18519" stroke="#f18519" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.5"/><path d="M8.42341,1.942,6.73947,1.3561l-3.725,10.70565,1.81686.63217A1.61336,1.61336,0,0,1,7.424,13.596l1.98114.68933,3.725-10.70565-2.01139-.69985A1.59583,1.59583,0,0,1,8.42341,1.942Z" fill="none" stroke="#fff" stroke-miterlimit="10" stroke-width="0.75"/><line x1="9.76625" y1="11.35583" x2="10.66971" y2="11.67018" fill="#f18519" stroke="#f18519" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.5"/><line x1="3.63513" y1="9.22253" x2="4.5725" y2="9.54869" fill="#f18519" stroke="#f18519" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.5"/></svg>

Before

Width:  |  Height:  |  Size: 574 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

View file

@ -0,0 +1 @@
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M8,.63544A7.31924,7.31924,0,0,0,.63544,8,7.31924,7.31924,0,0,0,8,15.36456,7.31924,7.31924,0,0,0,15.36456,8,7.31924,7.31924,0,0,0,8,.63544Z" fill="#fff" stroke="#b9b9b9" stroke-miterlimit="10"/><path d="M6.94792,3.89689V8l4.31353,2.6302a2.75862,2.75862,0,0,0,.526-.94687L8,7.36875V3.79168C7.68438,3.79168,7.26354,3.89689,6.94792,3.89689Z" fill="#f1851b"/></svg>

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

View file

@ -0,0 +1 @@
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><polygon points="9.301 14.909 7.48 14.242 5.976 13.207 4.207 13.084 2.628 12.587 6.628 1.091 7.861 1.52 9.445 2.828 11.498 2.786 13.301 3.413 9.301 14.909" fill="#fff"/><line x1="3.50014" y1="9.8092" x2="3.90851" y2="9.9513" fill="#f18519" stroke="#f18519" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.75"/><line x1="9.77353" y1="11.99201" x2="10.18191" y2="12.1341" fill="#f18519" stroke="#f18519" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.75"/><line x1="5.03287" y1="10.34251" x2="6.50597" y2="10.85507" fill="#f18519" stroke="#f18519" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.75"/><line x1="7.82721" y1="11.31479" x2="8.64397" y2="11.59898" fill="#f18519" stroke="#f18519" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.75"/><path d="M8.25714,1.3615,6.35555.69985,2.14913,12.78917,4.2008,13.503a1.82189,1.82189,0,0,1,2.92772,1.01869l2.2372.77842L13.57215,3.21083l-2.27135-.7903A1.80208,1.80208,0,0,1,8.25714,1.3615Z" fill="none" stroke="#b9b9b9" stroke-miterlimit="10" stroke-width="0.75"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

View file

@ -0,0 +1 @@
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M10.77071,5.949a18.65037,18.65037,0,0,1-1.9384-.76481c.03454.11132.03982.16841-.02879.237a1.69858,1.69858,0,0,1-2.30305,0c-.06958-.06957-.05662-.12714-.01488-.2423A19.3485,19.3485,0,0,1,4.53327,5.949s-.67172.38384-.7197,1.87123h7.67685C11.44244,6.28486,10.77071,5.949,10.77071,5.949Z" fill="#f18519"/><path d="M9.28335,1.53478A1.40357,1.40357,0,0,0,7.84392.14334H7.46009A1.43426,1.43426,0,0,0,6.02066,1.53478v1.0556a2.17734,2.17734,0,0,0,.67341,1.39447l-.00023-.00017c-.0216,1.16208-.36943,1.26042-.19335,1.4365a1.69851,1.69851,0,0,0,2.303,0c.17661-.17655-.13335-.27489-.18422-1.4461a2.17267,2.17267,0,0,0,.664-1.3847ZM7.37457,4.417A.8868.8868,0,0,0,7.9305,4.4168a.8868.8868,0,0,1-.55593.00018Zm-.4858-.26213c.01867.01451.03746.02844.05648.04208C6.92617,4.18312,6.90744,4.16954,6.88877,4.15485Zm.22876.152a1.368,1.368,0,0,0,.12831.059A1.34963,1.34963,0,0,1,7.11753,4.30681Zm.946.05655c.04185-.01768.08377-.03513.12474-.05737C8.14726,4.32876,8.10546,4.34521,8.06355,4.36336Zm.30393-.17292c.01709-.01241.03406-.02482.05092-.03788C8.40154,4.16585,8.38457,4.17785,8.36748,4.19044Z" fill="#fdc759"/><rect x="3.81357" y="8.21754" width="7.67685" height="7.14809" fill="#fff" stroke="#b9b9b9" stroke-miterlimit="10"/><path d="M10.85547,4.05727v.00216a.72914.72914,0,0,1-.69619.694.69619.69619,0,1,1,.69619-.69619Z" fill="#fff" stroke="#b9b9b9" stroke-miterlimit="10" stroke-width="0.75"/><rect x="2.90692" y="7.32845" width="9.39595" height="2.14786" fill="#b9b9b9"/><path d="M11.44059,7.82023c.0425-.1802.47775-2.66642.47775-2.66642S10.8621,4.43553,10.744,4.4096" fill="none" stroke="#b9b9b9" stroke-miterlimit="10" stroke-width="0.75"/></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1 @@
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><rect x="3.6353" y="0.81108" width="8.72941" height="14.37784" fill="#fff"/><path d="M11.59446.29758H4.40554A1.28529,1.28529,0,0,0,3.1218,1.58132V14.41868a1.28529,1.28529,0,0,0,1.28374,1.28374h7.18892a1.28529,1.28529,0,0,0,1.28374-1.28374V1.58132A1.28529,1.28529,0,0,0,11.59446.29758Zm.77024,14.1211a.77023.77023,0,0,1-.77024.77024H4.40554a.77023.77023,0,0,1-.77024-.77024v-.25675h8.7294Zm0-.77024H3.6353V2.35156h8.7294Zm0-11.81037H3.6353V1.58132A.77023.77023,0,0,1,4.40554.81108h7.18892a.77023.77023,0,0,1,.77024.77024Z" fill="#b9b9b9" stroke="#b9b9b9" stroke-miterlimit="10" stroke-width="0.25"/><path d="M7,8.97781v-2.5l1.25.625,1.25.625-1.25.625Z" fill="#f1851b" stroke="#f18519" stroke-miterlimit="10" stroke-width="0.75"/></svg>

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

View file

@ -0,0 +1 @@
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M4.44338,4.44321a3.55662,3.55662,0,1,1,4.0012,3.52906v4.91792a.44458.44458,0,0,1-.88916,0v-4.917a3.55661,3.55661,0,0,1-3.112-3.53084ZM6.66,12.06683a.44458.44458,0,0,1-.36544.51127,5.05543,5.05543,0,0,0-1.47155.43835,1.17283,1.17283,0,0,0-.329.23563.26737.26737,0,0,0-.05068.08v.00267l.00178.00711a.13018.13018,0,0,0,.01422.02934.54862.54862,0,0,0,.12893.13338,2.43719,2.43719,0,0,0,.72288.35121A8.89157,8.89157,0,0,0,8,14.22392a8.86354,8.86354,0,0,0,2.68881-.36811,2.45929,2.45929,0,0,0,.72288-.35121.55047.55047,0,0,0,.12982-.13338.13117.13117,0,0,0,.01333-.02934l.00178-.00711v-.00356a.26749.26749,0,0,0-.05068-.08,1.17177,1.17177,0,0,0-.329-.23474A5.06425,5.06425,0,0,0,9.7054,12.5781a.44458.44458,0,1,1,.11939-.88111l.02643.0044a5.90316,5.90316,0,0,1,1.74008.52816,1.352,1.352,0,0,1,.85448,1.10522,1.12848,1.12848,0,0,1-.4837.8687,3.32,3.32,0,0,1-.9923.49615A9.744,9.744,0,0,1,8,15.11308a9.744,9.744,0,0,1-2.96978-.41346,3.32,3.32,0,0,1-.9923-.49615,1.12848,1.12848,0,0,1-.4837-.8687,1.35323,1.35323,0,0,1,.85448-1.10522,5.90307,5.90307,0,0,1,1.74008-.52816A.44457.44457,0,0,1,6.66,12.06683Z" fill="#b9b9b9" fill-rule="evenodd"/><circle cx="8" cy="4.47576" r="3.58884" fill="#f18519" stroke="#fff" stroke-miterlimit="10" stroke-width="0.75"/></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#666" d="M12.053 11.026c-.238.07-.427.095-.674.095-2.033 0-5.017-7.1-5.017-9.462 0-.87.207-1.16.497-1.41C4.373.54 1.39 1.452.435 2.613c-.207.29-.332.746-.332 1.326C.103 7.628 4.04 16 6.82 16c1.283 0 3.45-2.114 5.233-4.974M10.756 0c2.57 0 5.14.415 5.14 1.865 0 2.943-1.865 6.508-2.818 6.508-1.7 0-3.814-4.725-3.814-7.088C9.264.207 9.68 0 10.756 0"/></svg>

Before

Width:  |  Height:  |  Size: 426 B

View file

@ -1,4 +1,5 @@
<?php <?php
namespace Wrm\Events\Tests\Unit\Controller; namespace Wrm\Events\Tests\Unit\Controller;
/** /**
@ -13,7 +14,7 @@ class DateControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
*/ */
protected $subject = null; protected $subject = null;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->subject = $this->getMockBuilder(\Wrm\Events\Controller\DateController::class) $this->subject = $this->getMockBuilder(\Wrm\Events\Controller\DateController::class)
@ -22,11 +23,6 @@ class DateControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
->getMock(); ->getMock();
} }
protected function tearDown()
{
parent::tearDown();
}
/** /**
* @test * @test
*/ */
@ -37,10 +33,10 @@ class DateControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$dateRepository = $this->getMockBuilder(\::class) // $dateRepository = $this->getMockBuilder(\::class)
->setMethods(['findAll']) // ->setMethods(['findAll'])
->disableOriginalConstructor() // ->disableOriginalConstructor()
->getMock(); // ->getMock();
$dateRepository->expects(self::once())->method('findAll')->will(self::returnValue($allDates)); $dateRepository->expects(self::once())->method('findAll')->will(self::returnValue($allDates));
$this->inject($this->subject, 'dateRepository', $dateRepository); $this->inject($this->subject, 'dateRepository', $dateRepository);

View file

@ -1,4 +1,5 @@
<?php <?php
namespace Wrm\Events\Tests\Unit\Controller; namespace Wrm\Events\Tests\Unit\Controller;
/** /**
@ -13,7 +14,7 @@ class EventControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
*/ */
protected $subject = null; protected $subject = null;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->subject = $this->getMockBuilder(\Wrm\Events\Controller\EventController::class) $this->subject = $this->getMockBuilder(\Wrm\Events\Controller\EventController::class)
@ -22,11 +23,6 @@ class EventControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
->getMock(); ->getMock();
} }
protected function tearDown()
{
parent::tearDown();
}
/** /**
* @test * @test
*/ */
@ -37,10 +33,10 @@ class EventControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$eventRepository = $this->getMockBuilder(\::class) // $eventRepository = $this->getMockBuilder(\::class)
->setMethods(['findAll']) // ->setMethods(['findAll'])
->disableOriginalConstructor() // ->disableOriginalConstructor()
->getMock(); // ->getMock();
$eventRepository->expects(self::once())->method('findAll')->will(self::returnValue($allEvents)); $eventRepository->expects(self::once())->method('findAll')->will(self::returnValue($allEvents));
$this->inject($this->subject, 'eventRepository', $eventRepository); $this->inject($this->subject, 'eventRepository', $eventRepository);

View file

@ -1,4 +1,5 @@
<?php <?php
namespace Wrm\Events\Tests\Unit\Controller; namespace Wrm\Events\Tests\Unit\Controller;
/** /**
@ -13,7 +14,7 @@ class EventsControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCas
*/ */
protected $subject = null; protected $subject = null;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->subject = $this->getMockBuilder(\Wrm\Events\Controller\EventsController::class) $this->subject = $this->getMockBuilder(\Wrm\Events\Controller\EventsController::class)
@ -22,11 +23,6 @@ class EventsControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCas
->getMock(); ->getMock();
} }
protected function tearDown()
{
parent::tearDown();
}
/** /**
* @test * @test
*/ */
@ -37,10 +33,10 @@ class EventsControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCas
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$eventsRepository = $this->getMockBuilder(\::class) // $eventsRepository = $this->getMockBuilder(\::class)
->setMethods(['findAll']) // ->setMethods(['findAll'])
->disableOriginalConstructor() // ->disableOriginalConstructor()
->getMock(); // ->getMock();
$eventsRepository->expects(self::once())->method('findAll')->will(self::returnValue($allEventss)); $eventsRepository->expects(self::once())->method('findAll')->will(self::returnValue($allEventss));
$this->inject($this->subject, 'eventsRepository', $eventsRepository); $this->inject($this->subject, 'eventsRepository', $eventsRepository);

View file

@ -1,4 +1,5 @@
<?php <?php
namespace Wrm\Events\Tests\Unit\Domain\Model; namespace Wrm\Events\Tests\Unit\Domain\Model;
/** /**
@ -13,17 +14,12 @@ class DateTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
*/ */
protected $subject = null; protected $subject = null;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->subject = new \Wrm\Events\Domain\Model\Date(); $this->subject = new \Wrm\Events\Domain\Model\Date();
} }
protected function tearDown()
{
parent::tearDown();
}
/** /**
* @test * @test
*/ */

View file

@ -1,4 +1,5 @@
<?php <?php
namespace Wrm\Events\Tests\Unit\Domain\Model; namespace Wrm\Events\Tests\Unit\Domain\Model;
/** /**
@ -13,17 +14,12 @@ class EventTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
*/ */
protected $subject = null; protected $subject = null;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->subject = new \Wrm\Events\Domain\Model\Event(); $this->subject = new \Wrm\Events\Domain\Model\Event();
} }
protected function tearDown()
{
parent::tearDown();
}
/** /**
* @test * @test
*/ */

View file

@ -1,4 +1,5 @@
<?php <?php
namespace Wrm\Events\Tests\Unit\Domain\Model; namespace Wrm\Events\Tests\Unit\Domain\Model;
/** /**
@ -13,17 +14,12 @@ class EventsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
*/ */
protected $subject = null; protected $subject = null;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->subject = new \Wrm\Events\Domain\Model\Events(); $this->subject = new \Wrm\Events\Domain\Model\Events();
} }
protected function tearDown()
{
parent::tearDown();
}
/** /**
* @test * @test
*/ */
@ -506,7 +502,7 @@ class EventsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
*/ */
public function setDateForObjectStorageContainingSetsDate() public function setDateForObjectStorageContainingSetsDate()
{ {
$date = new (); // $date = new ();
$objectStorageHoldingExactlyOneDate = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); $objectStorageHoldingExactlyOneDate = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$objectStorageHoldingExactlyOneDate->attach($date); $objectStorageHoldingExactlyOneDate->attach($date);
$this->subject->setDate($objectStorageHoldingExactlyOneDate); $this->subject->setDate($objectStorageHoldingExactlyOneDate);
@ -523,7 +519,7 @@ class EventsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
*/ */
public function addDateToObjectStorageHoldingDate() public function addDateToObjectStorageHoldingDate()
{ {
$date = new (); // $date = new ();
$dateObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class) $dateObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
->setMethods(['attach']) ->setMethods(['attach'])
->disableOriginalConstructor() ->disableOriginalConstructor()
@ -540,7 +536,7 @@ class EventsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
*/ */
public function removeDateFromObjectStorageHoldingDate() public function removeDateFromObjectStorageHoldingDate()
{ {
$date = new (); // $date = new ();
$dateObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class) $dateObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
->setMethods(['detach']) ->setMethods(['detach'])
->disableOriginalConstructor() ->disableOriginalConstructor()
@ -569,7 +565,7 @@ class EventsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
*/ */
public function setRegionForObjectStorageContainingSetsRegion() public function setRegionForObjectStorageContainingSetsRegion()
{ {
$region = new (); // $region = new ();
$objectStorageHoldingExactlyOneRegion = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); $objectStorageHoldingExactlyOneRegion = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$objectStorageHoldingExactlyOneRegion->attach($region); $objectStorageHoldingExactlyOneRegion->attach($region);
$this->subject->setRegion($objectStorageHoldingExactlyOneRegion); $this->subject->setRegion($objectStorageHoldingExactlyOneRegion);
@ -586,7 +582,7 @@ class EventsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
*/ */
public function addRegionToObjectStorageHoldingRegion() public function addRegionToObjectStorageHoldingRegion()
{ {
$region = new (); // $region = new ();
$regionObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class) $regionObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
->setMethods(['attach']) ->setMethods(['attach'])
->disableOriginalConstructor() ->disableOriginalConstructor()
@ -603,7 +599,7 @@ class EventsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
*/ */
public function removeRegionFromObjectStorageHoldingRegion() public function removeRegionFromObjectStorageHoldingRegion()
{ {
$region = new (); // $region = new ();
$regionObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class) $regionObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
->setMethods(['detach']) ->setMethods(['detach'])
->disableOriginalConstructor() ->disableOriginalConstructor()

View file

@ -1,4 +1,5 @@
<?php <?php
namespace Wrm\Events\Tests\Unit\Domain\Model; namespace Wrm\Events\Tests\Unit\Domain\Model;
/** /**
@ -13,17 +14,12 @@ class OrganizerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
*/ */
protected $subject = null; protected $subject = null;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->subject = new \Wrm\Events\Domain\Model\Organizer(); $this->subject = new \Wrm\Events\Domain\Model\Organizer();
} }
protected function tearDown()
{
parent::tearDown();
}
/** /**
* @test * @test
*/ */

View file

@ -1,4 +1,5 @@
<?php <?php
namespace Wrm\Events\Tests\Unit\Domain\Model; namespace Wrm\Events\Tests\Unit\Domain\Model;
/** /**
@ -13,17 +14,12 @@ class RegionTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
*/ */
protected $subject = null; protected $subject = null;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->subject = new \Wrm\Events\Domain\Model\Region(); $this->subject = new \Wrm\Events\Domain\Model\Region();
} }
protected function tearDown()
{
parent::tearDown();
}
/** /**
* @test * @test
*/ */

View file

@ -9,7 +9,9 @@
} }
], ],
"require": { "require": {
"typo3/cms-core": "^9.5" "typo3/cms-core": "^10.4",
"typo3/cms-extbase": "^10.4",
"typo3/cms-fluid": "^10.4"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@ -21,8 +23,14 @@
"Wrm\\Events\\Tests\\": "Tests" "Wrm\\Events\\Tests\\": "Tests"
} }
}, },
"replace": { "extra": {
"events": "self.version", "typo3/cms": {
"typo3-ter/events": "self.version" "extension-key": "events"
}
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.5",
"phpunit/phpunit": "^9.0",
"typo3/testing-framework": "^6.6"
} }
} }

View file

@ -1,16 +1,6 @@
<?php <?php
/************************************************************** $EM_CONF['events'] = [
* Extension Manager/Repository config file for ext: "events"
*
* Auto generated by Extension Builder 2019-04-03
*
* Manual updates:
* Only the data in the array - anything else is removed by next write.
* "version" and "dependencies" must not be touched!
***************************************************************/
$EM_CONF[$_EXTKEY] = [
'title' => 'Events', 'title' => 'Events',
'description' => 'Extension to manage events', 'description' => 'Extension to manage events',
'category' => 'plugin', 'category' => 'plugin',

View file

@ -1,71 +1,43 @@
<?php <?php
defined('TYPO3_MODE') || die('Access denied.');
call_user_func( defined('TYPO3') || die('Access denied.');
function()
{
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( call_user_func(function () {
'Wrm.Events', \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'DateSearch', 'Events',
[ 'DateSearch',
'Date' => 'search' [\Wrm\Events\Controller\DateController::class => 'search'],
], [\Wrm\Events\Controller\DateController::class => 'search']
[ );
'Date' => 'search'
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Wrm.Events', 'Events',
'DateList', 'DateList',
[ [\Wrm\Events\Controller\DateController::class => 'list'],
'Date' => 'list' [\Wrm\Events\Controller\DateController::class => 'list']
], );
[
'Date' => 'list'
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Wrm.Events', 'Events',
'DateShow', 'DateShow',
[ [\Wrm\Events\Controller\DateController::class => 'show'],
'Date' => 'show' [\Wrm\Events\Controller\DateController::class => 'show']
], );
[
'Date' => 'show'
]
);
/* \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); 'Events',
'Selected',
[\Wrm\Events\Controller\EventController::class => 'list']
);
$iconRegistry->registerIcon( if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['events_category'])) {
'events-plugin', $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['events_category'] = [];
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => 'EXT:events/Resources/Public/Icons/user_plugin_events.svg']
);
// wizards
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'mod {
wizards.newContentElement.wizardItems.plugins {
elements {
events {
iconIdentifier = events-plugin
title = LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events.name
description = LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events.description
tt_content_defValues {
CType = list
list_type = events_pi1
}
}
}
show = *
}
}'
);
*/
} }
);
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$iconRegistry->registerIcon(
'events-plugin',
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => 'EXT:events/Resources/Public/Icons/Extension.svg']
);
});

View file

@ -1,18 +1,9 @@
<?php <?php
defined('TYPO3_MODE') || die('Access denied.');
defined('TYPO3') || die('Access denied.');
call_user_func( call_user_func(
function() function () {
{
/*
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'Wrm.Events',
'Pi1',
'Events',
'EXT:events/Resources/Public/Icons/user_plugin_events.svg'
);
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('events', 'Configuration/TypoScript', 'Events'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('events', 'Configuration/TypoScript', 'Events');
@ -27,6 +18,5 @@ call_user_func(
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_events_domain_model_region', 'EXT:events/Resources/Private/Language/locallang_csh_tx_events_domain_model_region.xlf'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_events_domain_model_region', 'EXT:events/Resources/Private/Language/locallang_csh_tx_events_domain_model_region.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_events_domain_model_region'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_events_domain_model_region');
} }
); );

View file

@ -4,6 +4,7 @@
CREATE TABLE tx_events_domain_model_event ( CREATE TABLE tx_events_domain_model_event (
title varchar(255) DEFAULT '' NOT NULL, title varchar(255) DEFAULT '' NOT NULL,
subtitle text,
global_id varchar(255) DEFAULT '' NOT NULL, global_id varchar(255) DEFAULT '' NOT NULL,
slug varchar(255) DEFAULT '' NOT NULL, slug varchar(255) DEFAULT '' NOT NULL,
highlight smallint(5) unsigned DEFAULT '0' NOT NULL, highlight smallint(5) unsigned DEFAULT '0' NOT NULL,
@ -26,9 +27,12 @@ CREATE TABLE tx_events_domain_model_event (
longitude varchar(255) DEFAULT '' NOT NULL, longitude varchar(255) DEFAULT '' NOT NULL,
images int(11) unsigned NOT NULL default '0', images int(11) unsigned NOT NULL default '0',
categories int(11) DEFAULT '0' NOT NULL, categories int(11) DEFAULT '0' NOT NULL,
pages text,
dates int(11) unsigned DEFAULT '0' NOT NULL, dates int(11) unsigned DEFAULT '0' NOT NULL,
organizer int(11) unsigned DEFAULT '0', organizer int(11) unsigned DEFAULT '0',
partner text,
region int(11) unsigned DEFAULT '0', region int(11) unsigned DEFAULT '0',
references_events text,
KEY dataHandler (l10n_parent, t3ver_oid, deleted, t3ver_wsid, t3ver_state) KEY dataHandler (l10n_parent, t3ver_oid, deleted, t3ver_wsid, t3ver_state)
); );
@ -49,6 +53,18 @@ CREATE TABLE tx_events_domain_model_organizer (
KEY dataHandler (l10n_parent, sys_language_uid, deleted) KEY dataHandler (l10n_parent, sys_language_uid, deleted)
); );
#
# Table structure for table 'tx_events_domain_model_partner'
#
CREATE TABLE tx_events_domain_model_partner (
title varchar(255) DEFAULT '' NOT NULL,
link varchar(255) DEFAULT '' NOT NULL,
images int(11) unsigned NOT NULL default '0',
KEY dataHandler (l10n_parent, sys_language_uid, deleted)
);
# #
# Table structure for table 'tx_events_domain_model_date' # Table structure for table 'tx_events_domain_model_date'
# #
@ -56,6 +72,7 @@ CREATE TABLE tx_events_domain_model_date (
event int(11) unsigned DEFAULT '0' NOT NULL, event int(11) unsigned DEFAULT '0' NOT NULL,
start int(11) DEFAULT NULL, start int(11) DEFAULT NULL,
end int(11) DEFAULT NULL, end int(11) DEFAULT NULL,
canceled varchar(255) DEFAULT 'no' NOT NULL,
KEY event (event), KEY event (event),
KEY dataHandler (event, t3ver_wsid, pid) KEY dataHandler (event, t3ver_wsid, pid)
); );
@ -75,5 +92,7 @@ CREATE TABLE tx_events_domain_model_region (
CREATE TABLE tx_events_domain_model_date ( CREATE TABLE tx_events_domain_model_date (
event int(11) unsigned DEFAULT '0' NOT NULL, event int(11) unsigned DEFAULT '0' NOT NULL,
postponed_date int(11) unsigned DEFAULT '0' NOT NULL,
canceled_link varchar(1024) DEFAULT '' NOT NULL,
); );

26
phpcs.xml.dist Normal file
View file

@ -0,0 +1,26 @@
<?xml version="1.0"?>
<ruleset name="project">
<description>This project coding standard</description>
<file>Classes/</file>
<file>Tests/</file>
<file>ext_localconf.php</file>
<file>ext_tables.php</file>
<!-- Set default settings -->
<arg value="sp"/>
<arg name="colors"/>
<arg name="encoding" value="utf-8" />
<arg name="extensions" value="php" />
<!-- Base rules -->
<rule ref="PSR12">
<!-- Ignore some rules for now. -->
<!-- Otherwise we would need some more adjustments to the code. -->
<!-- We can clean these rules up in the future -->
<exclude name="Generic.Files.LineLength.TooLong" />
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
<exclude name="PSR12.Properties.ConstantVisibility.NotFound" />
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore" />
</rule>
</ruleset>