diff --git a/Classes/Command/DestinationDataImportCommand.php b/Classes/Command/DestinationDataImportCommand.php index 734e214..af9f75b 100644 --- a/Classes/Command/DestinationDataImportCommand.php +++ b/Classes/Command/DestinationDataImportCommand.php @@ -23,29 +23,23 @@ class DestinationDataImportCommand extends Command { 'storage-pid', InputArgument::OPTIONAL, 'What is the storage pid?', - '281' + '284' ); $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-experience', InputArgument::OPTIONAL, 'What is the rest experience?', - 'arnstadt' + 'stadtmarketing-erfurt' ); $this->addArgument('files-folder', InputArgument::OPTIONAL, 'Where to save the image files?', - 'redaktion/arnstadt/events/' + 'staedte/erfurt/events/' ); } @@ -59,7 +53,6 @@ class DestinationDataImportCommand extends Command { $input->getArgument('rest-experience'), $input->getArgument('storage-pid'), $input->getArgument('region-uid'), - $input->getArgument('category-parent-uid'), $input->getArgument('files-folder') ); } diff --git a/Classes/Controller/DateController.php b/Classes/Controller/DateController.php index 601bb9c..7b5d5f1 100644 --- a/Classes/Controller/DateController.php +++ b/Classes/Controller/DateController.php @@ -1,6 +1,7 @@ createDemandFromSettings(); - $dates = $this->dateRepository->findByDemand($demand); + if (($this->request->hasArgument('searchword') && $this->request->getArgument('searchword') != '') || + ($this->request->hasArgument('region') && $this->request->getArgument('region') != '') || + ($this->request->hasArgument('start') && $this->request->getArgument('start') != '') || + ($this->request->hasArgument('end') && $this->request->getArgument('end') != '')) + { + $demand = $this->createDemandFromSearch(); + $dates = $this->dateRepository->findByDemand($demand); + } else { + $demand = $this->createDemandFromSettings(); + $dates = $this->dateRepository->findByDemand($demand); + } $this->view->assign('dates', $dates); } @@ -73,42 +83,21 @@ class DateController extends ActionController */ public function searchAction() { - - $searchword = null; - $regions = null; - $selRegion = null; - $dates = null; - $start = null; - $end = null; - - if ($this->request->hasArgument('searchword') && $this->request->getArgument('searchword') != '') { - $searchword = $this->request->getArgument('searchword'); - } - - if ($this->request->hasArgument('region') && $this->request->getArgument('region') != '') { - $selRegion = $this->request->getArgument('region'); - } - - if ($this->request->hasArgument('start') && $this->request->getArgument('start') != '') { - $start = date( "d.m.y", strtotime( $this->request->getArgument('start'))); - } - - if ($this->request->hasArgument('end') && $this->request->getArgument('end') != '') { - $end = date( "d.m.y", strtotime( $this->request->getArgument('end'))); - } - - $demand = $this->createDemandFromSearch(); - $dates = $this->dateRepository->findByDemand($demand); + $arguments = GeneralUtility::_GET('tx_events_datelist'); + $searchword = $arguments['searchword']; + $selRegion = $arguments['region']; + $start = $arguments['start']; + $end = $arguments['end']; + $considerDate = $arguments['considerDate']; $regions = $this->regionRepository->findAll(); + $this->view->assign('regions', $regions); $this->view->assign('searchword', $searchword); - $this->view->assign('regions', $regions); $this->view->assign('selRegion', $selRegion); - $this->view->assign('dates', $dates); $this->view->assign('start', $start); $this->view->assign('end', $end); - + $this->view->assign('considerDate', $considerDate); } /** @@ -172,13 +161,14 @@ class DateController extends ActionController if ($this->request->hasArgument('searchword') && $this->request->getArgument('searchword') != '') $demand->setSearchword((string)$this->request->getArgument('searchword')); - if ($this->request->hasArgument('start') && $this->request->getArgument('start') != '') { - $demand->setStart(date( "Y-m-d", strtotime( $this->request->getArgument('start')))); - } + if ($this->request->hasArgument('start') && $this->request->getArgument('start') != '') + $demand->setStart(strtotime($this->request->getArgument('start') . ' 00:00')); - if ($this->request->hasArgument('end') && $this->request->getArgument('end') != '') { - $demand->setEnd(date( "Y-m-d", strtotime( $this->request->getArgument('end')))); - } + if ($this->request->hasArgument('end') && $this->request->getArgument('end') != '') + $demand->setEnd(strtotime($this->request->getArgument('end') . ' 23:59')); + + if ($this->request->hasArgument('considerDate') && $this->request->getArgument('considerDate') != '') + $demand->setConsiderDate(strtotime($this->request->getArgument('considerDate'))); $demand->setSortBy((string)$this->settings['sortByDate']); $demand->setSortOrder((string)$this->settings['sortOrder']); diff --git a/Classes/Domain/Model/Date.php b/Classes/Domain/Model/Date.php index 9203b96..d56d370 100644 --- a/Classes/Domain/Model/Date.php +++ b/Classes/Domain/Model/Date.php @@ -49,10 +49,10 @@ class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity } /** - * @param string $end + * @param \DateTime $end * @return void */ - public function setEnd($end) + public function setEnd(\DateTime $end) { $this->end = $end; } diff --git a/Classes/Domain/Model/Dto/DateDemand.php b/Classes/Domain/Model/Dto/DateDemand.php index 0f0a538..a1c3087 100644 --- a/Classes/Domain/Model/Dto/DateDemand.php +++ b/Classes/Domain/Model/Dto/DateDemand.php @@ -59,6 +59,11 @@ class DateDemand { */ protected $searchword = ''; + /** + * @var bool + */ + protected $considerDate = 0; + /** * @return string */ @@ -235,4 +240,20 @@ class DateDemand { $this->end = $end; } + /** + * @return bool + */ + public function getConsiderDate(): bool + { + return $this->considerDate; + } + + /** + * @param bool $considerDate + */ + public function setConsiderDate(string $considerDate): void + { + $this->considerDate = $considerDate; + } + } \ No newline at end of file diff --git a/Classes/Domain/Model/Event.php b/Classes/Domain/Model/Event.php index d5271ef..3c95926 100644 --- a/Classes/Domain/Model/Event.php +++ b/Classes/Domain/Model/Event.php @@ -105,6 +105,13 @@ class Event extends AbstractEntity */ protected $country = ''; + /** + * web + * + * @var string + */ + protected $phone = ''; + /** * web * @@ -381,6 +388,22 @@ class Event extends AbstractEntity $this->zip = $zip; } + /** + * @return string + */ + public function getPhone() + { + return $this->phone; + } + + /** + * @param string $phone + */ + public function setPhone($phone) + { + $this->phone = $phone; + } + /** * @return string $web */ diff --git a/Classes/Domain/Repository/DateRepository.php b/Classes/Domain/Repository/DateRepository.php index 78f080b..be63ddb 100644 --- a/Classes/Domain/Repository/DateRepository.php +++ b/Classes/Domain/Repository/DateRepository.php @@ -38,7 +38,7 @@ class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository // For testing purposes // $query = $this->createDemandQueryViaBuilder($demand); - //return $query->execute()->fetchAll(); + // return $query->execute()->fetchAll(); } /** @@ -82,9 +82,12 @@ class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository $constraints['daterange'] = $query->logicalAnd( [ $query->greaterThanOrEqual('start', $demand->getStart()), - $query->lessThanOrEqual('start', $demand->getEnd()) + $query->lessThanOrEqual('end', $demand->getEnd()) ] ); + } else { + $now = new \DateTime('now', new \DateTimeZone('Europe/Berlin')); + $constraints['untilnow'] = $query->greaterThanOrEqual('start', $now); } if ($demand->getLimit() !== '') { diff --git a/Classes/Service/DestinationDataImportService.php b/Classes/Service/DestinationDataImportService.php index d7deb94..136dae3 100644 --- a/Classes/Service/DestinationDataImportService.php +++ b/Classes/Service/DestinationDataImportService.php @@ -42,6 +42,10 @@ class DestinationDataImportService { * @var */ protected $restLimit; + /** + * @var + */ + protected $restMode; /** * @var */ @@ -185,27 +189,27 @@ class DestinationDataImportService { ); // Set properties - $this->restUrl = $this->settings['destinationData']['restUrl']; - $this->restLicenseKey = $this->settings['destinationData']['license']; - $this->restType = $this->settings['destinationData']['restType']; - $this->restLimit = $this->settings['destinationData']['restLimit']; - $this->restTemplate = $this->settings['destinationData']['restTemplate']; - $this->sysCategoriesPid = $this->settings['destinationData']['categoriesPid']; + $this->restUrl = $this->settings['destinationData']['restUrl']; + $this->restLicenseKey = $this->settings['destinationData']['license']; + $this->restType = $this->settings['destinationData']['restType']; + $this->restLimit = $this->settings['destinationData']['restLimit']; + $this->restMode = $this->settings['destinationData']['restMode']; + $this->restTemplate = $this->settings['destinationData']['restTemplate']; + $this->sysCategoriesPid = $this->settings['destinationData']['categoriesPid']; + $this->categoryParentUid = $this->settings['destinationData']['categoryParentUid']; } /** * @param $restExperience * @param $storagePid * @param $regionUid - * @param $categoryParentUid * @param $filesFolder */ - public function import($restExperience, $storagePid, $regionUid, $categoryParentUid, $filesFolder) { + public function import($restExperience, $storagePid, $regionUid, $filesFolder) { $this->restExperience = $restExperience; $this->storagePid = $storagePid; $this->regionUid = $regionUid; - $this->categoryParentUid = $categoryParentUid; $this->filesFolder = $filesFolder; // Get configuration @@ -222,16 +226,14 @@ class DestinationDataImportService { // Set Configuration $this->configurationManager->setConfiguration(array_merge($frameworkConfiguration, $persistenceConfiguration)); - $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); + $this->logger->info('Starting Destination Data Import Service'); - - $restUrl = $this->restUrl . '?experience=' . $this->restExperience . '&licensekey=' . $this->restLicenseKey . '&type=' . $this->restType . '&limit=' . $this->restLimit . '&template=' . $this->restTemplate; - + $restUrl = $this->restUrl . '?experience=' . $this->restExperience . '&licensekey=' . $this->restLicenseKey . '&type=' . $this->restType . '&mode=' . $this->restMode . '&limit=' . $this->restLimit . '&template=' . $this->restTemplate; $this->logger->info('Try to get data from ' . $restUrl); if ($jsonResponse = json_decode(file_get_contents($restUrl),true)) { - $this->logger->info('Received data with ' . count($jsonResponse) . 'items'); + $this->logger->info('Received data with ' . count($jsonResponse['items']) . ' items'); return $this->processData($jsonResponse); } else { $this->logger->error('Could not receive data.'); @@ -246,7 +248,9 @@ class DestinationDataImportService { */ public function processData($data) { - // Get seleceted region + $this->logger->info('Processing json ' . count($data['items'])); + + // Get selected region $selectedRegion = $this->regionRepository->findByUid($this->regionUid); foreach ($data['items'] as $event) { @@ -271,8 +275,9 @@ class DestinationDataImportService { $this->setTexts($event['texts']); // Set address and geo data - if($event['name'] && $event['street'] && $event['city'] && $event['zip'] && $event['country']) - $this->setAddress($event['name'], $event['street'], $event['city'], $event['zip'], $event['country']); + + if($event['name'] || $event['street'] || $event['city'] || $event['zip'] || $event['country']) + $this->setAddress($event); // Set LatLng if($event['geo']['main']['latitude'] && $event['geo']['main']['longitude']) @@ -301,10 +306,12 @@ class DestinationDataImportService { } $this->doSlugUpdate(); + $this->logger->info('Finished import'); return 0; } /** + * * @param array $categories */ protected function setCategories(Array $categories) { @@ -331,7 +338,7 @@ class DestinationDataImportService { */ protected function setDates(Array $timeIntervals) { - // TODO: does not seem to work --> + // @TODO: does not seem to work --> //$currentEventDates = $this->tmpCurrentEvent->getDates(); //$this->tmpCurrentEvent->removeAllDates($currentEventDates); // <-- @@ -341,19 +348,18 @@ class DestinationDataImportService { $this->logger->info('Found ' . count($currentEventDates) . ' to delete'); foreach ($currentEventDates as $currentDate) { - //$this->logger->info('Delete ' . $currentDate->getStart()->format('Y-m-d')); $this->dateRepository->remove($currentDate); } - $now = new \DateTime(); - $now = $now->getTimestamp(); + $today = new \DateTime('today'); + $today = $today->getTimestamp(); foreach ($timeIntervals as $date) { // Check if dates are given as interval or not if (empty($date['interval'])) { - if (strtotime($date['start']) > $now) { + if (strtotime($date['start']) > $today) { $this->logger->info('Setup single date'); $dateObj = $this->objectManager->get(\Wrm\Events\Domain\Model\Date::class); $start = new \DateTime($date['start'], new \DateTimeZone($date['tz'])); @@ -367,16 +373,16 @@ class DestinationDataImportService { } else { - - if ($date['freq'] == 'Daily' && empty($date['weekdays'])) { + if ($date['freq'] == 'Daily' && empty($date['weekdays']) && !empty($date['repeatUntil'])) { $this->logger->info('Setup daily interval dates'); $this->logger->info('Start ' . $date['start']); $this->logger->info('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) { + if ($i >= $today) { $eventStart = new \DateTime(); $eventStart->setTimestamp($i); $eventStart->setTime($start->format('H'), $start->format('i')); @@ -392,8 +398,7 @@ class DestinationDataImportService { } - else if ($date['freq'] == 'Weekly' && !empty($date['weekdays'])) { - + else if ($date['freq'] == 'Weekly' && !empty($date['weekdays']) && !empty($date['repeatUntil'])) { foreach ($date['weekdays'] as $day) { $this->logger->info('Setup weekly interval dates for ' . $day); $this->logger->info('Start ' . $date['start']); @@ -402,7 +407,7 @@ class DestinationDataImportService { $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) { + if ($i >= $today) { $eventStart = new \DateTime(); $eventStart->setTimestamp($i); $eventStart->setTime($start->format('H'), $start->format('i')); @@ -416,12 +421,10 @@ class DestinationDataImportService { } } } - } - } - } + $this->logger->info('Finished setup dates'); } /** @@ -436,9 +439,7 @@ class DestinationDataImportService { $this->tmpCurrentEvent->setOrganizer($tmpOrganizer); continue; } - $tmpOrganizer = $this->objectManager->get(\Wrm\Events\Domain\Model\Organizer::class); - $tmpOrganizer->setName($address['name']); $tmpOrganizer->setCity($address['city']); $tmpOrganizer->setZip($address['zip']); @@ -447,27 +448,30 @@ class DestinationDataImportService { $tmpOrganizer->setWeb($address['web']); $tmpOrganizer->setEmail($address['email']); $tmpOrganizer->setDistrict($address['district']); - $this->organizerRepository->add($tmpOrganizer); $this->tmpCurrentEvent->setOrganizer($tmpOrganizer); - } } } /** - * @param string $name - * @param string $street - * @param string $city - * @param string $zip - * @param string $country + * @param array $event */ - protected function setAddress(String $name, String $street, String $city, String $zip, String $country) { - $this->tmpCurrentEvent->setName($name); - $this->tmpCurrentEvent->setStreet($street); - $this->tmpCurrentEvent->setCity($city); - $this->tmpCurrentEvent->setZip($zip); - $this->tmpCurrentEvent->setCountry($country); + protected function setAddress(Array $event) { + if (!empty($event['name'])) + $this->tmpCurrentEvent->setName($event['name']); + if (!empty($event['street'])) + $this->tmpCurrentEvent->setStreet($event['street']); + if (!empty($event['city'])) + $this->tmpCurrentEvent->setCity($event['city']); + if (!empty($event['zip'])) + $this->tmpCurrentEvent->setZip($event['zip']); + if (!empty($event['country'])) + $this->tmpCurrentEvent->setCountry($event['country']); + if (!empty($event['phone'])) + $this->tmpCurrentEvent->setPhone($event['phone']); + if (!empty($event['web'])) + $this->tmpCurrentEvent->setWeb($event['web']); } /** @@ -492,6 +496,9 @@ class DestinationDataImportService { if ($text['rel'] == "teaser" && $text['type'] == "text/plain") { $this->tmpCurrentEvent->setTeaser($text['value']); } + if ($text['rel'] == "PRICE_INFO" && $text['type'] == "text/plain") { + $this->tmpCurrentEvent->setPriceInfo($text['value']); + } } } @@ -528,6 +535,8 @@ class DestinationDataImportService { */ protected function setAssets(Array $assets) { + $this->logger->info("Set assets"); + $error = false; foreach ($assets as $media_object) @@ -536,6 +545,11 @@ class DestinationDataImportService { $this->storage = $this->resourceFactory->getDefaultStorage(); + if ($this->storage == null) { + $this->logger->error('No default storage defined. Cancel import.'); + die(); + } + // Check if file already exists if (file_exists($this->environment->getPublicPath() . '/fileadmin/' . $this->filesFolder . strtolower(basename($media_object['url'])))) { $this->logger->info('File already exists'); @@ -634,7 +648,6 @@ class DestinationDataImportService { */ protected function doSlugUpdate() { - $this->logger->info('Update slugs'); $slugHelper = GeneralUtility::makeInstance( @@ -674,4 +687,4 @@ class DestinationDataImportService { return true; } -} \ No newline at end of file +} diff --git a/Classes/ViewHelpers/FormViewHelper.php b/Classes/ViewHelpers/FormViewHelper.php new file mode 100644 index 0000000..9231214 --- /dev/null +++ b/Classes/ViewHelpers/FormViewHelper.php @@ -0,0 +1,9 @@ + + + + + + Options + + array + + + + 1 + + + select + + + Start + start + + + End + end + + + + + + + + + 1 + + + select + + + + Ascending + + ASC + + + + Descending + + DESC + + + ASC + + + + + + + 1 + + + input + 10 + 30 + trim + + + + + + + 1 + + + check + 0 + + + + + + + 1 + + + check + 0 + + + + + + + 1 + + + check + 0 + + + + + + + 1 + + + group + db + pages + 1 + 1 + 0 + 1 + + + + + + + + + + Template + + array + + + 1 + + + select + + + Default + default + + + Costum + costum + + + Table + table + + + Grid + grid + + + default + + + + + + + + + Regions & Categories + + array + + + + + + select + tx_events_domain_model_region + AND tx_events_domain_model_region.deleted = 0 AND tx_events_domain_model_region.hidden = 0 + 3 + 0 + 2 + + + + + + + 1 + + + select + + + And + 0 + + + Or + 1 + + + 0 + + + + + + + 1 + + + select + 20 + sys_category + AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC + 1 + tree + 8 + + + 1 + 1 + + parent + + + + + + + + 1 + + + check + 0 + + + + + + + + \ No newline at end of file diff --git a/Configuration/FlexForms/DateSearch.xml b/Configuration/FlexForms/DateSearch.xml new file mode 100644 index 0000000..ae07a9f --- /dev/null +++ b/Configuration/FlexForms/DateSearch.xml @@ -0,0 +1,39 @@ + + + + + + Options + + array + + + + 1 + + + group + db + pages + 1 + 1 + 0 + 1 + + + + + + 1 + + + check + 0 + + + + + + + + \ No newline at end of file diff --git a/Configuration/FlexForms/DateShow.xml b/Configuration/FlexForms/DateShow.xml new file mode 100644 index 0000000..b3eea3d --- /dev/null +++ b/Configuration/FlexForms/DateShow.xml @@ -0,0 +1,57 @@ + + + + + + Options + + array + + + + 1 + + + group + db + pages + 1 + 1 + 0 + 1 + + + + + + + + + + Template + + array + + + 1 + + + select + + + Default + default + + + Costum + costum + + + default + + + + + + + \ No newline at end of file diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index f83f45a..ab4974d 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -20,5 +20,53 @@ call_user_func(function () { 'FILE:EXT:events/Configuration/FlexForms/Pi1.xml' ); + /* Search Plugin */ + + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'Wrm.Events', + 'DateSearch', + 'Events: Date Search', + 'EXT:events/Resources/Public/Icons/user_plugin_events.svg' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['events_datesearch'] = 'pi_flexform'; + + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( + 'events_datesearch', + 'FILE:EXT:events/Configuration/FlexForms/DateSearch.xml' + ); + + /* Date List Plugin */ + + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'Wrm.Events', + 'DateList', + 'Events: Date List', + 'EXT:events/Resources/Public/Icons/user_plugin_events.svg' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['events_datelist'] = 'pi_flexform'; + + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( + 'events_datelist', + 'FILE:EXT:events/Configuration/FlexForms/DateList.xml' + ); + + /* Date Show Plugin */ + + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'Wrm.Events', + 'DateShow', + 'Events: Date Show', + 'EXT:events/Resources/Public/Icons/user_plugin_events.svg' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['events_dateshow'] = 'pi_flexform'; + + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( + 'events_dateshow', + 'FILE:EXT:events/Configuration/FlexForms/DateShow.xml' + ); + }); diff --git a/Configuration/TCA/tx_events_domain_model_date.php b/Configuration/TCA/tx_events_domain_model_date.php index 41e3ea9..b29fa4f 100644 --- a/Configuration/TCA/tx_events_domain_model_date.php +++ b/Configuration/TCA/tx_events_domain_model_date.php @@ -120,7 +120,7 @@ return [ 'exclude' => true, 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_date.start', 'config' => [ - 'dbType' => 'datetime', + //'dbType' => 'datetime', 'type' => 'input', 'renderType' => 'inputDateTime', 'size' => 12, @@ -132,7 +132,7 @@ return [ 'exclude' => true, 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_date.end', 'config' => [ - 'dbType' => 'datetime', + //'dbType' => 'datetime', 'type' => 'input', 'renderType' => 'inputDateTime', 'size' => 12, @@ -141,14 +141,6 @@ return [ ], ], - /* - 'event' => [ - 'config' => [ - 'type' => 'passthrough', - ], - ], - */ - 'event' => array( 'exclude' => 1, 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_date.event', diff --git a/Configuration/TCA/tx_events_domain_model_event.php b/Configuration/TCA/tx_events_domain_model_event.php index 58c3c2f..a521705 100644 --- a/Configuration/TCA/tx_events_domain_model_event.php +++ b/Configuration/TCA/tx_events_domain_model_event.php @@ -20,10 +20,10 @@ return [ '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, name, street, district, city, zip, country, web, booking, ticket, facebook, youtube, latitude, longitude, images, categories, dates, organizer, region', + 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, global_id, slug, highlight, teaser, details, price_info, name, street, district, city, zip, country, phone, web, 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, name, 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'], + '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, global_id, slug, highlight, teaser, details, price_info, name, street, district, city, zip, country, phone, web, 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' => [ @@ -150,17 +150,6 @@ return [ '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', @@ -266,6 +255,15 @@ return [ 'eval' => 'trim' ], ], + 'phone' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.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_event.web', diff --git a/Configuration/TypoScript/constants.typoscript b/Configuration/TypoScript/constants.typoscript index 9b055f4..5ab60de 100644 --- a/Configuration/TypoScript/constants.typoscript +++ b/Configuration/TypoScript/constants.typoscript @@ -13,6 +13,8 @@ plugin.tx_events { storagePid = } settings { + # cat=plugin.tx_events//a; type=string; label=Default Image + defaultImagePath = typo3conf/ext/events/Resources/Public/Images/default.jpg destinationData { # cat=plugin.tx_events//a; type=string; label=Rest Url restUrl = http://meta.et4.de/rest.ashx/search/ @@ -21,11 +23,15 @@ plugin.tx_events { # cat=plugin.tx_events//a; type=string; label=Data Type restType = Event # cat=plugin.tx_events//a; type=string; label=Data Limit - restLimit = 200 + restLimit = 500 + # cat=plugin.tx_events//a; type=string; label=Mode + restMode = next_months,12 # cat=plugin.tx_events//a; type=string; label=Data Template restTemplate = ET2014A.json # cat=plugin.tx_events//a; type=string; Label=Category Storage categoriesPid = 54 + # cat=plugin.tx_events//a; type=string; Label=Category Parent ID + categoryParentUid = 6 } } } diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index 0a73f24..46197a6 100644 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -36,6 +36,7 @@ plugin.tx_events { defaulDetailEventsPid = defaultDetailDatesPid = + defaultImagePath = {$plugin.tx_events.settings.defaultImagePath} paginate { # can be overriden by plugin @@ -50,10 +51,12 @@ plugin.tx_events { license = {$plugin.tx_events.settings.destinationData.license} restType = {$plugin.tx_events.settings.destinationData.restType} restLimit = {$plugin.tx_events.settings.destinationData.restLimit} + restMode = {$plugin.tx_events.settings.destinationData.restMode} restTemplate = {$plugin.tx_events.settings.destinationData.restTemplate} categoriesPid = {$plugin.tx_events.settings.destinationData.categoriesPid} + categoryParentUid = {$plugin.tx_events.settings.destinationData.categoryParentUid} } } } -module.tx_events < plugin.tx_events \ No newline at end of file +module.tx_events < plugin.tx_events diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 7ff4e30..2933bfc 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -48,6 +48,9 @@ Web + + Phone + Booking @@ -125,4 +128,4 @@ - \ No newline at end of file + diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index 0570651..93c2827 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -51,6 +51,9 @@ Web + + Phone + Booking @@ -137,4 +140,4 @@ - \ No newline at end of file + diff --git a/Resources/Private/Layouts/Default.html b/Resources/Private/Layouts/Default.html index c6a1ca4..bf25019 100644 --- a/Resources/Private/Layouts/Default.html +++ b/Resources/Private/Layouts/Default.html @@ -1,5 +1,5 @@ -
- -
+
+ +
\ No newline at end of file diff --git a/Resources/Private/Partials/Date/ListDefault.html b/Resources/Private/Partials/Date/ListDefault.html index 57e8b16..c62a6fb 100644 --- a/Resources/Private/Partials/Date/ListDefault.html +++ b/Resources/Private/Partials/Date/ListDefault.html @@ -6,11 +6,13 @@ - + - Dummy + + + @@ -19,14 +21,18 @@ {date.event.region.title} | {date.start}

{date.event.title}

{date.event.teaser}

- - - Hightlight - - + + + - \ No newline at end of file + diff --git a/Resources/Private/Partials/Date/ListTable.html b/Resources/Private/Partials/Date/ListTable.html index 2099e60..d959692 100644 --- a/Resources/Private/Partials/Date/ListTable.html +++ b/Resources/Private/Partials/Date/ListTable.html @@ -1,9 +1,9 @@ - - -
+ + +
{date.start}
{date.start}
@@ -11,29 +11,47 @@ {date.event.region.title}
-

{date.event.title}

-
{date.event.teaser}
- {date.event.details} + + + + +

+ + {date.event.title} + +

+

{date.event.teaser}

+ {date.event.details}
-
+
- + - Dummy + + Dummy +
+ + + + +
+
+
- \ No newline at end of file + diff --git a/Resources/Private/Partials/Date/SearchForm.html b/Resources/Private/Partials/Date/~OBSOLETE-SearchForm.html similarity index 93% rename from Resources/Private/Partials/Date/SearchForm.html rename to Resources/Private/Partials/Date/~OBSOLETE-SearchForm.html index 7ae14e9..f920cb8 100644 --- a/Resources/Private/Partials/Date/SearchForm.html +++ b/Resources/Private/Partials/Date/~OBSOLETE-SearchForm.html @@ -1,9 +1,10 @@ +{namespace wrm=Wrm\Events\ViewHelpers} -
-
- - +
+
+ +
@@ -60,6 +61,5 @@
-
\ No newline at end of file diff --git a/Resources/Private/Templates/Date/List.html b/Resources/Private/Templates/Date/List.html index d3f7e43..f447317 100644 --- a/Resources/Private/Templates/Date/List.html +++ b/Resources/Private/Templates/Date/List.html @@ -1,16 +1,16 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resources/Private/Templates/Date/Search.html b/Resources/Private/Templates/Date/Search.html index 1f04ddf..8267fe0 100644 --- a/Resources/Private/Templates/Date/Search.html +++ b/Resources/Private/Templates/Date/Search.html @@ -1,59 +1,75 @@ + + +
+
+ +
+
+
+ + +
+
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+
+
+ + +
+
- - -
- - - -
-
- {date.start}
- {date.start}
- {date.start}
- {date.event.region.title}
-
-
- - - Hightlight - + +
+
+ + +
+
+
+
-

- - {date.event.title} - -

-

{date.event.teaser}

- {date.event.details} -
-DEBUGGING:
-GLOBAL EVENT ID: {date.event.globalId}
-                
-
-
- - - - - - - - - Dummy - - - -
+
+ +
+
- - - - -
-
-
- - - - \ No newline at end of file +
+ + diff --git a/Resources/Private/Templates/Date/SearchHtml.html b/Resources/Private/Templates/Date/SearchHtml.html new file mode 100644 index 0000000..8ea1438 --- /dev/null +++ b/Resources/Private/Templates/Date/SearchHtml.html @@ -0,0 +1,68 @@ + + + +
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/Resources/Private/Templates/Date/Show.html b/Resources/Private/Templates/Date/Show.html index b037174..7d9ed35 100644 --- a/Resources/Private/Templates/Date/Show.html +++ b/Resources/Private/Templates/Date/Show.html @@ -1,38 +1,70 @@ - - -
-
- - - - - - Dummy - - -
-
-

- {date.start} - {date.start} - {date.start} Uhr -

-

{date.event.title}

-

{date.event.teaser}

- {date.event.details} -

{event.price_info}

+ + +
+
+ + + + + + Dummy + + +
+
+

+ {date.start} + {date.start} + {date.start} Uhr +

+

{date.event.title}

+

{date.event.teaser}

+ {date.event.details} +

{event.price_info}

-
-
-

Veranstaltungsort:
- {date.event.street}
- {date.event.zip} {date.event.city}
-

-
-
+
+
+
+
-
-
-
- \ No newline at end of file +
+
+
+
+

Preis:
+ + + {date.event.priceInfo} + + + Keine Information + + +

+ + +

Weitere Informationen:
+ Website +

+
+
+
+

Veranstaltungsort:
+ {date.event.street}
+ {date.event.zip} {date.event.city}
+ {date.event.phone}
+

+
+
+

Veranstalter:
+ {date.event.organizer.name}
+ {date.event.organizer.street}
+ {date.event.organizer.zip} {date.event.organizer.city}
+ {date.event.organizer.phone}
+ Website +

+
+
+
+ diff --git a/Resources/Private/Templates/Date/Teaser.html b/Resources/Private/Templates/Date/Teaser.html index 9061dae..4f2f9de 100644 --- a/Resources/Private/Templates/Date/Teaser.html +++ b/Resources/Private/Templates/Date/Teaser.html @@ -13,11 +13,13 @@ - + - Dummy + + +
diff --git a/Resources/Private/Templates/Event/List.html b/Resources/Private/Templates/Event/List.html index 3cfb726..d9ec46f 100644 --- a/Resources/Private/Templates/Event/List.html +++ b/Resources/Private/Templates/Event/List.html @@ -1,31 +1,33 @@ - + - -
- -
- -
-
- {event.region.title} -

{event.title}

-

{event.teaser}

-
-
-
-
-
-
+ +
+ +
+ +
+
+ {event.region.title} +

{event.title}

+

{event.teaser}

+
+
+
+
+
+
\ No newline at end of file diff --git a/Resources/Private/Templates/Event/Search.html b/Resources/Private/Templates/Event/Search.html index 73dd4af..2e5cd72 100644 --- a/Resources/Private/Templates/Event/Search.html +++ b/Resources/Private/Templates/Event/Search.html @@ -11,7 +11,9 @@ - Dummy + + Dummy +
diff --git a/Resources/Private/Templates/Event/Show.html b/Resources/Private/Templates/Event/Show.html index 4937010..49d418b 100644 --- a/Resources/Private/Templates/Event/Show.html +++ b/Resources/Private/Templates/Event/Show.html @@ -1,35 +1,37 @@ - - -
-
- - - - - - - - Dummy - - -
-
-

{event.title}

-

{event.teaser}

- {event.details} -

{event.price_info}

+ + +
+
+ + + + + + + + + Dummy + + + +
+
+

{event.title}

+

{event.teaser}

+ {event.details} +

{event.price_info}

-
-
-

Veranstaltungsort:
- {event.street}
- {event.zip} {event.city}
-

-
-
+
+
+

Veranstaltungsort:
+ {event.street}
+ {event.zip} {event.city}
+

+
+
-
-
-
+
+
+
\ No newline at end of file diff --git a/Resources/Private/Templates/Event/Teaser.html b/Resources/Private/Templates/Event/Teaser.html index 3840aa4..b0019bb 100644 --- a/Resources/Private/Templates/Event/Teaser.html +++ b/Resources/Private/Templates/Event/Teaser.html @@ -9,11 +9,13 @@ - + - Dummy + + +
diff --git a/Resources/Private/Templates/ViewHelpers/Widget/Paginate/Index.html b/Resources/Private/Templates/ViewHelpers/Widget/Paginate/Index.html index 899196f..c8c84b1 100644 --- a/Resources/Private/Templates/ViewHelpers/Widget/Paginate/Index.html +++ b/Resources/Private/Templates/ViewHelpers/Widget/Paginate/Index.html @@ -1,91 +1,91 @@ - + - + - + diff --git a/Resources/Public/Images/default.jpg b/Resources/Public/Images/default.jpg new file mode 100644 index 0000000..1d216a4 Binary files /dev/null and b/Resources/Public/Images/default.jpg differ diff --git a/ext_localconf.php b/ext_localconf.php index 59912b5..261c280 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -5,6 +5,7 @@ call_user_func( function() { + /* \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'Wrm.Events', 'Pi1', @@ -17,6 +18,49 @@ call_user_func( 'Date' => 'teaser, list, show, search' ] ); + */ + + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'Wrm.Events', + 'DateSearch', + [ + 'Date' => 'search' + ], + [ + 'Date' => 'search' + ] + ); + + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'Wrm.Events', + 'DateList', + [ + 'Date' => 'list' + ], + [ + 'Date' => 'list' + ] + ); + + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'Wrm.Events', + 'DateShow', + [ + 'Date' => 'show' + ], + [ + 'Date' => 'show' + ] + ); + + /* + $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); + + $iconRegistry->registerIcon( + 'events-plugin', + \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + ['source' => 'EXT:events/Resources/Public/Icons/user_plugin_events.svg'] + ); // wizards \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig( @@ -37,14 +81,6 @@ call_user_func( } }' ); - - $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); - - $iconRegistry->registerIcon( - 'events-plugin', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => 'EXT:events/Resources/Public/Icons/user_plugin_events.svg'] - ); - + */ } ); diff --git a/ext_tables.sql b/ext_tables.sql index 3fc8842..f7a33e3 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -28,8 +28,33 @@ CREATE TABLE tx_events_domain_model_event ( dates int(11) unsigned DEFAULT '0' NOT NULL, organizer int(11) unsigned DEFAULT '0', region int(11) unsigned DEFAULT '0', + 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, + phone 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', - KEY dataHandler (l10n_parent, t3ver_oid, deleted, t3ver_wsid, t3ver_state) + KEY dataHandler (l10n_parent, t3ver_oid, deleted, t3ver_wsid, t3ver_state) ); # @@ -37,30 +62,27 @@ CREATE TABLE tx_events_domain_model_event ( # 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, + 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, - KEY dataHandler (l10n_parent, sys_language_uid, deleted) + KEY dataHandler (l10n_parent, sys_language_uid, deleted) ); # # 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, - - KEY event (event), - KEY dataHandler (event, t3ver_wsid, pid) + event int(11) unsigned DEFAULT '0' NOT NULL, + start int(11) DEFAULT NULL, + end int(11) DEFAULT NULL, + KEY event (event), + KEY dataHandler (event, t3ver_wsid, pid) ); # @@ -68,7 +90,7 @@ CREATE TABLE tx_events_domain_model_date ( # CREATE TABLE tx_events_domain_model_region ( - title varchar(255) DEFAULT '' NOT NULL, + title varchar(255) DEFAULT '' NOT NULL, ); @@ -77,6 +99,6 @@ CREATE TABLE tx_events_domain_model_region ( # CREATE TABLE tx_events_domain_model_date ( - event int(11) unsigned DEFAULT '0' NOT NULL, + event int(11) unsigned DEFAULT '0' NOT NULL, );