Refactored EXT dd_events to events, added fields to page type poi

This commit is contained in:
Dirk 2019-07-18 13:44:19 +02:00
commit 9c6539eb28
88 changed files with 8778 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/vendor/

View file

@ -0,0 +1,601 @@
<?php
namespace Wrm\Events\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\DataHandling\SlugHelper;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
use TYPO3\CMS\Core\Resource\Index\MetaDataRepository;
use TYPO3\CMS\Core\Core\Bootstrap;
class ImportCommand extends Command {
protected $restUrl;
protected $restExperience;
protected $restLicenseKey;
protected $restType;
protected $restLimit;
protected $restTemplate;
protected $storagePid;
protected $regionUid;
protected $categoryParentUid;
protected $logger;
protected $filesFolder;
protected $cliOutput;
protected $cliInput;
protected $eventRepository;
protected $regionRepository;
protected $organizerRepository;
protected $dateRepository;
protected $sysCategoriesRepository;
protected $fileRepository;
protected $metaDataRepository;
protected $configurationManager;
protected $objectManager;
protected $persistenceManager;
protected $resourceFactory;
protected $storage;
protected $tmpCurrentEvent = FALSE;
public function configure()
{
$this->setDescription('Import Destination Data Events');
$this->setHelp('Destination Data Events are imported');
$this->addArgument(
'storage-pid',
InputArgument::OPTIONAL,
'What is the storage pid?',
'281'
);
$this->addArgument(
'region-uid',
InputArgument::OPTIONAL,
'What is the region uid?',
'3'
);
$this->addArgument(
'category-parent-uid',
InputArgument::OPTIONAL,
'What is the default category parent uid?',
'6'
);
$this->addArgument('rest-url',
InputArgument::OPTIONAL,
'What is the rest url?',
'http://meta.et4.de/rest.ashx/search/'
);
$this->addArgument('rest-experience',
InputArgument::OPTIONAL,
'What is the rest experience?',
'arnstadt'
);
$this->addArgument('rest-license-key',
InputArgument::OPTIONAL,
'What is the rest license key?',
'***REMOVED***'
);
$this->addArgument('rest-type',
InputArgument::OPTIONAL,
'What is the rest data type?',
'Event'
);
$this->addArgument('rest-limit',
InputArgument::OPTIONAL,
'What is the rest data limit?',
'200'
);
$this->addArgument('rest-template',
InputArgument::OPTIONAL,
'What is the rest data template?',
'ET2014A.json'
);
$this->addArgument('files-folder',
InputArgument::OPTIONAL,
'Where to save the image files?',
'redaktion/arnstadt/events/'
);
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->cliOutput = $output;
$this->cliInput = $input;
$this->storagePid = $input->getArgument('storage-pid');
$this->regionUid = $input->getArgument('region-uid');
$this->categoryParentUid = $input->getArgument('category-parent-uid');
$this->filesFolder = $input->getArgument('files-folder');
$this->restUrl = $input->getArgument('rest-url');
$this->restExperience = $input->getArgument('rest-experience');
$this->restLicenseKey = $input->getArgument('rest-license-key');
$this->restType = $input->getArgument('rest-type');
$this->restLimit = $input->getArgument('rest-limit');
$this->restTemplate = $input->getArgument('rest-template');
$this->cliOutput->writeln('Hello from destination data event import');
Bootstrap::initializeBackendAuthentication();
return $this->import();
}
protected function import() {
try {
// Debug limit to one select event via query
// $restUrl = $this->restUrl . '?experience=' . $this->restExperience . '&licensekey=' . $this->restLicenseKey . '&type=' . $this->restType . '&limit=' . $this->restLimit . '&template=' . $this->restTemplate . "&q=title:Schüler";
$restUrl = $this->restUrl . '?experience=' . $this->restExperience . '&licensekey=' . $this->restLicenseKey . '&type=' . $this->restType . '&limit=' . $this->restLimit . '&template=' . $this->restTemplate;
$this->cliOutput->writeln($restUrl);
$jsonResponse = json_decode(file_get_contents($restUrl),true);
} catch (\Exception $e) {
return 1;
}
if (!empty($jsonResponse)) {
$this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$this->configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
$this->persistenceManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager');
$this->eventRepository = $this->objectManager->get('Wrm\\Events\\Domain\\Repository\\EventRepository');
$this->regionRepository = $this->objectManager->get('Wrm\\Events\\Domain\\Repository\\RegionRepository');
$this->organizerRepository = $this->objectManager->get('Wrm\\Events\\Domain\\Repository\\OrganizerRepository');
$this->dateRepository = $this->objectManager->get('Wrm\\Events\\Domain\\Repository\\DateRepository');
$this->sysCategoriesRepository = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Domain\\Repository\\CategoryRepository');
$frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
$persistenceConfiguration = [
'persistence' => [
'storagePid' => $this->storagePid,
],
];
$this->configurationManager->setConfiguration(array_merge($frameworkConfiguration, $persistenceConfiguration));
$this->cliOutput->writeln('Received json data.');
$this->cliOutput->writeln('Received ' . $jsonResponse['count'] . ' items.');
// get selected Region from Database
$selectedRegion = $this->regionRepository->findByUid($this->regionUid);
// TODO: How to delete event Dates
// until than delet all dates -->
// $this->dateRepository->removeByEvent();
// <--
foreach ($jsonResponse['items'] as $event)
{
$this->tmpCurrentEvent = $this->eventRepository->findOneByGlobalId($event['global_id']);
if (!$this->tmpCurrentEvent)
{
// Global ID not found
$this->tmpCurrentEvent = $this->objectManager->get('Wrm\\Events\\Domain\\Model\\Event');
//$this->currentEventIsNew = TRUE;
// Create event and persist
$this->tmpCurrentEvent->setGlobalId($event['global_id']);
$this->tmpCurrentEvent->setCategories(new ObjectStorage());
$this->eventRepository->add($this->tmpCurrentEvent);
$this->persistenceManager->persistAll();
$this->cliOutput->writeln('Not found "' . substr($event['title'], 0, 20) . '..." with global id ' . $event['global_id'] . ' in database. Created new one.');
} else {
// Global ID is found and events gets updated
$this->tmpCurrentEvent = $this->eventRepository->findOneByGlobalId($event['global_id']);
//$this->currentEventIsNew = FALSE;
$this->cliOutput->writeln('Found "' . substr($event['title'], 0, 20) . '..." with global id ' . $event['global_id'] . ' in database');
}
// Set selected Region
$this->tmpCurrentEvent->setRegion($selectedRegion);
// Set Title
$this->tmpCurrentEvent->setTitle(substr($event['title'], 0, 254));
// Set Highlight (Is only set in rest if true)
if($event['highlight'])
$this->tmpCurrentEvent->setHighlight($event['highlight']);
// Set Texts
foreach ($event['texts'] as $text)
{
if ($text['rel'] == "details" && $text['type'] == "text/plain") {
$this->tmpCurrentEvent->setDetails($text['value']);
}
if ($text['rel'] == "teaser" && $text['type'] == "text/plain") {
$this->tmpCurrentEvent->setTeaser($text['value']);
}
}
//////////////
// Set Address
$this->tmpCurrentEvent->setStreet($event['street']);
$this->tmpCurrentEvent->setCity($event['city']);
$this->tmpCurrentEvent->setZip($event['zip']);
$this->tmpCurrentEvent->setCountry($event['country']);
//////////
// Set Geo
$this->tmpCurrentEvent->setLatitude($event['geo']['main']['latitude']);
$this->tmpCurrentEvent->setLongitude($event['geo']['main']['longitude']);
/////////////////
// Set Categories
$tmpSysCategory = FALSE;
$sysParentCategory = $this->sysCategoriesRepository->findByUid($this->categoryParentUid);
foreach ($event['categories'] as $categoryTitle) {
$tmpSysCategory = $this->sysCategoriesRepository->findOneByTitle($categoryTitle);
if (!$tmpSysCategory)
{
$this->cliOutput->writeln('Creating new category: ' . $categoryTitle);
$tmpSysCategory = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Domain\\Model\\Category');
$tmpSysCategory->setTitle($categoryTitle);
$tmpSysCategory->setParent($sysParentCategory);
$this->sysCategoriesRepository->add($tmpSysCategory);
$this->tmpCurrentEvent->addCategory($tmpSysCategory);
} else {
$this->tmpCurrentEvent->addCategory($tmpSysCategory);
}
$tmpSysCategory = FALSE;
}
////////////////
// Set Organizer
$tmpOrganizer = FALSE;
foreach ($event['addresses'] as $address)
{
if ($address['rel'] == "organizer") {
$tmpOrganizer = $this->organizerRepository->findOneByName($address['name']);
if (!$tmpOrganizer)
{
$tmpOrganizer = $this->objectManager->get('Wrm\\Events\\Domain\\Model\\Organizer');
$tmpOrganizer->setName($address['name']);
$tmpOrganizer->setCity($address['city']);
$tmpOrganizer->setZip($address['zip']);
$tmpOrganizer->setStreet($address['street']);
$tmpOrganizer->setPhone($address['phone']);
$tmpOrganizer->setWeb($address['web']);
$tmpOrganizer->setEmail($address['email']);
$tmpOrganizer->setDistrict($address['district']);
$this->organizerRepository->add($tmpOrganizer);
$this->tmpCurrentEvent->setOrganizer($tmpOrganizer);
} else {
$this->tmpCurrentEvent->setOrganizer($tmpOrganizer);
}
$tmpOrganizer = FALSE;
}
}
////////////
// Set Dates
// TODO: does not seem to work -->
//$currentEventDates = $this->tmpCurrentEvent->getDates();
//$this->tmpCurrentEvent->removeAllDates($currentEventDates);
// <--
// TODO: Workaround delete dates
$currentEventDates = $this->tmpCurrentEvent->getDates();
$this->cliOutput->writeln('Found ' . count($currentEventDates) . ' to delete');
foreach ($currentEventDates as $currentDate) {
//$this->cliOutput->writeln('Delete ' . $currentDate->getStart()->format('Y-m-d'));
$this->dateRepository->remove($currentDate);
}
$now = new \DateTime();
$now = $now->getTimestamp();
foreach ($event['timeIntervals'] as $date) {
// Check if dates are given as interval or not
if (empty($date['interval'])) {
if (strtotime($date['start']) > $now) {
$this->cliOutput->writeln('Setup single date');
//$this->cliOutput->writeln('Start ' . $date['start']);
//$this->cliOutput->writeln('End ' . $date['end']);
$dateObj = $this->objectManager->get('Wrm\\Events\\Domain\\Model\\Date');
$start = new \DateTime($date['start'], new \DateTimeZone($date['tz']));
$end = new \DateTime($date['end'], new \DateTimeZone($date['tz']));
$this->cliOutput->writeln('Start transformed ' . $start->format('Y-m-d H:i'));
$this->cliOutput->writeln('End transformed ' . $end->format('Y-m-d H:i'));
$dateObj->setStart($start);
$dateObj->setEnd($end);
$this->tmpCurrentEvent->addDate($dateObj);
}
} else {
if ($date['freq'] == 'Daily' && empty($date['weekdays'])) {
$this->cliOutput->writeln('Setup daily interval dates');
$this->cliOutput->writeln('Start ' . $date['start']);
$this->cliOutput->writeln('End ' . $date['repeatUntil']);
$start = new \DateTime($date['start'], 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)) {
if ($i > $now) {
$eventStart = new \DateTime();
$eventStart->setTimestamp($i);
$eventStart->setTime($start->format('H'), $start->format('i'));
$eventEnd = new \DateTime();
$eventEnd->setTimestamp($i);
$eventEnd->setTime($until->format('H'), $until->format('i'));
//$this->cliOutput->writeln($eventStart->format('Y-m-d H:i'));
//$this->cliOutput->writeln($eventEnd->format('Y-m-d H:i'));
$dateObj = $this->objectManager->get('Wrm\\Events\\Domain\\Model\\Date');
$dateObj->setStart($eventStart);
$dateObj->setEnd($eventEnd);
$this->tmpCurrentEvent->addDate($dateObj);
}
}
}
else if ($date['freq'] == 'Weekly' && !empty($date['weekdays'])) {
foreach ($date['weekdays'] as $day) {
$this->cliOutput->writeln('Setup weekly interval dates for ' . $day);
$this->cliOutput->writeln('Start ' . $date['start']);
$this->cliOutput->writeln('End ' . $date['repeatUntil']);
$start = new \DateTime($date['start'], 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)) {
if ($i > $now) {
$eventStart = new \DateTime();
$eventStart->setTimestamp($i);
$eventStart->setTime($start->format('H'), $start->format('i'));
$eventEnd = new \DateTime();
$eventEnd->setTimestamp($i);
$eventEnd->setTime($until->format('H'), $until->format('i'));
//$this->cliOutput->writeln($eventStart->format('Y-m-d H:i'));
//$this->cliOutput->writeln($eventEnd->format('Y-m-d H:i'));
$dateObj = $this->objectManager->get('Wrm\\Events\\Domain\\Model\\Date');
$dateObj->setStart($eventStart);
$dateObj->setEnd($eventEnd);
$this->tmpCurrentEvent->addDate($dateObj);
}
}
}
}
}
}
/////////////
// Set Assets
$this->resourceFactory = $this->objectManager->get('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
$this->fileRepository = $this->objectManager->get('TYPO3\\CMS\\Core\\Resource\\FileRepository');
$this->metaDataRepository = $this->objectManager->get('TYPO3\\CMS\\Core\\Resource\\Index\\MetaDataRepository');
foreach ($event['media_objects'] as $media_object)
{
if($media_object['rel'] == "default" && $media_object['type'] == "image/jpeg") {
//
$this->storage = $this->resourceFactory->getDefaultStorage();
// Check if file already exists
if (file_exists(PATH_site . '/fileadmin/' . $this->filesFolder . strtolower(basename($media_object['url'])))) {
$this->cliOutput->writeln('[NOTICE] File already exists');
} else {
$this->cliOutput->writeln("[NOTICE] File don't exist");
// Load the file
if ($file = $this->loadFile($media_object['url'])) {
// Move file to defined folder
$this->cliOutput->writeln('[INFO] Adding file ' . $file);
$this->storage->addFile(PATH_site . "uploads/tx_Events/" . $file, $this->storage->getFolder($this->filesFolder), basename($media_object['url']));
} else {
$error = true;
}
}
if ($error !== true) {
if ($this->tmpCurrentEvent->getImages() !== null) {
$this->cliOutput->writeln('Relation found');
// TODO: How to delete file references?
} else {
$this->cliOutput->writeln('No relation found');
$file = $this->storage->getFile($this->filesFolder . basename($media_object['url']));
$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);
}
}
}
}
// Update and persist
$this->cliOutput->writeln('Persist database');
$this->eventRepository->update($this->tmpCurrentEvent);
$this->persistenceManager->persistAll();
}
}
$this->doSlugUpdate();
return 0;
}
/**
* Load File
*
* @param string $asset
* @return bool
*/
protected function loadFile($file) {
$directory = PATH_site . "uploads/tx_Events/";
$filename = basename($file);
$this->cliOutput->writeln('[INFO] Getting file ' . $file . ' as ' . $filename);
$asset = \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($file);
if ($asset) {
$fp = fopen($directory . $filename, 'w');
fputs($fp, $asset);
fclose($fp);
return $filename;
}
$this->cliOutput->writeln('[ERROR] cannot load file ' . $file);
return false;
}
/**
* Build relations for FAL
*
* @param int $uid_local
* @param string $tablenames
* @param int $uid_foreign
* @param string $fieldname
* @param string $storagePid
* @return bool
*/
protected function createFileRelations($uid_local, $tablenames, $uid_foreign, $fieldname, $storagePid) {
$newId = 'NEW1234';
$data = array();
$data['sys_file_reference'][$newId] = array(
'table_local' => 'sys_file',
'uid_local' => $uid_local,
'tablenames' => $tablenames,
'uid_foreign' => $uid_foreign,
'fieldname' => $fieldname,
'pid' => $storagePid
);
$data[$tablenames][$uid_foreign] = array(
'pid' => $storagePid,
$fieldname => $newId
);
$dataHandler = $this->objectManager->get('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
$dataHandler->start($data, array());
$dataHandler->process_datamap();
if (count($dataHandler->errorLog) === 0) {
return true;
} else {
foreach($dataHandler->errorLog as $error) {
$this->cliOutput->writeln($error);
}
return false;
}
}
/*
* Generate random hash for filenames
*/
protected function randHash($len=32)
{
return substr(md5(openssl_random_pseudo_bytes(20)),-$len);
}
/**
* Performs slug update
*
* @return bool
*/
protected function doSlugUpdate()
{
$this->cliOutput->writeln('Update slugs');
$slugHelper = GeneralUtility::makeInstance(
SlugHelper::class,
'tx_events_domain_model_event',
'slug',
$GLOBALS['TCA']['tx_events_domain_model_event']['columns']['slug']['config']
);
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_events_domain_model_event');
$queryBuilder = $connection->createQueryBuilder();
$queryBuilder->getRestrictions()->removeAll();
$statement = $queryBuilder->select('uid', 'global_id')
->from('tx_events_domain_model_event')
->where(
$queryBuilder->expr()->orX(
$queryBuilder->expr()->eq('slug', $queryBuilder->createNamedParameter('', \PDO::PARAM_STR)),
$queryBuilder->expr()->isNull('slug')
)
)
->execute();
while ($record = $statement->fetch()) {
$queryBuilder = $connection->createQueryBuilder();
$queryBuilder->update('tx_events_domain_model_event')
->where(
$queryBuilder->expr()->eq(
'uid',
$queryBuilder->createNamedParameter($record['uid'], \PDO::PARAM_INT)
)
)
->set('slug', $slugHelper->sanitize((string)$record['global_id']));
$queryBuilder->getSQL();
$queryBuilder->execute();
}
return true;
}
}

View file

@ -0,0 +1,124 @@
<?php
namespace Wrm\Events\Controller;
/***
*
* This file is part of the "DD Events" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2019 Dirk Koritnik <koritnik@werkraum-media.de>
*
***/
use Wrm\Events\Domain\Model\Dto\DateDemand;
use Wrm\Events\Domain\Model\Date;
use Wrm\Events\Domain\Repository\DateRepository;
use TYPO3\CMS\Core\Database\QueryGenerator;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
/**
* DateController
*/
class DateController extends ActionController
{
/**
* @var dateRepository
*/
protected $dateRepository = null;
/**
* @var QueryGenerator
*/
protected $queryGenerator;
/**
* @var array
*/
protected $pluginSettings;
/**
* @param DateRepository $dateRepository
*/
public function injectDateRepository(DateRepository $dateRepository)
{
$this->dateRepository = $dateRepository;
}
/**
* Action initializer
*/
protected function initializeAction()
{
$this->pluginSettings = $this->configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK
);
}
/**
* action list
*
* @return void
*/
public function listAction()
{
$demand = $this->createDemandFromSettings();
$dates = $this->dateRepository->findByDemand($demand);
$this->view->assign('dates', $dates);
}
/**
* action teaser
*
* @return void
*/
public function teaserAction()
{
$dates = $this->dateRepository->findByUids($this->settings['eventUids']);
$this->view->assign('dates', $dates);
}
/**
* action show
*
* @param \Wrm\Events\Domain\Model\Date $date
* @return void
*/
public function showAction(\Wrm\Events\Domain\Model\Date $date)
{
$this->view->assign('date', $date);
}
/**
* @return DateDemand
*/
protected function createDemandFromSettings(): DateDemand
{
$demand = $this->objectManager->get(DateDemand::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['sortByDate']);
$demand->setSortOrder((string)$this->settings['sortOrder']);
$demand->setHighlight((string)$this->settings['highlight']);
if (!empty($this->settings['limit'])) {
$demand->setLimit($this->settings['limit']);
}
return $demand;
}
}

View file

@ -0,0 +1,115 @@
<?php
namespace Wrm\Events\Controller;
use Wrm\Events\Domain\Model\Dto\EventDemand;
use Wrm\Events\Domain\Model\Event;
use Wrm\Events\Domain\Repository\EventRepository;
use TYPO3\CMS\Core\Database\QueryGenerator;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
/**
* EventController
*/
class EventController extends ActionController
{
/**
* @var eventRepository
*/
protected $eventRepository = null;
/**
* @var QueryGenerator
*/
protected $queryGenerator;
/**
* @var array
*/
protected $pluginSettings;
/**
* @param EventRepository $eventRepository
*/
public function injectEventRepository(EventRepository $eventRepository)
{
$this->eventRepository = $eventRepository;
}
/**
* Action initializer
*/
protected function initializeAction()
{
$this->pluginSettings = $this->configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK
);
}
/**
* Action list
*
* @return void
*/
public function listAction()
{
$demand = $this->createDemandFromSettings();
$events = $this->eventRepository->findByDemand($demand);
$this->view->assign('events', $events);
}
/**
* Action show
*
* @param Event $event
* @return void
*/
public function showAction(Event $event)
{
$this->view->assign('event', $event);
}
/**
* action teaser
*
* @return void
*/
public function teaserAction()
{
$events = $this->eventRepository->findByUids($this->settings['eventUids']);
$this->view->assign('events', $events);
}
/**
* @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,89 @@
<?php
namespace Wrm\Events\Domain\Model;
/***
*
* This file is part of the "DD Events" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2019 Dirk Koritnik <koritnik@werkraum-media.de>
*
***/
/**
* Date
*/
class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
/**
* @var \DateTime
*/
protected $start = null;
/**
* @var \DateTime
*/
protected $end = '';
/**
* @var \Wrm\Events\Domain\Model\Event
*/
protected $event = null;
/**
* @return \DateTime $start
*/
public function getStart()
{
return $this->start;
}
/**
* @param \DateTime $start
* @return void
*/
public function setStart(\DateTime $start)
{
$this->start = $start;
}
/**
* @return \DateTime end
*/
public function getEnd()
{
return $this->end;
}
/**
* @param string $end
* @return void
*/
public function setEnd($end)
{
$this->end = $end;
}
/**
* @return Event
*/
public function getEvent(): Event
{
return $this->event;
}
/**
* @param Event $event
*/
public function setEvent(Event $event): self
{
$this->event = $event;
return $this;
}
}

View file

@ -0,0 +1,177 @@
<?php
namespace Wrm\Events\Domain\Model\Dto;
class DateDemand {
/**
* @var string
*/
protected $sortBy = '';
/**
* @var string
*/
protected $sortOrder = '';
/**
* @var string
*/
protected $categories = '';
/**
* @var bool
*/
protected $includeSubCategories = false;
/**
* @var string
*/
protected $categoryCombination = '';
/**
* @var string
*/
protected $region = null;
/**
* @var string
*/
protected $highlight = null;
/**
* @var string
*/
protected $limit = '';
/**
* @return string
*/
public function getSortBy(): string
{
return $this->sortBy;
}
/**
* @param string $sortBy
*/
public function setSortBy(string $sortBy)
{
$this->sortBy = $sortBy;
}
/**
* @return string
*/
public function getSortOrder(): string
{
return $this->sortOrder;
}
/**
* @param string $sortOrder
*/
public function setSortOrder(string $sortOrder)
{
$this->sortOrder = $sortOrder;
}
/**
* @return string
*/
public function getCategories(): string
{
return $this->categories;
}
/**
* @param string $categories
*/
public function setCategories(string $categories)
{
$this->categories = $categories;
}
/**
* @return bool
*/
public function getIncludeSubCategories(): bool
{
return $this->includeSubCategories;
}
/**
* @param bool $includeSubCategories
*/
public function setIncludeSubCategories(bool $includeSubCategories)
{
$this->includeSubCategories = $includeSubCategories;
}
/**
* @return string
*/
public function getCategoryCombination(): string
{
return $this->categoryCombination;
}
/**
* @param string $categoryCombination
*/
public function setCategoryCombination(string $categoryCombination)
{
$this->categoryCombination = $categoryCombination;
}
/**
* @return string
*/
public function getRegion(): string
{
return $this->region;
}
/**
* @param \Wrm\DdEvents\Domain\Model\Region $region
*/
public function setRegion(string $region): void
{
$this->region = $region;
}
/**
* @return string
*/
public function getHighlight(): string
{
return $this->highlight;
}
/**
* @param string $hightlight
*/
public function setHighlight(string $highlight): void
{
$this->highlight = $highlight;
}
/**
* @return string
*/
public function getLimit(): string
{
return $this->limit;
}
/**
* @param string $limit
*/
public function setLimit(string $limit): void
{
$this->limit = $limit;
}
}

View file

@ -0,0 +1,177 @@
<?php
namespace Wrm\Events\Domain\Model\Dto;
class EventDemand {
/**
* @var string
*/
protected $sortBy = '';
/**
* @var string
*/
protected $sortOrder = '';
/**
* @var string
*/
protected $categories = '';
/**
* @var bool
*/
protected $includeSubCategories = false;
/**
* @var string
*/
protected $categoryCombination = '';
/**
* @var string
*/
protected $region = null;
/**
* @var bool
*/
protected $highlight = false;
/**
* @var string
*/
protected $limit = '';
/**
* @return string
*/
public function getSortBy(): string
{
return $this->sortBy;
}
/**
* @param string $sortBy
*/
public function setSortBy(string $sortBy)
{
$this->sortBy = $sortBy;
}
/**
* @return string
*/
public function getSortOrder(): string
{
return $this->sortOrder;
}
/**
* @param string $sortOrder
*/
public function setSortOrder(string $sortOrder)
{
$this->sortOrder = $sortOrder;
}
/**
* @return string
*/
public function getCategories(): string
{
return $this->categories;
}
/**
* @param string $categories
*/
public function setCategories(string $categories)
{
$this->categories = $categories;
}
/**
* @return bool
*/
public function getIncludeSubCategories(): bool
{
return $this->includeSubCategories;
}
/**
* @param bool $includeSubCategories
*/
public function setIncludeSubCategories(bool $includeSubCategories)
{
$this->includeSubCategories = $includeSubCategories;
}
/**
* @return string
*/
public function getCategoryCombination(): string
{
return $this->categoryCombination;
}
/**
* @param string $categoryCombination
*/
public function setCategoryCombination(string $categoryCombination)
{
$this->categoryCombination = $categoryCombination;
}
/**
* @return string
*/
public function getRegion(): string
{
return $this->region;
}
/**
* @param \Wrm\DdEvents\Domain\Model\Region $region
*/
public function setRegion(string $region): void
{
$this->region = $region;
}
/**
* @return bool
*/
public function getHighlight(): bool
{
return $this->highlight;
}
/**
* @param bool $hightlight
*/
public function setHighlight(bool $highlight): void
{
$this->highlight = $highlight;
}
/**
* @return string
*/
public function getLimit(): string
{
return $this->limit;
}
/**
* @param string $limit
*/
public function setLimit(string $limit): void
{
$this->limit = $limit;
}
}

View file

@ -0,0 +1,659 @@
<?php
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\Object\ObjectManager;
use \TYPO3\CMS\Extbase\Persistence\ObjectStorage;
/**
* Event
*/
class Event extends AbstractEntity
{
/**
* title
*
* @var string
*/
protected $title = '';
/**
* globalId
*
* @var string
*/
protected $globalId = '';
/**
* slug
*
* @var string
*/
protected $slug = '';
/**
* highlight
*
* @var bool
*/
protected $highlight = false;
/**
* teaser
*
* @var string
*/
protected $teaser = '';
/**
* details
*
* @var string
*/
protected $details = '';
/**
* priceInfo
*
* @var string
*/
protected $priceInfo = '';
/**
* street
*
* @var string
*/
protected $street = '';
/**
* district
*
* @var string
*/
protected $district = '';
/**
* city
*
* @var string
*/
protected $city = '';
/**
* zip
*
* @var string
*/
protected $zip = '';
/**
* country
*
* @var string
*/
protected $country = '';
/**
* web
*
* @var string
*/
protected $web = '';
/**
* booking
*
* @var string
*/
protected $booking = '';
/**
* ticket
*
* @var string
*/
protected $ticket = '';
/**
* facebook
*
* @var string
*/
protected $facebook = '';
/**
* youtube
*
* @var string
*/
protected $youtube = '';
/**
* latitude
*
* @var string
*/
protected $latitude = '';
/**
* longitude
*
* @var string
*/
protected $longitude = '';
/**
* images
*
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
* @cascade remove
*/
protected $images = null;
/**
* dates
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Wrm\Events\Domain\Model\Date>
* @cascade remove
*/
protected $dates = null;
/**
* organizer
*
* @var \Wrm\Events\Domain\Model\Organizer
*/
protected $organizer = null;
/**
* region
*
* @var \Wrm\Events\Domain\Model\Region
*/
protected $region = null;
/**
* categories
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category>
*/
protected $categories;
/**
* __construct
*/
public function __construct()
{
//Do not remove the next line: It would break the functionality
$this->initStorageObjects();
}
/**
* @return void
*/
protected function initStorageObjects()
{
$this->dates = new ObjectStorage();
}
/**
* Returns the globalId
*
* @return string $globalId
*/
public function getGlobalId()
{
return $this->globalId;
}
/**
* @param string $globalId
* @return void
*/
public function setGlobalId($globalId)
{
$this->globalId = $globalId;
}
/**
* @return string $title
*/
public function getTitle()
{
return $this->title;
}
/**
* @param string $title
* @return void
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* @return string $teaser
*/
public function getTeaser()
{
return $this->teaser;
}
/**
* @param string $teaser
* @return void
*/
public function setTeaser($teaser)
{
$this->teaser = $teaser;
}
/**
* @return string $details
*/
public function getDetails()
{
return $this->details;
}
/**
* @param string $details
* @return void
*/
public function setDetails($details)
{
$this->details = $details;
}
/**
* @return string $priceInfo
*/
public function getPriceInfo()
{
return $this->priceInfo;
}
/**
* @param string $priceInfo
* @return void
*/
public function setPriceInfo($priceInfo)
{
$this->priceInfo = $priceInfo;
}
/**
* @return string $street
*/
public function getStreet()
{
return $this->street;
}
/**
* @param string $street
* @return void
*/
public function setStreet($street)
{
$this->street = $street;
}
/**
* @return string $district
*/
public function getDistrict()
{
return $this->district;
}
/**
* @param string $district
* @return void
*/
public function setDistrict($district)
{
$this->district = $district;
}
/**
* @return string $city
*/
public function getCity()
{
return $this->city;
}
/**
* @param string $city
* @return void
*/
public function setCity($city)
{
$this->city = $city;
}
/**
* @return string $zip
*/
public function getZip()
{
return $this->zip;
}
/**
* @param string $zip
* @return void
*/
public function setZip($zip)
{
$this->zip = $zip;
}
/**
* @return string $web
*/
public function getWeb()
{
return $this->web;
}
/**
* @param string $web
* @return void
*/
public function setWeb($web)
{
$this->web = $web;
}
/**
* @return string $booking
*/
public function getBooking()
{
return $this->booking;
}
/**
* @param string $booking
* @return void
*/
public function setBooking($booking)
{
$this->booking = $booking;
}
/**
* @return string $ticket
*/
public function getTicket()
{
return $this->ticket;
}
/**
* @param string $ticket
* @return void
*/
public function setTicket($ticket)
{
$this->ticket = $ticket;
}
/**
* @return string $facebook
*/
public function getFacebook()
{
return $this->facebook;
}
/**
* @param string $facebook
* @return void
*/
public function setFacebook($facebook)
{
$this->facebook = $facebook;
}
/**
* @return string $youtube
*/
public function getYoutube()
{
return $this->youtube;
}
/**
* @param string $youtube
* @return void
*/
public function setYoutube($youtube)
{
$this->youtube = $youtube;
}
/**
* @return string $latitude
*/
public function getLatitude()
{
return $this->latitude;
}
/**
* @param string $latitude
* @return void
*/
public function setLatitude($latitude)
{
$this->latitude = $latitude;
}
/**
* @return string $longitude
*/
public function getLongitude()
{
return $this->longitude;
}
/**
* @param string $longitude
* @return void
*/
public function setLongitude($longitude)
{
$this->longitude = $longitude;
}
/**
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $images
*/
public function getImages()
{
return $this->images;
}
/**
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $images
* @return void
*/
public function setImages(\TYPO3\CMS\Extbase\Domain\Model\FileReference $images)
{
$this->images = $images;
}
/**
* @return string $slug
*/
public function getSlug()
{
return $this->slug;
}
/**
* @param string $slug
* @return void
*/
public function setSlug($slug)
{
$this->slug = $slug;
}
/**
* @param Date $date
* @return Event
*/
public function addDate(Date $date): self
{
$this->dates->attach($date);
return $this;
}
/**
* @param Date $date
* @return Event
*/
public function removeDate(Date $date): self
{
$this->dates->detach($date);
return $this;
}
/**
* @return ObjectStorage
*/
public function getDates(): ObjectStorage
{
return $this->dates;
}
/**
* @param ObjectStorage $dates
*
* @return Event
*/
public function setDates($dates): self
{
$this->dates = $dates;
return $this;
}
/**
* @param ObjectStorage $dates
* @return void
*/
public function removeAllDates(ObjectStorage $dates) {
$this->dates->removeAll($dates);
}
/**
* @return \Wrm\Events\Domain\Model\Organizer $organizer
*/
public function getOrganizer()
{
return $this->organizer;
}
/**
* @param \Wrm\Events\Domain\Model\Organizer $organizer
* @return void
*/
public function setOrganizer(\Wrm\Events\Domain\Model\Organizer $organizer)
{
$this->organizer = $organizer;
}
/**
* @return \Wrm\Events\Domain\Model\Region $region
*/
public function getRegion()
{
return $this->region;
}
/**
* @param \Wrm\Events\Domain\Model\Region $region
* @return void
*/
public function setRegion(\Wrm\Events\Domain\Model\Region $region)
{
$this->region = $region;
}
/**
* @return bool $highlight
*/
public function getHighlight()
{
return $this->highlight;
}
/**
* @param bool $highlight
* @return void
*/
public function setHighlight($highlight)
{
$this->highlight = $highlight;
}
/**
* @return bool
*/
public function isHighlight()
{
return $this->highlight;
}
/**
* @return string $country
*/
public function getCountry()
{
return $this->country;
}
/**
* @param string $country
* @return void
*/
public function setCountry($country)
{
$this->country = $country;
}
/**
* @param \TYPO3\CMS\Extbase\Domain\Model\Category<\TYPO3\CMS\Extbase\Domain\Model\Category> $category
*/
public function addCategory(\TYPO3\CMS\Extbase\Domain\Model\Category $category)
{
$this->categories->attach($category);
}
/**
* @return $categories
*/
public function getCategories()
{
return $this->categories;
}
/**
* @param TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category> $categories
*/
public function setCategories(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $categories)
{
$this->categories = $categories;
}
}

View file

@ -0,0 +1,266 @@
<?php
namespace Wrm\Events\Domain\Model;
/***
*
* This file is part of the "DD Events" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2019 Dirk Koritnik <koritnik@werkraum-media.de>
*
***/
/**
* Organizer
*/
class Organizer extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
/**
* name
*
* @var string
*/
protected $name = '';
/**
* street
*
* @var string
*/
protected $street = '';
/**
* district
*
* @var string
*/
protected $district = '';
/**
* city
*
* @var string
*/
protected $city = '';
/**
* zip
*
* @var string
*/
protected $zip = '';
/**
* phone
*
* @var string
*/
protected $phone = '';
/**
* web
*
* @var string
*/
protected $web = '';
/**
* email
*
* @var string
*/
protected $email = '';
/**
* Returns the name
*
* @return string $name
*/
public function getName()
{
return $this->name;
}
/**
* Sets the name
*
* @param string $name
* @return void
*/
public function setName($name)
{
$this->name = $name;
}
/**
* Returns the street
*
* @return string $street
*/
public function getStreet()
{
return $this->street;
}
/**
* Sets the street
*
* @param string $street
* @return void
*/
public function setStreet($street)
{
$this->street = $street;
}
/**
* Returns the district
*
* @return string $district
*/
public function getDistrict()
{
return $this->district;
}
/**
* Sets the district
*
* @param string $district
* @return void
*/
public function setDistrict($district)
{
$this->district = $district;
}
/**
* Returns the city
*
* @return string $city
*/
public function getCity()
{
return $this->city;
}
/**
* Sets the city
*
* @param string $city
* @return void
*/
public function setCity($city)
{
$this->city = $city;
}
/**
* Returns the zip
*
* @return string $zip
*/
public function getZip()
{
return $this->zip;
}
/**
* Sets the zip
*
* @param string $zip
* @return void
*/
public function setZip($zip)
{
$this->zip = $zip;
}
/**
* Returns the phone
*
* @return string $phone
*/
public function getPhone()
{
return $this->phone;
}
/**
* Sets the phone
*
* @param string $phone
* @return void
*/
public function setPhone($phone)
{
$this->phone = $phone;
}
/**
* Returns the web
*
* @return string $web
*/
public function getWeb()
{
return $this->web;
}
/**
* Sets the web
*
* @param string $web
* @return void
*/
public function setWeb($web)
{
$this->web = $web;
}
/**
* Returns the email
*
* @return string $email
*/
public function getEmail()
{
return $this->email;
}
/**
* Sets the email
*
* @param string $email
* @return void
*/
public function setEmail($email)
{
$this->email = $email;
}
/**
* __construct
*/
public function __construct()
{
//Do not remove the next line: It would break the functionality
$this->initStorageObjects();
}
/**
* Initializes all ObjectStorage properties
* Do not modify this method!
* It will be rewritten on each save in the extension builder
* You may modify the constructor of this class instead
*
* @return void
*/
protected function initStorageObjects()
{
}
}

View file

@ -0,0 +1,70 @@
<?php
namespace Wrm\Events\Domain\Model;
/***
*
* This file is part of the "DD Events" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2019 Dirk Koritnik <koritnik@werkraum-media.de>
*
***/
/**
* Region
*/
class Region extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
/**
* title
*
* @var string
*/
protected $title = '';
/**
* Returns the title
*
* @return string $title
*/
public function getTitle()
{
return $this->title;
}
/**
* Sets the title
*
* @param string $title
* @return void
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* __construct
*/
public function __construct()
{
//Do not remove the next line: It would break the functionality
$this->initStorageObjects();
}
/**
* Initializes all ObjectStorage properties
* Do not modify this method!
* It will be rewritten on each save in the extension builder
* You may modify the constructor of this class instead
*
* @return void
*/
protected function initStorageObjects()
{
}
}

View file

@ -0,0 +1,176 @@
<?php
namespace Wrm\Events\Domain\Repository;
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use Wrm\Events\Domain\Model\Dto\DateDemand;
use Wrm\Events\Domain\Model\Event;
use Wrm\Events\Service\CategoryService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{
/**
* Find all products based on selected uids
*
* @param string $uids
*
* @return array
*/
public function findByUids($uids)
{
$uids = explode(',', $uids);
$query = $this->createQuery();
//$query->getQuerySettings()->setRespectStoragePage(false);
$query->matching(
$query->in('uid', $uids)
);
//return $this->orderByField($query->execute(), $uids);
return $query->execute();
}
/**
* @param DateDemand $demand
* @return QueryResultInterface
* @throws InvalidQueryException
*/
public function findByDemand(DateDemand $demand)
{
$query = $this->createDemandQuery($demand);
// For testing purposes
// $query = $this->createDemandQueryViaBuilder($demand);
return $query->execute();
}
/**
* @param DateDemand $demand
* @return QueryInterface
* @throws InvalidQueryException
*/
protected function createDemandQuery(DateDemand $demand): QueryInterface
{
$query = $this->createQuery();
$constraints = [];
$categories = $demand->getCategories();
if ($categories) {
$categoryConstraints = $this->createCategoryConstraint($query, $categories, $demand->getIncludeSubCategories());
if ($demand->getCategoryCombination() === 'or') {
$constraints['categories'] = $query->logicalOr($categoryConstraints);
} else {
$constraints['categories'] = $query->logicalAnd($categoryConstraints);
}
}
if ($demand->getRegion() !== '') {
$constraints['region'] = $query->equals('event.region', $demand->getRegion());
}
if ($demand->getRegion() !== null) {
$constraints['highlight'] = $query->equals('event.highlight', $demand->getHighlight());
}
if ($demand->getLimit() !== '') {
$query->setLimit((int) $demand->getLimit());
}
if (!empty($constraints)) {
$query->matching($query->logicalAnd($constraints));
}
$sortBy = $demand->getSortBy();
if ($sortBy && $sortBy !== 'singleSelection' && $sortBy !== 'default') {
$order = strtolower($demand->getSortOrder()) === 'desc' ? QueryInterface::ORDER_DESCENDING : QueryInterface::ORDER_ASCENDING;
$query->setOrderings([$sortBy => $order]);
}
return $query;
}
/**
* @param QueryInterface $query
* @param string $categories
* @param bool $includeSubCategories
* @return array
* @throws InvalidQueryException
*/
protected function createCategoryConstraint(QueryInterface $query, $categories, bool $includeSubCategories = false): array
{
$constraints = [];
if ($includeSubCategories) {
$categoryService = GeneralUtility::makeInstance(CategoryService::class);
$allCategories = $categoryService->getChildrenCategories($categories);
if (!\is_array($allCategories)) {
$allCategories = GeneralUtility::intExplode(',', $allCategories, true);
}
} else {
$allCategories = GeneralUtility::intExplode(',', $categories, true);
}
foreach ($allCategories as $category) {
$constraints[] = $query->contains('event.categories', $category);
}
return $constraints;
}
/**
* @param DateDemand
* @return $statement
* @throws InvalidQueryException
*/
protected function createDemandQueryViaBuilder(DateDemand $demand) {
//$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_Events_domain_model_date');
$connection = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('tx_Events_domain_model_date');
$queryBuilder = $connection->createQueryBuilder();
$statement = $queryBuilder
->select('tx_Events_domain_model_date.start', 'tx_Events_domain_model_date.end', 'tx_Events_domain_model_date.event')
->from('tx_Events_domain_model_date')
->join(
'tx_Events_domain_model_date',
'tx_Events_domain_model_event',
'event',
$queryBuilder->expr()->eq('tx_Events_domain_model_date.event', $queryBuilder->quoteIdentifier('event.uid'))
)->where(
$queryBuilder->expr()->eq('event.title', $queryBuilder->createNamedParameter('Bachführung'))
);
if ($demand->getLimit() !== '') {
$statement->setMaxResults((int) $demand->getLimit());
}
return $statement;
}
}

View file

@ -0,0 +1,134 @@
<?php
namespace Wrm\Events\Domain\Repository;
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* 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\Extbase\Persistence\QueryInterface;
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
class EventRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{
/**
* Find all products based on selected uids
*
* @param string $uids
*
* @return array
*/
public function findByUids($uids)
{
$uids = explode(',', $uids);
$query = $this->createQuery();
//$query->getQuerySettings()->setRespectStoragePage(false);
$query->matching(
$query->in('uid', $uids)
);
//return $this->orderByField($query->execute(), $uids);
return $query->execute();
}
/**
* @param EventDemand $demand
* @return QueryResultInterface
* @throws InvalidQueryException
*/
public function findByDemand(EventDemand $demand)
{
$query = $this->createDemandQuery($demand);
return $query->execute();
}
/**
* @param EventDemand $demand
* @return QueryInterface
* @throws InvalidQueryException
*/
protected function createDemandQuery(EventDemand $demand): QueryInterface
{
$query = $this->createQuery();
// sorting
$sortBy = $demand->getSortBy();
if ($sortBy && $sortBy !== 'singleSelection' && $sortBy !== 'default') {
$order = strtolower($demand->getSortOrder()) === 'desc' ? QueryInterface::ORDER_DESCENDING : QueryInterface::ORDER_ASCENDING;
$query->setOrderings([$sortBy => $order]);
}
$constraints = [];
$categories = $demand->getCategories();
if ($categories) {
$categoryConstraints = $this->createCategoryConstraint($query, $categories, $demand->getIncludeSubCategories());
if ($demand->getCategoryCombination() === 'or') {
$constraints['categories'] = $query->logicalOr($categoryConstraints);
} else {
$constraints['categories'] = $query->logicalAnd($categoryConstraints);
}
}
if ($demand->getRegion() !== '') {
$constraints['region'] = $query->equals('region', $demand->getRegion());
}
if ($demand->getHighlight()) {
$constraints['highlight'] = $query->equals('highlight', $demand->getHighlight());
}
if ($demand->getLimit() !== '') {
$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
*/
protected function createCategoryConstraint(QueryInterface $query, $categories, bool $includeSubCategories = false): array
{
$constraints = [];
if ($includeSubCategories) {
$categoryService = GeneralUtility::makeInstance(CategoryService::class);
$allCategories = $categoryService->getChildrenCategories($categories);
if (!\is_array($allCategories)) {
$allCategories = GeneralUtility::intExplode(',', $allCategories, true);
}
} else {
$allCategories = GeneralUtility::intExplode(',', $categories, true);
}
foreach ($allCategories as $category) {
$constraints[] = $query->contains('categories', $category);
}
return $constraints;
}
}

View file

@ -0,0 +1,22 @@
<?php
namespace Wrm\Events\Domain\Repository;
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
class OrganizerRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{
}

View file

@ -0,0 +1,22 @@
<?php
namespace Wrm\Events\Domain\Repository;
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
class RegionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{
}

View file

@ -0,0 +1,116 @@
<?php
namespace Wrm\Events\Service;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\TimeTracker\TimeTracker;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class CategoryService
{
/** @var TimeTracker */
protected $timeTracker;
/** @var FrontendInterface */
protected $cache;
public function __construct()
{
$this->timeTracker = GeneralUtility::makeInstance(TimeTracker::class);
$this->cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_Events_category');
}
/**
* Get child categories by calling recursive function
* and using the caching framework to save some queries
*
* @param string $idList list of category ids to start
* @param int $counter
* @return string comma separated list of category ids
*/
public function getChildrenCategories($idList, int $counter = 0)
{
$cacheIdentifier = sha1('children' . $idList);
$entry = $this->cache->get($cacheIdentifier);
if (!$entry) {
$entry = $this->getChildrenCategoriesRecursive($idList, $counter);
$this->cache->set($cacheIdentifier, $entry);
}
return $entry;
}
/**
* Get child categories
*
* @param string $idList list of category ids to start
* @param int $counter
* @return string comma separated list of category ids
*/
protected function getChildrenCategoriesRecursive($idList, $counter = 0): string
{
$result = [];
// add id list to the output
if ($counter === 0) {
$newList = $this->getUidListFromRecords($idList);
if ($newList) {
$result[] = $newList;
}
}
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('sys_category');
$res = $queryBuilder
->select('uid')
->from('sys_category')
->where(
$queryBuilder->expr()->in('parent', $queryBuilder->createNamedParameter(explode(',', $idList), Connection::PARAM_INT_ARRAY))
)
->execute();
while ($row = $res->fetch()) {
$counter++;
if ($counter > 10000) {
$this->timeTracker->setTSlogMessage('EXT:dd_events: one or more recursive categories where found');
return implode(',', $result);
}
$subcategories = $this->getChildrenCategoriesRecursive($row['uid'], $counter);
$result[] = $row['uid'] . ($subcategories ? ',' . $subcategories : '');
}
$result = implode(',', $result);
return $result;
}
/**
* Fetch ids again from DB to avoid false positives
*
* @param string $idList
* @return string
*/
protected function getUidListFromRecords(string $idList): string
{
$list = [];
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('sys_category');
$rows = $queryBuilder
->select('uid')
->from('sys_category')
->where(
$queryBuilder->expr()->in('uid', $queryBuilder->createNamedParameter(explode(',', $idList), Connection::PARAM_INT_ARRAY))
)
->execute()
->fetchAll();
foreach ($rows as $row) {
$list[] = $row['uid'];
}
return implode(',', $list);
}
}

View file

@ -0,0 +1,6 @@
<?php
return [
'events:import' => [
'class' => \Wrm\Events\Command\ImportCommand::class
]
];

View file

@ -0,0 +1,101 @@
#
# 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

@ -0,0 +1,397 @@
<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>
</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">Default</numIndex>
<numIndex index="1">default</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">Title</numIndex>
<numIndex index="1">title</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">Region</numIndex>
<numIndex index="1">region</numIndex>
</numIndex>
</items>
<!--
<itemsProcFunc>FriendsOfTYPO3\TtAddress\Hooks\Tca\AddFieldsToSelector->main</itemsProcFunc>
-->
</config>
</TCEforms>
</settings.sortByEvent>
<settings.sortByDate>
<TCEforms>
<exclude>1</exclude>
<label>Sort By</label>
<displayCond>FIELD:switchableControllerActions:=:Date->list</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">Start</numIndex>
<numIndex index="1">start</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">End</numIndex>
<numIndex index="1">end</numIndex>
</numIndex>
</items>
<!--
<itemsProcFunc>FriendsOfTYPO3\TtAddress\Hooks\Tca\AddFieldsToSelector->main</itemsProcFunc>
-->
</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>
</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>
</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:=:Date->list</numIndex>
<numIndex index="3">FIELD:switchableControllerActions:=:Date->teaser</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 @@
<?php
defined('TYPO3_MODE') or die();
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'
);
});

View file

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

View file

@ -0,0 +1,166 @@
<?php
return [
'ctrl' => [
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_date',
'label' => 'start',
'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',
'starttime' => 'starttime',
'endtime' => 'endtime',
],
'searchFields' => '',
'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_date.gif'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, start, end',
],
'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'],
],
'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',
'exclude' => true,
'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_date',
'foreign_table_where' => 'AND {#tx_events_domain_model_date}.{#pid}=###CURRENT_PID### AND {#tx_events_domain_model_date}.{#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
]
],
],
],
'starttime' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'eval' => 'datetime,int',
'default' => 0,
'behaviour' => [
'allowLanguageSynchronization' => true
]
],
],
'endtime' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'eval' => 'datetime,int',
'default' => 0,
'range' => [
'upper' => mktime(0, 0, 0, 1, 1, 2038)
],
'behaviour' => [
'allowLanguageSynchronization' => true
]
],
],
'start' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_date.start',
'config' => [
'dbType' => 'datetime',
'type' => 'input',
'renderType' => 'inputDateTime',
'size' => 12,
'eval' => 'datetime',
'default' => null,
],
],
'end' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_date.end',
'config' => [
'dbType' => 'datetime',
'type' => 'input',
'renderType' => 'inputDateTime',
'size' => 12,
'eval' => 'datetime',
'default' => null,
],
],
/*
'event' => [
'config' => [
'type' => 'passthrough',
],
],
*/
'event' => array(
'exclude' => 1,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_date.event',
'config' => array(
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'tx_events_domain_model_event',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
'readOnly' =>1,
)
)
],
];

View file

@ -0,0 +1,445 @@
<?php
return [
'ctrl' => [
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event',
'label' => 'title',
'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',
'starttime' => 'starttime',
'endtime' => 'endtime',
],
'searchFields' => 'title,global_id,slug,teaser,details,price_info,street,district,city,zip,country,web,booking,ticket,facebook,youtube,latitude,longitude',
'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_event.gif'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, global_id, slug, highlight, teaser, details, price_info, street, district, city, zip, country, web, booking, ticket, facebook, youtube, latitude, longitude, images, categories, dates, organizer, region',
],
'types' => [
'1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, global_id, slug, highlight, teaser, details, price_info, street, district, city, zip, country, web, booking, ticket, facebook, youtube, latitude, longitude, images, categories, dates, organizer, region, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
],
'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',
'exclude' => true,
'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_event',
'foreign_table_where' => 'AND {#tx_events_domain_model_event}.{#pid}=###CURRENT_PID### AND {#tx_events_domain_model_event}.{#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
]
],
],
],
'starttime' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'eval' => 'datetime,int',
'default' => 0,
'behaviour' => [
'allowLanguageSynchronization' => true
]
],
],
'endtime' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'eval' => 'datetime,int',
'default' => 0,
'range' => [
'upper' => mktime(0, 0, 0, 1, 1, 2038)
],
'behaviour' => [
'allowLanguageSynchronization' => true
]
],
],
'title' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.title',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
]
],
'global_id' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.global_id',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'slug' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.slug',
'config' => [
'type' => 'slug',
'size' => 50,
'generatorOptions' => [
'fields' => ['title'],
'fieldSeparator' => '/',
'prefixParentPageSlug' => false,
],
'fallbackCharacter' => '-',
'eval' => 'uniqueInSite',
'default' => '',
],
],
/*
'slug' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.slug',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
*/
'highlight' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.highlight',
'config' => [
'type' => 'check',
'items' => [
'1' => [
'0' => 'LLL:EXT:lang/locallang_core.xlf:labels.enabled'
]
],
'default' => 0,
]
],
'teaser' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.teaser',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim'
]
],
'details' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.details',
'config' => [
'type' => 'text',
'enableRichtext' => true,
'richtextConfiguration' => 'default',
'fieldControl' => [
'fullScreenRichtext' => [
'disabled' => false,
],
],
'cols' => 40,
'rows' => 15,
'eval' => 'trim',
],
],
'price_info' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.price_info',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim'
]
],
'street' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.street',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'district' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.district',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'city' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.city',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'zip' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.zip',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'country' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.country',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'web' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.web',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'booking' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.booking',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'ticket' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.ticket',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'facebook' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.facebook',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'youtube' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.youtube',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'latitude' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.latitude',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'longitude' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.longitude',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'images' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.images',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'images',
[
'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference',
'showPossibleLocalizationRecords' => true,
'showRemovedLocalizationRecords' => true,
'showAllLocalizationLink' => true,
'showSynchronizationLink' => true,
],
'foreign_match_fields' => [
'fieldname' => 'images',
'tablenames' => 'tx_events_domain_model_event',
'table_local' => 'sys_file',
],
'foreign_types' => [
'0' => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
]
],
'maxitems' => 1
],
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
),
],
'categories' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.categories',
'config' => [
'type' => 'input',
'size' => 4,
'eval' => 'int'
]
],
'dates' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.dates',
'config' => [
'type' => 'inline',
'foreign_table' => 'tx_events_domain_model_date',
'foreign_field' => 'event',
'maxitems' => 9999,
'appearance' => [
'collapseAll' => 1,
'useSortable' => 0,
'expandSingle' => 1,
'enabledControls' => array(
'info' => false,
'new' => false,
'dragdrop' => false,
'sort' => false,
'hide' => false,
'delete' => false,
'localize' => false,
),
'levelLinksPosition' => 'top',
'showPossibleLocalizationRecords' => false,
'showRemovedLocalizationRecords' => false,
'showSynchronizationLink' => false,
'showAllLocalizationLink' => false,
],
],
],
'organizer' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.organizer',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'tx_events_domain_model_organizer',
'minitems' => 0,
'maxitems' => 1,
],
],
'region' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.region',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'tx_events_domain_model_region',
'minitems' => 0,
'maxitems' => 1,
],
],
],
];

View file

@ -0,0 +1,193 @@
<?php
return [
'ctrl' => [
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_organizer',
'label' => 'name',
'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',
'starttime' => 'starttime',
'endtime' => 'endtime',
],
'searchFields' => 'name,street,district,city,zip,phone,web,email',
'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_organizer.gif'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, street, district, city, zip, phone, web, email',
],
'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'],
],
'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',
'exclude' => true,
'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_organizer',
'foreign_table_where' => 'AND {#tx_events_domain_model_organizer}.{#pid}=###CURRENT_PID### AND {#tx_events_domain_model_organizer}.{#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
]
],
],
],
'starttime' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'eval' => 'datetime,int',
'default' => 0,
'behaviour' => [
'allowLanguageSynchronization' => true
]
],
],
'endtime' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'eval' => 'datetime,int',
'default' => 0,
'range' => [
'upper' => mktime(0, 0, 0, 1, 1, 2038)
],
'behaviour' => [
'allowLanguageSynchronization' => true
]
],
],
'name' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_organizer.name',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'street' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_organizer.street',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'district' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_organizer.district',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'city' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_organizer.city',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'zip' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_organizer.zip',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'phone' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_organizer.phone',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'web' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_organizer.web',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'email' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_organizer.email',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
],
];

View file

@ -0,0 +1,130 @@
<?php
return [
'ctrl' => [
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_region',
'label' => 'title',
'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',
'starttime' => 'starttime',
'endtime' => 'endtime',
],
'searchFields' => 'title',
'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_region.gif'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title',
],
'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'],
],
'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',
'exclude' => true,
'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_region',
'foreign_table_where' => 'AND {#tx_events_domain_model_region}.{#pid}=###CURRENT_PID### AND {#tx_events_domain_model_region}.{#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
]
],
],
],
'starttime' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'eval' => 'datetime,int',
'default' => 0,
'behaviour' => [
'allowLanguageSynchronization' => true
]
],
],
'endtime' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'eval' => 'datetime,int',
'default' => 0,
'range' => [
'upper' => mktime(0, 0, 0, 1, 1, 2038)
],
'behaviour' => [
'allowLanguageSynchronization' => true
]
],
],
'title' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_region.title',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
],
];

View file

@ -0,0 +1,15 @@
plugin.tx_events {
view {
# cat=plugin.tx_ddevents/file; type=string; label=Path to template root (FE)
templateRootPath = EXT:events/Resources/Private/Templates/
# cat=plugin.tx_ddevents/file; type=string; label=Path to template partials (FE)
partialRootPath = EXTevents/Resources/Private/Partials/
# cat=plugin.tx_ddevents/file; type=string; label=Path to template layouts (FE)
layoutRootPath = EXT:events/Resources/Private/Layouts/
}
persistence {
# cat=plugin.tx_ddevents//a; type=string; label=Default storage PID
storagePid =
}
}

View file

@ -0,0 +1,49 @@
plugin.tx_events {
view {
templateRootPaths {
0 = EXT:events/Resources/Private/Templates/
1 = {$plugin.tx_events.view.templateRootPath}
}
partialRootPaths {
0 = EXT:events/Resources/Private/Partials/
1 = {$plugin.tx_events.view.partialRootPath}
}
layoutRootPaths {
0 = EXT:events/Resources/Private/Layouts/
1 = {$plugin.tx_events.view.layoutRootPath}
}
widget {
TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper {
templateRootPath = {$plugin.tx_events.view.templateRootPath}
}
}
}
persistence {
storagePid = {$plugin.tx_events.persistence.storagePid}
recursive = 1
}
features {
#skipDefaultArguments = 1
# if set to 1, the enable fields are ignored in BE context
ignoreAllEnableFieldsInBe = 0
# Should be on by default, but can be disabled if all action in the plugin are uncached
requireCHashArgumentForActionArguments = 1
}
mvc {
#callDefaultActionIfActionCantBeResolved = 1
}
settings {
defaulDetailEventsPid =
defaultDetailDatesPid =
paginate {
# can be overriden by plugin
itemsPerPage = 10
insertAbove = 0
insertBelow = 1
maximumNumberOfLinks = 10
}
}
}

View file

@ -0,0 +1,82 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. include:: ../Includes.txt
.. _admin-manual:
Administrator Manual
====================
Target group: **Administrators**
Describes how to manage the extension from an administrator point of view.
That relates to Page/User TSconfig, permissions, configuration etc.,
which administrator level users have access to.
Language should be non / semi-technical, explaining, using small examples.
.. _admin-installation:
Installation
------------
- How should the extension be installed?
- Are they dependencies to resolve?
- Is it a static template file to be included?
To install the extension, perform the following steps:
#. Go to the Extension Manager
#. Install the extension
#. Load the static template
#. ...
For a list of configuration options, using a definition list is recommended:
Some Configuration
This option enables...
Other configuration
This other option is for all the rest...
.. figure:: ../Images/AdministratorManual/ExtensionManager.png
:alt: Extension Manager
Extension Manager (caption of the image)
List of extensions within the Extension Manager also shorten with "EM" (legend of the image)
.. _admin-configuration:
Configuration
-------------
* Where and how the extension should be configured? TypoScript? PHP?
* Are there other prerequisite to full fill beforehand?
For example, configure a setting in a special way somewhere.
.. _admin-faq:
FAQ
---
Possible subsection: FAQ
Subsection
^^^^^^^^^^
Some subsection
Sub-subsection
""""""""""""""
Deeper into the structure...

View file

@ -0,0 +1,16 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. include:: ../Includes.txt
.. _changelog:
ChangeLog
=========
Providing a change log chapter is optional. You can also refer
users to the ChangeLog file inside the extension or to some repository's
commit listing.

View file

@ -0,0 +1,106 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. include:: ../Includes.txt
.. _configuration:
Configuration Reference
=======================
Technical information: Installation, Reference of TypoScript options,
configuration options on system level, how to extend it, the technical
details, how to debug it and so on.
Language should be technical, assuming developer knowledge of TYPO3.
Small examples/visuals are always encouraged.
Target group: **Developers**
.. _configuration-typoscript:
TypoScript Reference
--------------------
Possible subsections: Reference of TypoScript options.
The construct below show the recommended structure for
TypoScript properties listing and description.
Properties should be listed in the order in which they
are executed by your extension, but the first should be
alphabetical for easier access.
When detailing data types or standard TypoScript
features, don't hesitate to cross-link to the TypoScript
Reference as shown below. See the :file:`Settings.yml`
file for the declaration of cross-linking keys.
Properties
^^^^^^^^^^
.. container:: ts-properties
=========================== ===================================== ======================= ====================
Property Data type :ref:`t3tsref:stdwrap` Default
=========================== ===================================== ======================= ====================
allWrap_ :ref:`t3tsref:data-type-wrap` yes :code:`<div>|</div>`
`subst\_elementUid`_ :ref:`t3tsref:data-type-boolean` no 0
wrapItemAndSub_ :ref:`t3tsref:data-type-wrap`
=========================== ===================================== ======================= ====================
Property details
^^^^^^^^^^^^^^^^
.. only:: html
.. contents::
:local:
:depth: 1
.. _ts-plugin-tx-extensionkey-stdwrap:
allWrap
"""""""
:typoscript:`plugin.tx_extensionkey.allWrap =` :ref:`t3tsref:data-type-wrap`
Wraps the whole item.
.. _ts-plugin-tx-extensionkey-wrapitemandsub:
wrapItemAndSub
""""""""""""""
:typoscript:`plugin.tx_extensionkey.wrapItemAndSub =` :ref:`t3tsref:data-type-wrap`
Wraps the whole item and any submenu concatenated to it.
.. _ts-plugin-tx-extensionkey-substelementUid:
subst_elementUid
""""""""""""""""
:typoscript:`plugin.tx_extensionkey.subst_elementUid =` :ref:`t3tsref:data-type-boolean`
If set, all appearances of the string ``{elementUid}`` in the total
element html-code (after wrapped in allWrap_) are substituted with the
uid number of the menu item. This is useful if you want to insert an
identification code in the HTML in order to manipulate properties with
JavaScript.
.. _configuration-faq:
FAQ
---
Possible subsection: FAQ

View file

@ -0,0 +1,60 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. include:: ../Includes.txt
.. _developer:
Developer Corner
================
Target group: **Developers**
Use this section for *providing code examples* or any **useful** information code wise.
.. _developer-hooks:
Hooks
-----
Possible hook examples. Input parameters are:
+----------------+---------------+---------------------------------+
| Parameter | Data type | Description |
+================+===============+=================================+
| $table | string | Name of the table |
+----------------+---------------+---------------------------------+
| $field | string | Name of the field |
+----------------+---------------+---------------------------------+
Use parameter :code:`$table` to retrieve the table name...
.. _developer-api:
API
---
How to use the API...
.. code-block:: php
$stuff = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'\\Foo\\Bar\\Utility\\Stuff'
);
$stuff->do();
or some other language:
.. code-block:: javascript
:linenos:
:emphasize-lines: 2-4
$(document).ready(
function () {
doStuff();
}
);

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

View file

@ -0,0 +1,21 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. This is 'Includes.txt'. It is included at the very top of each and
every ReST source file in this documentation project (= manual).
.. ==================================================
.. DEFINE SOME TEXT ROLES
.. --------------------------------------------------
.. role:: typoscript(code)
.. role:: ts(typoscript)
:class: typoscript
.. role:: php(code)
.. highlight:: php

64
Documentation/Index.rst Normal file
View file

@ -0,0 +1,64 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. include:: Includes.txt
.. _start:
=============================================================
DD Events
=============================================================
.. only:: html
:Classification:
dd_events
:Version:
|release|
:Language:
en
:Description:
Extension to manage Destination Data managed events
:Keywords:
comma,separated,list,of,keywords
:Copyright:
2019
:Author:
Dirk Koritnik
:Email:
koritnik@werkraum-media.de
:License:
This document is published under the Open Content License
available from http://www.opencontent.org/opl.shtml
:Rendered:
|today|
The content of this document is related to TYPO3,
a GNU/GPL CMS/Framework available from `www.typo3.org <http://www.typo3.org/>`_.
**Table of Contents**
.. toctree::
:maxdepth: 3
:titlesonly:
Introduction/Index
User/Index
Administrator/Index
Configuration/Index
Developer/Index
KnownProblems/Index
ToDoList/Index
ChangeLog/Index
Links

View file

@ -0,0 +1,46 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. include:: ../Includes.txt
.. _introduction:
Introduction
============
.. _what-it-does:
What does it do?
----------------
This chapter should give a brief overview of the extension. What does it do? What problems does it solve?
Who is interested in this? Basically, this section includes everything people need to know to decide whether they
should go on with this extension or not.
.. important::
Please don't forget to repeat your extension's version number in the
:file:`Settings.yml` file, in the :code:`release` property. It will be
automatically picked up on the cover page by the :code:`|release|`
substitution.
.. _screenshots:
Screenshots
-----------
This chapter should help people figure how the extension works. Remove it
if not relevant.
.. figure:: ../Images/IntroductionPackage.png
:width: 500px
:alt: Introduction Package
Introduction Package just after installation (caption of the image)
How the Frontend of the Introduction Package looks like just after installation (legend of the image)

View file

@ -0,0 +1,17 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. include:: ../Includes.txt
.. _known-problems:
Known Problems
==============
Say where bugs can be reported / followed up. Is it a
`bug tracker <http://forge.typo3.org/projects/typo3cms-doc-official-extension-template/issues>`_?
Use this section for informing about any type of of problem
that are not necessarily named in the bug tracker such as performance issues, ...

24
Documentation/Links.rst Normal file
View file

@ -0,0 +1,24 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. include:: Includes.txt
.. _links:
Links
-----
:TER:
https://typo3.org/extensions/repository/view/<extension key>
:Bug Tracker:
https://forge.typo3.org/projects/extension-<extension key>/issues
:Git Repository:
https://github.com/<username>/<extension key>
:Contact:
`@<username> <https://twitter.com/your-username>`__

View file

@ -0,0 +1,65 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. include:: ../Includes.txt
.. _start:
=============================================================
###PROJECT_NAME### (Deutsch)
=============================================================
.. only:: html
:Klassifikation:
extension_key
:Version:
|release|
:Sprache:
de
:Beschreibung:
Geben Sie eine Beschreibung ein.
:Schlüsselwörter:
komma-getrennte,Liste,von,Schlüsselwörtern
:Copyright:
###YEAR###
:Autor:
###AUTHOR###
:E-Mail:
author@example.com
:Lizenz:
Dieses Dokument wird unter der Open Publication License, siehe
http://www.opencontent.org/openpub/ veröffentlicht.
:Gerendert:
|today|
Der Inhalt dieses Dokuments bezieht sich auf TYPO3,
ein GNU/GPL CMS-Framework auf `www.typo3.org <https://typo3.org/>`__.
**Inhaltsverzeichnis**
.. toctree::
:maxdepth: 3
:titlesonly:
.. Introduction/Index
.. UserManual/Index
.. AdministratorManual/Index
.. Configuration/Index
.. DeveloperCorner/Index
.. KnownProblems/Index
.. ToDoList/Index
.. ChangeLog/Index

View file

@ -0,0 +1,24 @@
How to translate
================
This directory contains the German translation of your documentation.
This is a complete Sphinx project but you may reuse assets from the
main documentation under Documentation/.
If you plan to translate your documentation to German, you should
rename this directory and remove the suffix ".tmpl":
Localization.de_DE.tmpl -> Localization.de_DE
As this file is not needed either, feel free to delete it as well.
Supported languages
===================
Please visit http://sphinx-doc.org/latest/config.html#intl-options for a
list of languages supported by Sphinx.
Please note however that TYPO3 is using locales so you may need to
extend the language code from Sphinx into a proper locale to be used
by TYPO3.

View file

@ -0,0 +1,29 @@
# This is the project specific Settings.yml file.
# Place Sphinx specific build information here.
# Settings given here will replace the settings of 'conf.py'.
# Below is an example of intersphinx mapping declaration
# Add more mappings depending on what manual you want to link to
# Remove entirely if you don't need cross-linking
---
conf.py:
copyright: 2012-2015
project: Extension Name (Deutsch)
version: x.y
release: x.y.z
intersphinx_mapping:
t3tsref:
- https://docs.typo3.org/typo3cms/TyposcriptReference/
- null
latex_documents:
- - Index
- <extension_key>.tex
- Extension Name (Français)
- Your Name
- manual
latex_elements:
papersize: a4paper
pointsize: 10pt
preamble: \usepackage{typo3}
...

View file

@ -0,0 +1,65 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. include:: ../Includes.txt
.. _start:
=============================================================
###PROJECT_NAME### (Français)
=============================================================
.. only:: html
:Classification:
extension_key
:Version:
|release|
:Langue:
fr
:Description:
entrez une description.
:Mots-clés:
list,mots-clés,séparés,par,virgules
:Copyright:
###YEAR###
:Auteur:
###AUTHOR###
:E-mail:
author@example.com
:Licence:
Ce document est publié sous la licence de publication libre
disponible sur http://www.opencontent.org/openpub/
:Généré:
|today|
Le contenu de ce document est en relation avec TYPO3,
un CMS/Framework GNU/GPL disponible sur `www.typo3.org <https://typo3.org/>`__.
**Sommaire**
.. toctree::
:maxdepth: 3
:titlesonly:
.. Introduction/Index
.. UserManual/Index
.. AdministratorManual/Index
.. Configuration/Index
.. DeveloperCorner/Index
.. KnownProblems/Index
.. ToDoList/Index
.. ChangeLog/Index

View file

@ -0,0 +1,24 @@
How to translate
================
This directory contains the French translation of your documentation.
This is a complete Sphinx project but you may reuse assets from the
main documentation under Documentation/.
If you plan to translate your documentation to French, you should
rename this directory and remove the suffix ".tmpl":
Localization.fr_FR.tmpl -> Localization.fr_FR
As this file is not needed either, feel free to delete it as well.
Supported languages
===================
Please visit http://sphinx-doc.org/latest/config.html#intl-options for a
list of languages supported by Sphinx.
Please note however that TYPO3 is using locales so you may need to
extend the language code from Sphinx into a proper locale to be used
by TYPO3.

View file

@ -0,0 +1,29 @@
# This is the project specific Settings.yml file.
# Place Sphinx specific build information here.
# Settings given here will replace the settings of 'conf.py'.
# Below is an example of intersphinx mapping declaration
# Add more mappings depending on what manual you want to link to
# Remove entirely if you don't need cross-linking
---
conf.py:
copyright: 2012-2015
project: Extension Name (Français)
version: x.y
release: x.y.z
intersphinx_mapping:
t3tsref:
- https://docs.typo3.org/typo3cms/TyposcriptReference/
- null
latex_documents:
- - Index
- <extension_key>.tex
- Extension Name (Français)
- Your Name
- manual
latex_elements:
papersize: a4paper
pointsize: 10pt
preamble: \usepackage{typo3}
...

View file

@ -0,0 +1,32 @@
# This is the project specific Settings.yml file.
# Place Sphinx specific build information here.
# Settings given here will replace the settings of 'conf.py'.
# Below is an example of intersphinx mapping declaration
# Add more mappings depending on what manual you want to link to
# Remove entirely if you don't need cross-linking
---
conf.py:
copyright: 2019
project: DD Events
version: 1.0.0
release: 1.0.0
intersphinx_mapping:
t3tsref:
- http://docs.typo3.org/typo3cms/TyposcriptReference/
- null
latex_documents:
- - Index
- dd_events.tex
- DD Events
- Dirk Koritnik
- manual
latex_elements:
papersize: a4paper
pointsize: 10pt
preamble: \usepackage
html_theme_options:
github_repository: TYPO3-Documentation/TYPO3CMS-Example-ExtensionManual
github_branch: latest
...

View file

@ -0,0 +1,16 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. include:: ../Includes.txt
.. _todo:
To-Do list
==========
Give a link pointing to a `roadmap <http://forge.typo3.org/projects/typo3cms-doc-official-extension-template/roadmap>`_.
Alternatively, you can dress up a list of things you want to add or fix in this chapter
or give a vision about where the extension is heading.

View file

@ -0,0 +1,67 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. include:: ../Includes.txt
.. _user-manual:
Users Manual
============
Target group: **Editors**
Here should be described how to use the extension from the editor perspective.
- How does it work?
- works well when doing this.
- does not work so well when doing that
but we can live with it.
- **mind indentation when nesting lists**.
- How to install the plugin on a web page?
- What options are available?
Language should be non-technical, explaining, using small examples.
Don't use to many acronyms unless they have been explained.
Don't be confusing by putting information targeting administrators.
.. tip::
Take a break from time to time.
Admonitions should be used to warn the users about potential
pitfalls, attract their attention to important elements
or just add some notes for for information (further reading,
for example).
.. important::
Remember to always say "please" when asking your software to
do something.
Provide screenshots as needed for making things clear. When creating
screenshots, try using the `Introduction Package <http://demo.typo3.org/>`_
as a neutral TYPO3 CMS instance.
.. figure:: ../Images/UserManual/BackendView.png
:width: 500px
:alt: Backend view
Default Backend view (caption of the image)
The Backend view of TYPO3 after the user has clicked on module "Page". (legend of the image)
.. _user-faq:
FAQ
---
Possible subsection: FAQ

638
ExtensionBuilder.json Normal file
View file

@ -0,0 +1,638 @@
{
"modules": [
{
"config": {
"position": [
830,
5
]
},
"name": "New Model Object",
"value": {
"actionGroup": {
"_default0_list": true,
"_default1_show": true,
"_default2_new_create": false,
"_default3_edit_update": false,
"_default4_delete": false,
"customActions": [
"teaser"
]
},
"name": "Event",
"objectsettings": {
"addDeletedField": true,
"addHiddenField": true,
"addStarttimeEndtimeFields": true,
"aggregateRoot": false,
"categorizable": false,
"description": "",
"mapToTable": "",
"parentClass": "",
"sorting": false,
"type": "Entity",
"uid": "109921408756"
},
"propertyGroup": {
"properties": [
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "title",
"propertyType": "Text",
"uid": "102409777447"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "globalId",
"propertyType": "String",
"uid": "1312474499176"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "slug",
"propertyType": "String",
"uid": "1365923328864"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "highlight",
"propertyType": "Boolean",
"uid": "702208098957"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "teaser",
"propertyType": "Text",
"uid": "1507172184308"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "details",
"propertyType": "RichText",
"uid": "314424153167"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "priceInfo",
"propertyType": "Text",
"uid": "448596702496"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "street",
"propertyType": "String",
"uid": "517245651530"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "district",
"propertyType": "String",
"uid": "701548922501"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "city",
"propertyType": "String",
"uid": "565150091343"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "zip",
"propertyType": "String",
"uid": "1052357865101"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "country",
"propertyType": "String",
"uid": "437952486493"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "web",
"propertyType": "String",
"uid": "886851132875"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "booking",
"propertyType": "String",
"uid": "1258790658884"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "ticket",
"propertyType": "String",
"uid": "832122856559"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "facebook",
"propertyType": "String",
"uid": "1386671701366"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "youtube",
"propertyType": "String",
"uid": "1246060567520"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "latitude",
"propertyType": "String",
"uid": "1312904595125"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "longitude",
"propertyType": "String",
"uid": "671898304575"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "images",
"propertyType": "Image",
"uid": "259140197650"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "categories",
"propertyType": "Integer",
"uid": "677483446855"
}
]
},
"relationGroup": {
"relations": [
{
"foreignRelationClass": "",
"lazyLoading": false,
"propertyIsExcludeField": true,
"relationDescription": "",
"relationName": "dates",
"relationType": "zeroToMany",
"relationWire": "[wired]",
"renderType": "inline",
"uid": "120463841009"
},
{
"foreignRelationClass": "",
"lazyLoading": false,
"propertyIsExcludeField": true,
"relationDescription": "",
"relationName": "organizer",
"relationType": "manyToOne",
"relationWire": "[wired]",
"renderType": "selectSingle",
"uid": "272437572533"
},
{
"foreignRelationClass": "",
"lazyLoading": false,
"propertyIsExcludeField": true,
"relationDescription": "",
"relationName": "region",
"relationType": "manyToOne",
"relationWire": "[wired]",
"renderType": "selectSingle",
"uid": "1093126928530"
}
]
}
}
},
{
"config": {
"position": [
315,
132
]
},
"name": "New Model Object",
"value": {
"actionGroup": {
"_default0_list": false,
"_default1_show": false,
"_default2_new_create": false,
"_default3_edit_update": false,
"_default4_delete": false,
"customActions": []
},
"name": "Organizer",
"objectsettings": {
"addDeletedField": true,
"addHiddenField": true,
"addStarttimeEndtimeFields": true,
"aggregateRoot": false,
"categorizable": false,
"description": "",
"mapToTable": "",
"parentClass": "",
"sorting": false,
"type": "Entity",
"uid": "853312122030"
},
"propertyGroup": {
"properties": [
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "name",
"propertyType": "String",
"uid": "1039029201328"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "street",
"propertyType": "String",
"uid": "332930486259"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "district",
"propertyType": "String",
"uid": "1300937445752"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "city",
"propertyType": "String",
"uid": "114683887277"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "zip",
"propertyType": "String",
"uid": "390187572664"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "phone",
"propertyType": "String",
"uid": "16157077259"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "web",
"propertyType": "String",
"uid": "106668624565"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "email",
"propertyType": "String",
"uid": "837795943910"
}
]
},
"relationGroup": {
"relations": []
}
}
},
{
"config": {
"position": [
318,
376
]
},
"name": "New Model Object",
"value": {
"actionGroup": {
"_default0_list": true,
"_default1_show": true,
"_default2_new_create": false,
"_default3_edit_update": false,
"_default4_delete": false,
"customActions": [
"teaser"
]
},
"name": "Date",
"objectsettings": {
"addDeletedField": true,
"addHiddenField": true,
"addStarttimeEndtimeFields": true,
"aggregateRoot": false,
"categorizable": false,
"description": "",
"mapToTable": "",
"parentClass": "",
"sorting": false,
"type": "Entity",
"uid": "19849981223"
},
"propertyGroup": {
"properties": [
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "start",
"propertyType": "NativeDateTime",
"uid": "1175274648657"
},
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "end",
"propertyType": "NativeDateTime",
"uid": "119149519780"
}
]
},
"relationGroup": {
"relations": []
}
}
},
{
"config": {
"position": [
315,
613
]
},
"name": "New Model Object",
"value": {
"actionGroup": {
"_default0_list": false,
"_default1_show": false,
"_default2_new_create": false,
"_default3_edit_update": false,
"_default4_delete": false,
"customActions": []
},
"name": "Region",
"objectsettings": {
"addDeletedField": true,
"addHiddenField": true,
"addStarttimeEndtimeFields": true,
"aggregateRoot": false,
"categorizable": false,
"description": "",
"mapToTable": "",
"parentClass": "",
"sorting": false,
"type": "Entity",
"uid": "425722520612"
},
"propertyGroup": {
"properties": [
{
"allowedFileTypes": "",
"maxItems": "1",
"propertyDescription": "",
"propertyIsExcludeField": true,
"propertyIsL10nModeExclude": false,
"propertyIsRequired": false,
"propertyName": "title",
"propertyType": "String",
"uid": "1316430837945"
}
]
},
"relationGroup": {
"relations": []
}
}
}
],
"properties": {
"backendModules": [],
"description": "Extension to manage Destination Data managed events",
"emConf": {
"category": "plugin",
"custom_category": "",
"dependsOn": "typo3 => 9.5.0-9.5.99\n",
"disableLocalization": false,
"disableVersioning": false,
"skipGenerateDocumentationTemplate": false,
"sourceLanguage": "en",
"state": "alpha",
"targetVersion": "9.5.0-9.5.99",
"version": "1.0.0"
},
"extensionKey": "dd_events",
"name": "DD Events",
"originalExtensionKey": "dd_events",
"originalVendorName": "Wrm",
"persons": [
{
"company": "",
"email": "koritnik@werkraum-media.de",
"name": "Dirk Koritnik",
"role": "Developer"
}
],
"plugins": [
{
"actions": {
"controllerActionCombinations": "Event=>teaser, list, show\nDate=>teaser, list, show",
"noncacheableActions": "Event=>teaser, list, show\nDate=>teaser, list, show",
"switchableActions": "Display Events\nEvent=>teaser; Event=>list; Event=>show\nDisplay Dates\nDate=>teaser; Date=>list; Date=>show"
},
"description": "",
"key": "ddevents",
"name": "DD Events"
}
],
"vendorName": "Wrm"
},
"wires": [
{
"src": {
"moduleId": 0,
"terminal": "relationWire_0",
"uid": "120463841009"
},
"tgt": {
"moduleId": 2,
"terminal": "SOURCES",
"uid": "19849981223"
}
},
{
"src": {
"moduleId": 0,
"terminal": "relationWire_1",
"uid": "272437572533"
},
"tgt": {
"moduleId": 1,
"terminal": "SOURCES",
"uid": "853312122030"
}
},
{
"src": {
"moduleId": 0,
"terminal": "relationWire_2",
"uid": "1093126928530"
},
"tgt": {
"moduleId": 3,
"terminal": "SOURCES",
"uid": "425722520612"
}
}
],
"log": {
"last_modified": "2019-04-03 12:11",
"extension_builder_version": "9.10.0",
"be_user": "Dirk Koritnik (1)"
}
}

20
README.md Normal file
View file

@ -0,0 +1,20 @@
### Destination Data Event Import Extension
##### Start Symfony Command to import Events local
TYPO3_CONTEXT=Development php vendor/bin/typo3 events:import
##### Start Symfony Command to import Events on Stage
TYPO3_CONTEXT=Production/Staging /usr/local/bin/php7.1.6-cli typo3cms/stage.thueringer-staedte.de/current/vendor/bin/typo3 events:import
##### Clean category relations
TRUNCATE TABLE tx_events_domain_model_event;
TRUNCATE TABLE tx_events_domain_model_date;
TRUNCATE TABLE tx_events_domain_model_organizer;
DELETE FROM sys_category_record_mm WHERE tablenames = 'tx_events_domain_model_event';
DELETE FROM sys_file_reference WHERE tablenames = 'tx_events_domain_model_event';
DELETE FROM sys_file WHERE identifier LIKE '%/events/%';
DELETE FROM sys_file_metadata alternative = 'DD Import';

View file

@ -0,0 +1,11 @@
# Apache < 2.3
<IfModule !mod_authz_core.c>
Order allow,deny
Deny from all
Satisfy All
</IfModule>
# Apache >= 2.3
<IfModule mod_authz_core.c>
Require all denied
</IfModule>

View file

@ -0,0 +1,125 @@
<?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="dd_events">
<header/>
<body>
<trans-unit id="tx_events_domain_model_event">
<source>Event</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.title">
<source>Title</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.global_id">
<source>Global Id</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.slug">
<source>Slug</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.highlight">
<source>Highlight</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.teaser">
<source>Teaser</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.details">
<source>Details</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.price_info">
<source>Price Info</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.street">
<source>Street</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.district">
<source>District</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.city">
<source>City</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.zip">
<source>Zip</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.country">
<source>Country</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.web">
<source>Web</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.booking">
<source>Booking</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.ticket">
<source>Ticket</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.facebook">
<source>Facebook</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.youtube">
<source>Youtube</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.latitude">
<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.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_organizer">
<source>Organizer</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.name">
<source>Name</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.street">
<source>Street</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.district">
<source>District</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.city">
<source>City</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.zip">
<source>Zip</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.phone">
<source>Phone</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.web">
<source>Web</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.email">
<source>Email</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date">
<source>Date</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.start">
<source>Start</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.end">
<source>End</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_region">
<source>Region</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_region.title">
<source>Title</source>
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,14 @@
<?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="dd_events">
<header/>
<body>
<trans-unit id="start.description">
<source>start</source>
</trans-unit>
<trans-unit id="end.description">
<source>end</source>
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,80 @@
<?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="dd_events">
<header/>
<body>
<trans-unit id="title.description">
<source>title</source>
</trans-unit>
<trans-unit id="global_id.description">
<source>globalId</source>
</trans-unit>
<trans-unit id="slug.description">
<source>slug</source>
</trans-unit>
<trans-unit id="highlight.description">
<source>highlight</source>
</trans-unit>
<trans-unit id="teaser.description">
<source>teaser</source>
</trans-unit>
<trans-unit id="details.description">
<source>details</source>
</trans-unit>
<trans-unit id="price_info.description">
<source>priceInfo</source>
</trans-unit>
<trans-unit id="street.description">
<source>street</source>
</trans-unit>
<trans-unit id="district.description">
<source>district</source>
</trans-unit>
<trans-unit id="city.description">
<source>city</source>
</trans-unit>
<trans-unit id="zip.description">
<source>zip</source>
</trans-unit>
<trans-unit id="country.description">
<source>country</source>
</trans-unit>
<trans-unit id="web.description">
<source>web</source>
</trans-unit>
<trans-unit id="booking.description">
<source>booking</source>
</trans-unit>
<trans-unit id="ticket.description">
<source>ticket</source>
</trans-unit>
<trans-unit id="facebook.description">
<source>facebook</source>
</trans-unit>
<trans-unit id="youtube.description">
<source>youtube</source>
</trans-unit>
<trans-unit id="latitude.description">
<source>latitude</source>
</trans-unit>
<trans-unit id="longitude.description">
<source>longitude</source>
</trans-unit>
<trans-unit id="images.description">
<source>images</source>
</trans-unit>
<trans-unit id="categories.description">
<source>categories</source>
</trans-unit>
<trans-unit id="dates.description">
<source>dates</source>
</trans-unit>
<trans-unit id="organizer.description">
<source>organizer</source>
</trans-unit>
<trans-unit id="region.description">
<source>region</source>
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-01T16:05:42Z" product-name="dd_events">
<header/>
<body>
<trans-unit id="global_id.description">
<source>globalId</source>
</trans-unit>
<trans-unit id="title.description">
<source>title</source>
</trans-unit>
<trans-unit id="teaser.description">
<source>teaser</source>
</trans-unit>
<trans-unit id="details.description">
<source>details</source>
</trans-unit>
<trans-unit id="price_info.description">
<source>priceInfo</source>
</trans-unit>
<trans-unit id="street.description">
<source>street</source>
</trans-unit>
<trans-unit id="district.description">
<source>district</source>
</trans-unit>
<trans-unit id="city.description">
<source>city</source>
</trans-unit>
<trans-unit id="zip.description">
<source>zip</source>
</trans-unit>
<trans-unit id="web.description">
<source>web</source>
</trans-unit>
<trans-unit id="booking.description">
<source>booking</source>
</trans-unit>
<trans-unit id="ticket.description">
<source>ticket</source>
</trans-unit>
<trans-unit id="facebook.description">
<source>facebook</source>
</trans-unit>
<trans-unit id="youtube.description">
<source>youtube</source>
</trans-unit>
<trans-unit id="latitude.description">
<source>latitude</source>
</trans-unit>
<trans-unit id="longitude.description">
<source>longitude</source>
</trans-unit>
<trans-unit id="images.description">
<source>images</source>
</trans-unit>
<trans-unit id="slug.description">
<source>slug</source>
</trans-unit>
<trans-unit id="organizer.description">
<source>organizer</source>
</trans-unit>
<trans-unit id="date.description">
<source>date</source>
</trans-unit>
<trans-unit id="region.description">
<source>region</source>
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,32 @@
<?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="dd_events">
<header/>
<body>
<trans-unit id="name.description">
<source>name</source>
</trans-unit>
<trans-unit id="street.description">
<source>street</source>
</trans-unit>
<trans-unit id="district.description">
<source>district</source>
</trans-unit>
<trans-unit id="city.description">
<source>city</source>
</trans-unit>
<trans-unit id="zip.description">
<source>zip</source>
</trans-unit>
<trans-unit id="phone.description">
<source>phone</source>
</trans-unit>
<trans-unit id="web.description">
<source>web</source>
</trans-unit>
<trans-unit id="email.description">
<source>email</source>
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,11 @@
<?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="dd_events">
<header/>
<body>
<trans-unit id="title.description">
<source>title</source>
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,134 @@
<?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="dd_events">
<header/>
<body>
<trans-unit id="tx_events_domain_model_event">
<source>Event</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.title">
<source>Title</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.global_id">
<source>Global Id</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.slug">
<source>Slug</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.highlight">
<source>Highlight</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.teaser">
<source>Teaser</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.details">
<source>Details</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.price_info">
<source>Price Info</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.street">
<source>Street</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.district">
<source>District</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.city">
<source>City</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.zip">
<source>Zip</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.country">
<source>Country</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.web">
<source>Web</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.booking">
<source>Booking</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.ticket">
<source>Ticket</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.facebook">
<source>Facebook</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.youtube">
<source>Youtube</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.latitude">
<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.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_organizer">
<source>Organizer</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.name">
<source>Name</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.street">
<source>Street</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.district">
<source>District</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.city">
<source>City</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.zip">
<source>Zip</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.phone">
<source>Phone</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.web">
<source>Web</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_organizer.email">
<source>Email</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date">
<source>Date</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.start">
<source>Start</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.end">
<source>End</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.event">
<source>Associated event</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_region">
<source>Region</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_region.title">
<source>Title</source>
</trans-unit>
<trans-unit id="tx_dd_events_events.name">
<source>DD Events</source>
</trans-unit>
<trans-unit id="tx_dd_events_events.description">
<source></source>
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,5 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<div class="tx-events">
<f:render section="content" />
</div>
</html>

View file

@ -0,0 +1,32 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<div class="row">
<f:for each="{dates}" as="date">
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-4">
<div class="menu-tile">
<f:if condition="{date.event.images}">
<f:then>
<f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}">
<f:image src="{date.event.images.originalResource.originalFile.uid}" alt="" width="480c" height="320c" class="img-fluid img-thumbnail"/>
</f:link.action>
</f:then>
<f:else>
<img src="https://dummyimage.com/480x320/ddd/ccc" alt="Dummy" width="480" height="320" class="img-fluid img-thumbnail"/>
</f:else>
</f:if>
</div>
<div class="caption">
<div class="caption-text mt-3">
{date.event.region.title} | <f:format.date format="d. m. Y - H:i">{date.start}</f:format.date>
<h4>{date.event.title}</h4>
<p>{date.event.teaser}</p>
<f:if condition="{date.event.highlight}">
<f:then>
<b>Hightlight</b>
</f:then>
</f:if>
</div>
</div>
</div>
</f:for>
</div>
</html>

View file

@ -0,0 +1,37 @@
<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}">
<f:for each="{paginatedDates}" as="date">
<div class="row mb-3">
<div class="col-2">
<b><f:format.date format="H:i">{date.start}</f:format.date></b><br>
<b><f:format.date format="%a">{date.start}</f:format.date></b><br>
<b><f:format.date format="d.m.">{date.start}</f:format.date></b><br>
{date.event.region.title}<br>
</div>
<div class="col-6">
<h4>{date.event.title}</h4>
<h5>{date.event.teaser}</h5>
<f:format.crop maxCharacters="150">{date.event.details}</f:format.crop>
<f:if condition="{date.event.highlight}">
<f:then>
<b>Hightlight</b>
</f:then>
</f:if>
</div>
<div class="col-3">
<f:if condition="{date.event.images}">
<f:then>
<f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}">
<f:image src="{date.event.images.originalResource.originalFile.uid}" alt="" width="480c" height="240c" class="img-fluid img-thumbnail"/>
</f:link.action>
</f:then>
<f:else>
<img src="https://dummyimage.com/480x320/ddd/ccc" alt="Dummy" width="320" height="320" class="img-fluid img-thumbnail"/>
</f:else>
</f:if>
</div>
</div>
</f:for>
</f:widget.paginate>
</html>

View file

@ -0,0 +1,148 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<table class="tx-events" >
<tr>
<td>
<f:translate key="tx_events_domain_model_events.global_id" />
</td>
<td>
{events.globalId}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.title" />
</td>
<td>
{events.title}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.teaser" />
</td>
<td>
{events.teaser}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.details" />
</td>
<td>
{events.details}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.price_info" />
</td>
<td>
{events.priceInfo}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.street" />
</td>
<td>
{events.street}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.district" />
</td>
<td>
{events.district}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.city" />
</td>
<td>
{events.city}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.zip" />
</td>
<td>
{events.zip}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.web" />
</td>
<td>
{events.web}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.booking" />
</td>
<td>
{events.booking}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.ticket" />
</td>
<td>
{events.ticket}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.facebook" />
</td>
<td>
{events.facebook}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.youtube" />
</td>
<td>
{events.youtube}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.latitude" />
</td>
<td>
{events.latitude}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.longitude" />
</td>
<td>
{events.longitude}
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.images" />
</td>
<td>
<f:image src="{events.images.originalResource.publicUrl}" width="200"/>
</td>
</tr>
<tr>
<td>
<f:translate key="tx_events_domain_model_events.slug" />
</td>
<td>
{events.slug}
</td>
</tr>
</table>
</html>

View file

@ -0,0 +1,16 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="content">
<f:switch expression="{settings.template}">
<f:case value="table">
<f:render partial="Date/ListTable" arguments="{dates:dates}" />
</f:case>
<f:case value="grid">
<f:render partial="Date/ListDefault" arguments="{dates:dates}" />
</f:case>
<f:defaultCase>
<f:render partial="Date/ListDefault" arguments="{dates:dates}" />
</f:defaultCase>
</f:switch>
</f:section>
</html>

View file

@ -0,0 +1,38 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="content">
<div class="row">
<div class="col-6">
<f:if condition="{date.event.images}">
<f:then>
<f:image src="{date.event.images.originalResource.originalFile.uid}" alt="" width="480c" height="320c" class="img-fluid img-thumbnail"/>
</f:then>
<f:else>
<img src="https://dummyimage.com/480x320/ddd/ccc" alt="Dummy" width="480" height="320" class="img-fluid img-thumbnail"/>
</f:else>
</f:if>
</div>
<div class="col-6">
<h4>
<f:format.date format="%a">{date.start}</f:format.date>
<f:format.date format="d.m.">{date.start}</f:format.date>
<f:format.date format="H:i">{date.start}</f:format.date> Uhr
</h4>
<h2>{date.event.title}</h2>
<h3>{date.event.teaser}</h3>
<f:format.html>{date.event.details}</f:format.html>
<p>{event.price_info}</p>
<div class="row">
<div class="col-4">
<p>Veranstaltungsort:<br>
{date.event.street}<br>
{date.event.zip} {date.event.city}<br>
</p>
</div>
</div>
</div>
</div>
</f:section>
</html>

View file

@ -0,0 +1,40 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="content">
<div class="row">
<f:for each="{dates}" as="date">
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-4">
<f:comment>
<!--
<f:link.action action="show" arguments="{date : date}"></f:link.action>
-->
</f:comment>
<div class="menu-tile">
<f:if condition="{date.event.images}">
<f:then>
<f:link.action pageUid="{settings.showPID}" action="show" controller="Event" arguments="{event: event}">
<f:image src="{date.event.images.originalResource.originalFile.uid}" alt="" width="480c" height="320c" class="img-fluid img-thumbnail"/>
</f:link.action>
</f:then>
<f:else>
<img src="https://dummyimage.com/480x320/ddd/ccc" alt="Dummy" width="480" height="320" class="img-fluid img-thumbnail"/>
</f:else>
</f:if>
</div>
<div class="caption">
<div class="caption-text mt-3">
{date.event.region.title} | <f:format.date format="d. m. Y - H:i">{date.start}</f:format.date>
<h4>{date.event.title}</h4>
<p>{date.event.teaser}</p>
<f:if condition="{date.event.highlight}">
<f:then>
<b>Hightlight</b>
</f:then>
</f:if>
</div>
</div>
</div>
</f:for>
</div>
</f:section>
</html>

View file

@ -0,0 +1,31 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="content">
<div class="row">
<f:for each="{events}" as="event">
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-4">
<div class="menu-tile">
<f:if condition="{event.images}">
<f:then>
<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:link.action>
</f:then>
<f:else>
<img src="https://dummyimage.com/480x320/ddd/ccc" alt="Dummy" width="480" height="320" class="img-fluid img-thumbnail"/>
</f:else>
</f:if>
</div>
<div class="caption">
<div class="caption-text mt-3">
{event.region.title}
<h4>{event.title}</h4>
<p>{event.teaser}</p>
</div>
</div>
</div>
</f:for>
</div>
</f:section>
</html>

View file

@ -0,0 +1,35 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="content">
<div class="row">
<div class="col-6">
<f:if condition="{event.images}">
<f:then>
<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:link.action>
</f:then>
<f:else>
<img src="https://dummyimage.com/480x320/ddd/ccc" alt="Dummy" width="480" height="320" class="img-fluid img-thumbnail"/>
</f:else>
</f:if>
</div>
<div class="col-6">
<h2>{event.title}</h2>
<h3>{event.teaser}</h3>
<f:format.html>{event.details}</f:format.html>
<p>{event.price_info}</p>
<div class="row">
<div class="col-4">
<p>Veranstaltungsort:<br>
{event.street}<br>
{event.zip} {event.city}<br>
</p>
</div>
</div>
</div>
</div>
</f:section>
</html>

View file

@ -0,0 +1,31 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="content">
<div class="row">
<f:for each="{events}" as="event">
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-4">
<div class="menu-tile">
<f:if condition="{event.images}">
<f:then>
<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:link.action>
</f:then>
<f:else>
<img src="https://dummyimage.com/480x320/ddd/ccc" alt="Dummy" width="480" height="320" class="img-fluid img-thumbnail"/>
</f:else>
</f:if>
</div>
<div class="caption">
<div class="caption-text mt-3">
{event.region.title}
<h4>{event.title}</h4>
<p>{event.teaser}</p>
</div>
</div>
</div>
</f:for>
</div>
</f:section>
</html>

View file

@ -0,0 +1,91 @@
<f:if condition="{configuration.insertAbove}">
<f:render section="paginator" arguments="{pagination: pagination, configuration: configuration}" />
</f:if>
<f:renderChildren arguments="{contentArguments}" />
<f:if condition="{configuration.insertBelow}">
<f:render section="paginator" arguments="{pagination: pagination, configuration: configuration}" />
</f:if>
<f:section name="paginator">
<nav>
<ul class="pagination">
<f:if condition="{pagination.previousPage}">
<li class="page-item">
<f:if condition="{pagination.previousPage} > 1">
<f:then>
<f:widget.link class="page-link" rel="prev"
arguments="{currentPage: pagination.previousPage}"
addQueryStringMethod="{configuration.addQueryStringMethod}"
section="{configuration.section}"><span aria-hidden="true">&laquo;</span>
</f:widget.link>
</f:then>
<f:else>
<f:widget.link class="page-link" rel="prev"
addQueryStringMethod="{configuration.addQueryStringMethod}"
section="{configuration.section}"><span aria-hidden="true">&laquo;</span>
</f:widget.link>
</f:else>
</f:if>
</li>
</f:if>
<f:if condition="{pagination.displayRangeStart} > 1">
<li class="page-item">
<f:widget.link class="page-link" addQueryStringMethod="{configuration.addQueryStringMethod}"
section="{configuration.section}">1
</f:widget.link>
</li>
</f:if>
<f:if condition="{pagination.hasLessPages}">
<li class="page-item"><span class="page-link"></span></li>
</f:if>
<f:for each="{pagination.pages}" as="page">
<f:if condition="{page.isCurrent}">
<f:then>
<li class="page-item active">
<span class="page-link">{page.number}</span>
</li>
</f:then>
<f:else>
<li class="page-item">
<f:if condition="{page.number} > 1">
<f:then>
<f:widget.link class="page-link" arguments="{currentPage: page.number}"
addQueryStringMethod="{configuration.addQueryStringMethod}"
section="{configuration.section}">{page.number}
</f:widget.link>
</f:then>
<f:else>
<f:widget.link class="page-link"
addQueryStringMethod="{configuration.addQueryStringMethod}"
section="{configuration.section}">{page.number}
</f:widget.link>
</f:else>
</f:if>
</li>
</f:else>
</f:if>
</f:for>
<f:if condition="{pagination.hasMorePages}">
<li class="page-item"><span class="page-link"></span></li>
</f:if>
<f:if condition="{pagination.displayRangeEnd} < {pagination.numberOfPages}">
<li class="page-item">
<f:widget.link class="page-link" arguments="{currentPage: pagination.numberOfPages}"
addQueryStringMethod="{configuration.addQueryStringMethod}"
section="{configuration.section}">{pagination.numberOfPages}
</f:widget.link>
</li>
</f:if>
<f:if condition="{pagination.nextPage}">
<li class="page-item">
<f:widget.link class="page-link" rel="next" arguments="{currentPage: pagination.nextPage}"
addQueryStringMethod="{configuration.addQueryStringMethod}"
section="{configuration.section}"><span aria-hidden="true">&raquo;</span>
</f:widget.link>
</li>
</f:if>
</ul>
</nav>
</f:section>

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

View file

@ -0,0 +1 @@
<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>

After

Width:  |  Height:  |  Size: 426 B

View file

@ -0,0 +1,67 @@
<?php
namespace Wrm\Events\Tests\Unit\Controller;
/**
* Test case.
*
* @author Dirk Koritnik <koritnik@werkraum-media.de>
*/
class DateControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
{
/**
* @var \Wrm\Events\Controller\DateController
*/
protected $subject = null;
protected function setUp()
{
parent::setUp();
$this->subject = $this->getMockBuilder(\Wrm\Events\Controller\DateController::class)
->setMethods(['redirect', 'forward', 'addFlashMessage'])
->disableOriginalConstructor()
->getMock();
}
protected function tearDown()
{
parent::tearDown();
}
/**
* @test
*/
public function listActionFetchesAllDatesFromRepositoryAndAssignsThemToView()
{
$allDates = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
->disableOriginalConstructor()
->getMock();
$dateRepository = $this->getMockBuilder(\::class)
->setMethods(['findAll'])
->disableOriginalConstructor()
->getMock();
$dateRepository->expects(self::once())->method('findAll')->will(self::returnValue($allDates));
$this->inject($this->subject, 'dateRepository', $dateRepository);
$view = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface::class)->getMock();
$view->expects(self::once())->method('assign')->with('dates', $allDates);
$this->inject($this->subject, 'view', $view);
$this->subject->listAction();
}
/**
* @test
*/
public function showActionAssignsTheGivenDateToView()
{
$date = new \Wrm\Events\Domain\Model\Date();
$view = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface::class)->getMock();
$this->inject($this->subject, 'view', $view);
$view->expects(self::once())->method('assign')->with('date', $date);
$this->subject->showAction($date);
}
}

View file

@ -0,0 +1,67 @@
<?php
namespace Wrm\Events\Tests\Unit\Controller;
/**
* Test case.
*
* @author Dirk Koritnik <koritnik@werkraum-media.de>
*/
class EventControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
{
/**
* @var \Wrm\Events\Controller\EventController
*/
protected $subject = null;
protected function setUp()
{
parent::setUp();
$this->subject = $this->getMockBuilder(\Wrm\Events\Controller\EventController::class)
->setMethods(['redirect', 'forward', 'addFlashMessage'])
->disableOriginalConstructor()
->getMock();
}
protected function tearDown()
{
parent::tearDown();
}
/**
* @test
*/
public function listActionFetchesAllEventsFromRepositoryAndAssignsThemToView()
{
$allEvents = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
->disableOriginalConstructor()
->getMock();
$eventRepository = $this->getMockBuilder(\::class)
->setMethods(['findAll'])
->disableOriginalConstructor()
->getMock();
$eventRepository->expects(self::once())->method('findAll')->will(self::returnValue($allEvents));
$this->inject($this->subject, 'eventRepository', $eventRepository);
$view = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface::class)->getMock();
$view->expects(self::once())->method('assign')->with('events', $allEvents);
$this->inject($this->subject, 'view', $view);
$this->subject->listAction();
}
/**
* @test
*/
public function showActionAssignsTheGivenEventToView()
{
$event = new \Wrm\Events\Domain\Model\Event();
$view = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface::class)->getMock();
$this->inject($this->subject, 'view', $view);
$view->expects(self::once())->method('assign')->with('event', $event);
$this->subject->showAction($event);
}
}

View file

@ -0,0 +1,67 @@
<?php
namespace Wrm\Events\Tests\Unit\Controller;
/**
* Test case.
*
* @author Dirk Koritnik <koritnik@werkraum-media.de>
*/
class EventsControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
{
/**
* @var \Wrm\Events\Controller\EventsController
*/
protected $subject = null;
protected function setUp()
{
parent::setUp();
$this->subject = $this->getMockBuilder(\Wrm\Events\Controller\EventsController::class)
->setMethods(['redirect', 'forward', 'addFlashMessage'])
->disableOriginalConstructor()
->getMock();
}
protected function tearDown()
{
parent::tearDown();
}
/**
* @test
*/
public function listActionFetchesAllEventssFromRepositoryAndAssignsThemToView()
{
$allEventss = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
->disableOriginalConstructor()
->getMock();
$eventsRepository = $this->getMockBuilder(\::class)
->setMethods(['findAll'])
->disableOriginalConstructor()
->getMock();
$eventsRepository->expects(self::once())->method('findAll')->will(self::returnValue($allEventss));
$this->inject($this->subject, 'eventsRepository', $eventsRepository);
$view = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface::class)->getMock();
$view->expects(self::once())->method('assign')->with('eventss', $allEventss);
$this->inject($this->subject, 'view', $view);
$this->subject->listAction();
}
/**
* @test
*/
public function showActionAssignsTheGivenEventsToView()
{
$events = new \Wrm\Events\Domain\Model\Events();
$view = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface::class)->getMock();
$this->inject($this->subject, 'view', $view);
$view->expects(self::once())->method('assign')->with('events', $events);
$this->subject->showAction($events);
}
}

View file

@ -0,0 +1,78 @@
<?php
namespace Wrm\Events\Tests\Unit\Domain\Model;
/**
* Test case.
*
* @author Dirk Koritnik <koritnik@werkraum-media.de>
*/
class DateTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
{
/**
* @var \Wrm\Events\Domain\Model\Date
*/
protected $subject = null;
protected function setUp()
{
parent::setUp();
$this->subject = new \Wrm\Events\Domain\Model\Date();
}
protected function tearDown()
{
parent::tearDown();
}
/**
* @test
*/
public function getStartReturnsInitialValueForDateTime()
{
self::assertEquals(
null,
$this->subject->getStart()
);
}
/**
* @test
*/
public function setStartForDateTimeSetsStart()
{
$dateTimeFixture = new \DateTime();
$this->subject->setStart($dateTimeFixture);
self::assertAttributeEquals(
$dateTimeFixture,
'start',
$this->subject
);
}
/**
* @test
*/
public function getEndReturnsInitialValueForDateTime()
{
self::assertEquals(
null,
$this->subject->getEnd()
);
}
/**
* @test
*/
public function setEndForDateTimeSetsEnd()
{
$dateTimeFixture = new \DateTime();
$this->subject->setEnd($dateTimeFixture);
self::assertAttributeEquals(
$dateTimeFixture,
'end',
$this->subject
);
}
}

View file

@ -0,0 +1,667 @@
<?php
namespace Wrm\Events\Tests\Unit\Domain\Model;
/**
* Test case.
*
* @author Dirk Koritnik <koritnik@werkraum-media.de>
*/
class EventTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
{
/**
* @var \Wrm\Events\Domain\Model\Event
*/
protected $subject = null;
protected function setUp()
{
parent::setUp();
$this->subject = new \Wrm\Events\Domain\Model\Event();
}
protected function tearDown()
{
parent::tearDown();
}
/**
* @test
*/
public function getTitleReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getTitle()
);
}
/**
* @test
*/
public function setTitleForStringSetsTitle()
{
$this->subject->setTitle('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'title',
$this->subject
);
}
/**
* @test
*/
public function getGlobalIdReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getGlobalId()
);
}
/**
* @test
*/
public function setGlobalIdForStringSetsGlobalId()
{
$this->subject->setGlobalId('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'globalId',
$this->subject
);
}
/**
* @test
*/
public function getSlugReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getSlug()
);
}
/**
* @test
*/
public function setSlugForStringSetsSlug()
{
$this->subject->setSlug('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'slug',
$this->subject
);
}
/**
* @test
*/
public function getHighlightReturnsInitialValueForBool()
{
self::assertSame(
false,
$this->subject->getHighlight()
);
}
/**
* @test
*/
public function setHighlightForBoolSetsHighlight()
{
$this->subject->setHighlight(true);
self::assertAttributeEquals(
true,
'highlight',
$this->subject
);
}
/**
* @test
*/
public function getTeaserReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getTeaser()
);
}
/**
* @test
*/
public function setTeaserForStringSetsTeaser()
{
$this->subject->setTeaser('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'teaser',
$this->subject
);
}
/**
* @test
*/
public function getDetailsReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getDetails()
);
}
/**
* @test
*/
public function setDetailsForStringSetsDetails()
{
$this->subject->setDetails('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'details',
$this->subject
);
}
/**
* @test
*/
public function getPriceInfoReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getPriceInfo()
);
}
/**
* @test
*/
public function setPriceInfoForStringSetsPriceInfo()
{
$this->subject->setPriceInfo('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'priceInfo',
$this->subject
);
}
/**
* @test
*/
public function getStreetReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getStreet()
);
}
/**
* @test
*/
public function setStreetForStringSetsStreet()
{
$this->subject->setStreet('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'street',
$this->subject
);
}
/**
* @test
*/
public function getDistrictReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getDistrict()
);
}
/**
* @test
*/
public function setDistrictForStringSetsDistrict()
{
$this->subject->setDistrict('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'district',
$this->subject
);
}
/**
* @test
*/
public function getCityReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getCity()
);
}
/**
* @test
*/
public function setCityForStringSetsCity()
{
$this->subject->setCity('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'city',
$this->subject
);
}
/**
* @test
*/
public function getZipReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getZip()
);
}
/**
* @test
*/
public function setZipForStringSetsZip()
{
$this->subject->setZip('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'zip',
$this->subject
);
}
/**
* @test
*/
public function getCountryReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getCountry()
);
}
/**
* @test
*/
public function setCountryForStringSetsCountry()
{
$this->subject->setCountry('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'country',
$this->subject
);
}
/**
* @test
*/
public function getWebReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getWeb()
);
}
/**
* @test
*/
public function setWebForStringSetsWeb()
{
$this->subject->setWeb('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'web',
$this->subject
);
}
/**
* @test
*/
public function getBookingReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getBooking()
);
}
/**
* @test
*/
public function setBookingForStringSetsBooking()
{
$this->subject->setBooking('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'booking',
$this->subject
);
}
/**
* @test
*/
public function getTicketReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getTicket()
);
}
/**
* @test
*/
public function setTicketForStringSetsTicket()
{
$this->subject->setTicket('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'ticket',
$this->subject
);
}
/**
* @test
*/
public function getFacebookReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getFacebook()
);
}
/**
* @test
*/
public function setFacebookForStringSetsFacebook()
{
$this->subject->setFacebook('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'facebook',
$this->subject
);
}
/**
* @test
*/
public function getYoutubeReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getYoutube()
);
}
/**
* @test
*/
public function setYoutubeForStringSetsYoutube()
{
$this->subject->setYoutube('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'youtube',
$this->subject
);
}
/**
* @test
*/
public function getLatitudeReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getLatitude()
);
}
/**
* @test
*/
public function setLatitudeForStringSetsLatitude()
{
$this->subject->setLatitude('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'latitude',
$this->subject
);
}
/**
* @test
*/
public function getLongitudeReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getLongitude()
);
}
/**
* @test
*/
public function setLongitudeForStringSetsLongitude()
{
$this->subject->setLongitude('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'longitude',
$this->subject
);
}
/**
* @test
*/
public function getImagesReturnsInitialValueForFileReference()
{
self::assertEquals(
null,
$this->subject->getImages()
);
}
/**
* @test
*/
public function setImagesForFileReferenceSetsImages()
{
$fileReferenceFixture = new \TYPO3\CMS\Extbase\Domain\Model\FileReference();
$this->subject->setImages($fileReferenceFixture);
self::assertAttributeEquals(
$fileReferenceFixture,
'images',
$this->subject
);
}
/**
* @test
*/
public function getCategoriesReturnsInitialValueForInt()
{
self::assertSame(
0,
$this->subject->getCategories()
);
}
/**
* @test
*/
public function setCategoriesForIntSetsCategories()
{
$this->subject->setCategories(12);
self::assertAttributeEquals(
12,
'categories',
$this->subject
);
}
/**
* @test
*/
public function getDatesReturnsInitialValueForDate()
{
$newObjectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
self::assertEquals(
$newObjectStorage,
$this->subject->getDates()
);
}
/**
* @test
*/
public function setDatesForObjectStorageContainingDateSetsDates()
{
$date = new \Wrm\Events\Domain\Model\Date();
$objectStorageHoldingExactlyOneDates = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$objectStorageHoldingExactlyOneDates->attach($date);
$this->subject->setDates($objectStorageHoldingExactlyOneDates);
self::assertAttributeEquals(
$objectStorageHoldingExactlyOneDates,
'dates',
$this->subject
);
}
/**
* @test
*/
public function addDateToObjectStorageHoldingDates()
{
$date = new \Wrm\Events\Domain\Model\Date();
$datesObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
->setMethods(['attach'])
->disableOriginalConstructor()
->getMock();
$datesObjectStorageMock->expects(self::once())->method('attach')->with(self::equalTo($date));
$this->inject($this->subject, 'dates', $datesObjectStorageMock);
$this->subject->addDate($date);
}
/**
* @test
*/
public function removeDateFromObjectStorageHoldingDates()
{
$date = new \Wrm\Events\Domain\Model\Date();
$datesObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
->setMethods(['detach'])
->disableOriginalConstructor()
->getMock();
$datesObjectStorageMock->expects(self::once())->method('detach')->with(self::equalTo($date));
$this->inject($this->subject, 'dates', $datesObjectStorageMock);
$this->subject->removeDate($date);
}
/**
* @test
*/
public function getOrganizerReturnsInitialValueForOrganizer()
{
self::assertEquals(
null,
$this->subject->getOrganizer()
);
}
/**
* @test
*/
public function setOrganizerForOrganizerSetsOrganizer()
{
$organizerFixture = new \Wrm\Events\Domain\Model\Organizer();
$this->subject->setOrganizer($organizerFixture);
self::assertAttributeEquals(
$organizerFixture,
'organizer',
$this->subject
);
}
/**
* @test
*/
public function getRegionReturnsInitialValueForRegion()
{
self::assertEquals(
null,
$this->subject->getRegion()
);
}
/**
* @test
*/
public function setRegionForRegionSetsRegion()
{
$regionFixture = new \Wrm\Events\Domain\Model\Region();
$this->subject->setRegion($regionFixture);
self::assertAttributeEquals(
$regionFixture,
'region',
$this->subject
);
}
}

View file

@ -0,0 +1,617 @@
<?php
namespace Wrm\Events\Tests\Unit\Domain\Model;
/**
* Test case.
*
* @author Dirk Koritnik <koritnik@werkraum-media.de>
*/
class EventsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
{
/**
* @var \Wrm\Events\Domain\Model\Events
*/
protected $subject = null;
protected function setUp()
{
parent::setUp();
$this->subject = new \Wrm\Events\Domain\Model\Events();
}
protected function tearDown()
{
parent::tearDown();
}
/**
* @test
*/
public function getGlobalIdReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getGlobalId()
);
}
/**
* @test
*/
public function setGlobalIdForStringSetsGlobalId()
{
$this->subject->setGlobalId('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'globalId',
$this->subject
);
}
/**
* @test
*/
public function getTitleReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getTitle()
);
}
/**
* @test
*/
public function setTitleForStringSetsTitle()
{
$this->subject->setTitle('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'title',
$this->subject
);
}
/**
* @test
*/
public function getTeaserReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getTeaser()
);
}
/**
* @test
*/
public function setTeaserForStringSetsTeaser()
{
$this->subject->setTeaser('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'teaser',
$this->subject
);
}
/**
* @test
*/
public function getDetailsReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getDetails()
);
}
/**
* @test
*/
public function setDetailsForStringSetsDetails()
{
$this->subject->setDetails('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'details',
$this->subject
);
}
/**
* @test
*/
public function getPriceInfoReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getPriceInfo()
);
}
/**
* @test
*/
public function setPriceInfoForStringSetsPriceInfo()
{
$this->subject->setPriceInfo('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'priceInfo',
$this->subject
);
}
/**
* @test
*/
public function getStreetReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getStreet()
);
}
/**
* @test
*/
public function setStreetForStringSetsStreet()
{
$this->subject->setStreet('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'street',
$this->subject
);
}
/**
* @test
*/
public function getDistrictReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getDistrict()
);
}
/**
* @test
*/
public function setDistrictForStringSetsDistrict()
{
$this->subject->setDistrict('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'district',
$this->subject
);
}
/**
* @test
*/
public function getCityReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getCity()
);
}
/**
* @test
*/
public function setCityForStringSetsCity()
{
$this->subject->setCity('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'city',
$this->subject
);
}
/**
* @test
*/
public function getZipReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getZip()
);
}
/**
* @test
*/
public function setZipForStringSetsZip()
{
$this->subject->setZip('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'zip',
$this->subject
);
}
/**
* @test
*/
public function getWebReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getWeb()
);
}
/**
* @test
*/
public function setWebForStringSetsWeb()
{
$this->subject->setWeb('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'web',
$this->subject
);
}
/**
* @test
*/
public function getBookingReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getBooking()
);
}
/**
* @test
*/
public function setBookingForStringSetsBooking()
{
$this->subject->setBooking('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'booking',
$this->subject
);
}
/**
* @test
*/
public function getTicketReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getTicket()
);
}
/**
* @test
*/
public function setTicketForStringSetsTicket()
{
$this->subject->setTicket('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'ticket',
$this->subject
);
}
/**
* @test
*/
public function getFacebookReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getFacebook()
);
}
/**
* @test
*/
public function setFacebookForStringSetsFacebook()
{
$this->subject->setFacebook('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'facebook',
$this->subject
);
}
/**
* @test
*/
public function getYoutubeReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getYoutube()
);
}
/**
* @test
*/
public function setYoutubeForStringSetsYoutube()
{
$this->subject->setYoutube('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'youtube',
$this->subject
);
}
/**
* @test
*/
public function getLatitudeReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getLatitude()
);
}
/**
* @test
*/
public function setLatitudeForStringSetsLatitude()
{
$this->subject->setLatitude('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'latitude',
$this->subject
);
}
/**
* @test
*/
public function getLongitudeReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getLongitude()
);
}
/**
* @test
*/
public function setLongitudeForStringSetsLongitude()
{
$this->subject->setLongitude('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'longitude',
$this->subject
);
}
/**
* @test
*/
public function getImagesReturnsInitialValueForFileReference()
{
self::assertEquals(
null,
$this->subject->getImages()
);
}
/**
* @test
*/
public function setImagesForFileReferenceSetsImages()
{
$fileReferenceFixture = new \TYPO3\CMS\Extbase\Domain\Model\FileReference();
$this->subject->setImages($fileReferenceFixture);
self::assertAttributeEquals(
$fileReferenceFixture,
'images',
$this->subject
);
}
/**
* @test
*/
public function getSlugReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getSlug()
);
}
/**
* @test
*/
public function setSlugForStringSetsSlug()
{
$this->subject->setSlug('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'slug',
$this->subject
);
}
/**
* @test
*/
public function getOrganizerReturnsInitialValueFor()
{
}
/**
* @test
*/
public function setOrganizerForSetsOrganizer()
{
}
/**
* @test
*/
public function getDateReturnsInitialValueFor()
{
$newObjectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
self::assertEquals(
$newObjectStorage,
$this->subject->getDate()
);
}
/**
* @test
*/
public function setDateForObjectStorageContainingSetsDate()
{
$date = new ();
$objectStorageHoldingExactlyOneDate = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$objectStorageHoldingExactlyOneDate->attach($date);
$this->subject->setDate($objectStorageHoldingExactlyOneDate);
self::assertAttributeEquals(
$objectStorageHoldingExactlyOneDate,
'date',
$this->subject
);
}
/**
* @test
*/
public function addDateToObjectStorageHoldingDate()
{
$date = new ();
$dateObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
->setMethods(['attach'])
->disableOriginalConstructor()
->getMock();
$dateObjectStorageMock->expects(self::once())->method('attach')->with(self::equalTo($date));
$this->inject($this->subject, 'date', $dateObjectStorageMock);
$this->subject->addDate($date);
}
/**
* @test
*/
public function removeDateFromObjectStorageHoldingDate()
{
$date = new ();
$dateObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
->setMethods(['detach'])
->disableOriginalConstructor()
->getMock();
$dateObjectStorageMock->expects(self::once())->method('detach')->with(self::equalTo($date));
$this->inject($this->subject, 'date', $dateObjectStorageMock);
$this->subject->removeDate($date);
}
/**
* @test
*/
public function getRegionReturnsInitialValueFor()
{
$newObjectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
self::assertEquals(
$newObjectStorage,
$this->subject->getRegion()
);
}
/**
* @test
*/
public function setRegionForObjectStorageContainingSetsRegion()
{
$region = new ();
$objectStorageHoldingExactlyOneRegion = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$objectStorageHoldingExactlyOneRegion->attach($region);
$this->subject->setRegion($objectStorageHoldingExactlyOneRegion);
self::assertAttributeEquals(
$objectStorageHoldingExactlyOneRegion,
'region',
$this->subject
);
}
/**
* @test
*/
public function addRegionToObjectStorageHoldingRegion()
{
$region = new ();
$regionObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
->setMethods(['attach'])
->disableOriginalConstructor()
->getMock();
$regionObjectStorageMock->expects(self::once())->method('attach')->with(self::equalTo($region));
$this->inject($this->subject, 'region', $regionObjectStorageMock);
$this->subject->addRegion($region);
}
/**
* @test
*/
public function removeRegionFromObjectStorageHoldingRegion()
{
$region = new ();
$regionObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
->setMethods(['detach'])
->disableOriginalConstructor()
->getMock();
$regionObjectStorageMock->expects(self::once())->method('detach')->with(self::equalTo($region));
$this->inject($this->subject, 'region', $regionObjectStorageMock);
$this->subject->removeRegion($region);
}
}

View file

@ -0,0 +1,226 @@
<?php
namespace Wrm\Events\Tests\Unit\Domain\Model;
/**
* Test case.
*
* @author Dirk Koritnik <koritnik@werkraum-media.de>
*/
class OrganizerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
{
/**
* @var \Wrm\Events\Domain\Model\Organizer
*/
protected $subject = null;
protected function setUp()
{
parent::setUp();
$this->subject = new \Wrm\Events\Domain\Model\Organizer();
}
protected function tearDown()
{
parent::tearDown();
}
/**
* @test
*/
public function getNameReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getName()
);
}
/**
* @test
*/
public function setNameForStringSetsName()
{
$this->subject->setName('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'name',
$this->subject
);
}
/**
* @test
*/
public function getStreetReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getStreet()
);
}
/**
* @test
*/
public function setStreetForStringSetsStreet()
{
$this->subject->setStreet('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'street',
$this->subject
);
}
/**
* @test
*/
public function getDistrictReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getDistrict()
);
}
/**
* @test
*/
public function setDistrictForStringSetsDistrict()
{
$this->subject->setDistrict('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'district',
$this->subject
);
}
/**
* @test
*/
public function getCityReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getCity()
);
}
/**
* @test
*/
public function setCityForStringSetsCity()
{
$this->subject->setCity('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'city',
$this->subject
);
}
/**
* @test
*/
public function getZipReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getZip()
);
}
/**
* @test
*/
public function setZipForStringSetsZip()
{
$this->subject->setZip('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'zip',
$this->subject
);
}
/**
* @test
*/
public function getPhoneReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getPhone()
);
}
/**
* @test
*/
public function setPhoneForStringSetsPhone()
{
$this->subject->setPhone('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'phone',
$this->subject
);
}
/**
* @test
*/
public function getWebReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getWeb()
);
}
/**
* @test
*/
public function setWebForStringSetsWeb()
{
$this->subject->setWeb('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'web',
$this->subject
);
}
/**
* @test
*/
public function getEmailReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getEmail()
);
}
/**
* @test
*/
public function setEmailForStringSetsEmail()
{
$this->subject->setEmail('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'email',
$this->subject
);
}
}

View file

@ -0,0 +1,51 @@
<?php
namespace Wrm\Events\Tests\Unit\Domain\Model;
/**
* Test case.
*
* @author Dirk Koritnik <koritnik@werkraum-media.de>
*/
class RegionTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
{
/**
* @var \Wrm\Events\Domain\Model\Region
*/
protected $subject = null;
protected function setUp()
{
parent::setUp();
$this->subject = new \Wrm\Events\Domain\Model\Region();
}
protected function tearDown()
{
parent::tearDown();
}
/**
* @test
*/
public function getTitleReturnsInitialValueForString()
{
self::assertSame(
'',
$this->subject->getTitle()
);
}
/**
* @test
*/
public function setTitleForStringSetsTitle()
{
$this->subject->setTitle('Conceived at T3CON10');
self::assertAttributeEquals(
'Conceived at T3CON10',
'title',
$this->subject
);
}
}

29
composer.json Normal file
View file

@ -0,0 +1,29 @@
{
"name": "wrm/events",
"type": "typo3-cms-extension",
"description": "Extension to manage Destination Data managed events",
"authors": [
{
"name": "Dirk Koritnik",
"role": "Developer"
}
],
"version": "1.0.0",
"require": {
"typo3/cms-core": "^9.5"
},
"autoload": {
"psr-4": {
"Wrm\\Events\\": "Classes"
}
},
"autoload-dev": {
"psr-4": {
"Wrm\\Events\\Tests\\": "Tests"
}
},
"replace": {
"events": "self.version",
"typo3-ter/events": "self.version"
}
}

31
ext_emconf.php Normal file
View file

@ -0,0 +1,31 @@
<?php
/**************************************************************
* 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',
'description' => 'Extension to manage Destination Data managed events',
'category' => 'plugin',
'author' => 'Dirk Koritnik',
'author_email' => 'koritnik@werkraum-media.de',
'state' => 'alpha',
'uploadfolder' => 1,
'createDirs' => '',
'clearCacheOnLoad' => 0,
'version' => '1.0.0',
'constraints' => [
'depends' => [
'typo3' => '9.5.0-9.5.99',
],
'conflicts' => [],
'suggests' => [],
],
];

49
ext_localconf.php Normal file
View file

@ -0,0 +1,49 @@
<?php
defined('TYPO3_MODE') || die('Access denied.');
call_user_func(
function()
{
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Wrm.Events',
'Pi1',
[
'Event' => 'teaser, list, show',
'Date' => 'teaser, list, show'
],
[
'Event' => 'teaser, list, show',
'Date' => 'teaser, list, show'
]
);
// wizards
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'mod {
wizards.newContentElement.wizardItems.plugins {
elements {
events {
iconIdentifier = events-plugin-events
title = LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:txevents_events.name
description = LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_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-events',
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => 'EXT:events/Resources/Public/Icons/user_plugin_events.svg']
);
}
);

32
ext_tables.php Normal file
View file

@ -0,0 +1,32 @@
<?php
defined('TYPO3_MODE') || die('Access denied.');
call_user_func(
function()
{
/*
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'Wrm.Events',
'Pi1',
'Events',
'EXT:dd_events/Resources/Public/Icons/user_plugin_events.svg'
);
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('events', 'Configuration/TypoScript', 'Events');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_events_domain_model_event', 'EXT:events/Resources/Private/Language/locallang_csh_tx_events_domain_model_event.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_ddevents_domain_model_event');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_events_domain_model_organizer', 'EXT:events/Resources/Private/Language/locallang_csh_tx_events_domain_model_organizer.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_events_domain_model_organizer');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_events_domain_model_date', 'EXT:events/Resources/Private/Language/locallang_csh_tx_events_domain_model_date.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_events_domain_model_date');
\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');
}
);

77
ext_tables.sql Normal file
View file

@ -0,0 +1,77 @@
#
# Table structure for table 'tx_events_domain_model_event'
#
CREATE TABLE tx_events_domain_model_event (
title varchar(255) DEFAULT '' NOT NULL,
global_id varchar(255) DEFAULT '' NOT NULL,
slug varchar(255) DEFAULT '' NOT NULL,
highlight smallint(5) unsigned DEFAULT '0' NOT NULL,
teaser text,
details text,
price_info text,
street varchar(255) DEFAULT '' NOT NULL,
district varchar(255) DEFAULT '' NOT NULL,
city varchar(255) DEFAULT '' NOT NULL,
zip varchar(255) DEFAULT '' NOT NULL,
country varchar(255) DEFAULT '' NOT NULL,
web varchar(255) DEFAULT '' NOT NULL,
booking varchar(255) DEFAULT '' NOT NULL,
ticket varchar(255) DEFAULT '' NOT NULL,
facebook varchar(255) DEFAULT '' NOT NULL,
youtube varchar(255) DEFAULT '' NOT NULL,
latitude varchar(255) DEFAULT '' NOT NULL,
longitude varchar(255) DEFAULT '' NOT NULL,
images int(11) unsigned NOT NULL default '0',
categories int(11) DEFAULT '0' NOT NULL,
dates int(11) unsigned DEFAULT '0' NOT NULL,
organizer int(11) unsigned DEFAULT '0',
region int(11) unsigned DEFAULT '0',
);
#
# Table structure for table 'tx_events_domain_model_organizer'
#
CREATE TABLE tx_events_domain_model_organizer (
name varchar(255) DEFAULT '' NOT NULL,
street varchar(255) DEFAULT '' NOT NULL,
district varchar(255) DEFAULT '' NOT NULL,
city varchar(255) DEFAULT '' NOT NULL,
zip varchar(255) DEFAULT '' NOT NULL,
phone varchar(255) DEFAULT '' NOT NULL,
web varchar(255) DEFAULT '' NOT NULL,
email varchar(255) DEFAULT '' NOT NULL,
);
#
# Table structure for table 'tx_events_domain_model_date'
#
CREATE TABLE tx_events_domain_model_date (
event int(11) unsigned DEFAULT '0' NOT NULL,
start datetime DEFAULT NULL,
end datetime DEFAULT NULL,
);
#
# Table structure for table 'tx_events_domain_model_region'
#
CREATE TABLE tx_events_domain_model_region (
title varchar(255) DEFAULT '' NOT NULL,
);
#
# Table structure for table 'tx_events_domain_model_date'
#
CREATE TABLE tx_events_domain_model_date (
event int(11) unsigned DEFAULT '0' NOT NULL,
);