From 9a108749638041670fd87d43fc8335e64f4fd7d8 Mon Sep 17 00:00:00 2001 From: Dirk Date: Fri, 27 Sep 2019 07:42:45 +0200 Subject: [PATCH 01/21] [TASK] Switch to method POST --- Classes/ViewHelpers/FormViewHelper.php | 9 +++++++++ Resources/Private/Partials/Date/SearchForm.html | 4 ++-- Resources/Private/Templates/Date/Search.html | 1 + ext_localconf.php | 6 +++--- 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 Classes/ViewHelpers/FormViewHelper.php 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 @@ +
- - +
diff --git a/Resources/Private/Templates/Date/Search.html b/Resources/Private/Templates/Date/Search.html index 1f04ddf..c2360a0 100644 --- a/Resources/Private/Templates/Date/Search.html +++ b/Resources/Private/Templates/Date/Search.html @@ -56,4 +56,5 @@ GLOBAL EVENT ID: {date.event.globalId} + \ No newline at end of file diff --git a/ext_localconf.php b/ext_localconf.php index 59912b5..35e873e 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -38,13 +38,13 @@ call_user_func( }' ); - $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); - + $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'] ); - + } ); From 2f136680d00a8bbbf682060117b0eb44459db9d2 Mon Sep 17 00:00:00 2001 From: Dirk Date: Fri, 27 Sep 2019 07:59:28 +0200 Subject: [PATCH 02/21] Fix form --- Resources/Private/Partials/Date/SearchForm.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Private/Partials/Date/SearchForm.html b/Resources/Private/Partials/Date/SearchForm.html index 53d0b57..315748f 100644 --- a/Resources/Private/Partials/Date/SearchForm.html +++ b/Resources/Private/Partials/Date/SearchForm.html @@ -3,7 +3,7 @@
- +
From bc5801452b1c73453be122c469ef74dac7611d5f Mon Sep 17 00:00:00 2001 From: Dirk Date: Wed, 9 Oct 2019 15:03:58 +0200 Subject: [PATCH 03/21] [FIX] Fix crazy die error --- .../Command/DestinationDataImportCommand.php | 10 ++--- Classes/Domain/Repository/DateRepository.php | 2 + .../Service/DestinationDataImportService.php | 37 +++++++++---------- 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/Classes/Command/DestinationDataImportCommand.php b/Classes/Command/DestinationDataImportCommand.php index 734e214..5cd0802 100644 --- a/Classes/Command/DestinationDataImportCommand.php +++ b/Classes/Command/DestinationDataImportCommand.php @@ -23,29 +23,29 @@ class DestinationDataImportCommand extends Command { 'storage-pid', InputArgument::OPTIONAL, 'What is the storage pid?', - '281' + '6' ); $this->addArgument( 'region-uid', InputArgument::OPTIONAL, 'What is the region uid?', - '3' + '1' ); $this->addArgument( 'category-parent-uid', InputArgument::OPTIONAL, 'What is the default category parent uid?', - '6' + '52' ); $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/' ); } diff --git a/Classes/Domain/Repository/DateRepository.php b/Classes/Domain/Repository/DateRepository.php index 78f080b..7440753 100644 --- a/Classes/Domain/Repository/DateRepository.php +++ b/Classes/Domain/Repository/DateRepository.php @@ -85,6 +85,8 @@ class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository $query->lessThanOrEqual('start', $demand->getEnd()) ] ); + } else { + $constraints['untilnow'] = $query->greaterThanOrEqual('start', date("Y-m-d H:i:s")); } if ($demand->getLimit() !== '') { diff --git a/Classes/Service/DestinationDataImportService.php b/Classes/Service/DestinationDataImportService.php index 2e2daa6..8d8f7dd 100644 --- a/Classes/Service/DestinationDataImportService.php +++ b/Classes/Service/DestinationDataImportService.php @@ -222,16 +222,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; - $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 +244,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) { @@ -301,10 +301,12 @@ class DestinationDataImportService { } $this->doSlugUpdate(); + $this->logger->info('Finished import'); return 0; } /** + * * @param array $categories */ protected function setCategories(Array $categories) { @@ -331,7 +333,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,7 +343,6 @@ 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); } @@ -367,9 +368,7 @@ class DestinationDataImportService { } else { - if ($date['freq'] == 'Daily' && empty($date['weekdays'])) { - $this->logger->info('Setup daily interval dates'); $this->logger->info('Start ' . $date['start']); $this->logger->info('End ' . $date['repeatUntil']); @@ -389,11 +388,9 @@ class DestinationDataImportService { $this->tmpCurrentEvent->addDate($dateObj); } } - } else if ($date['freq'] == 'Weekly' && !empty($date['weekdays'])) { - foreach ($date['weekdays'] as $day) { $this->logger->info('Setup weekly interval dates for ' . $day); $this->logger->info('Start ' . $date['start']); @@ -416,11 +413,9 @@ class DestinationDataImportService { } } } - } - } - + $this->logger->info('Finished setup dates'); } } @@ -436,9 +431,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,10 +440,8 @@ class DestinationDataImportService { $tmpOrganizer->setWeb($address['web']); $tmpOrganizer->setEmail($address['email']); $tmpOrganizer->setDistrict($address['district']); - $this->organizerRepository->add($tmpOrganizer); $this->tmpCurrentEvent->setOrganizer($tmpOrganizer); - } } } @@ -526,6 +517,8 @@ class DestinationDataImportService { */ protected function setAssets(Array $assets) { + $this->logger->info("Set assets"); + $error = false; foreach ($assets as $media_object) @@ -534,6 +527,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'); @@ -632,7 +630,6 @@ class DestinationDataImportService { */ protected function doSlugUpdate() { - $this->logger->info('Update slugs'); $slugHelper = GeneralUtility::makeInstance( @@ -672,4 +669,4 @@ class DestinationDataImportService { return true; } -} \ No newline at end of file +} From bd4409fd76025d95c5947b331fdfde9636d9b214 Mon Sep 17 00:00:00 2001 From: Dirk Date: Fri, 11 Oct 2019 15:12:07 +0200 Subject: [PATCH 04/21] [TASK] Fix DateTime Issue --- Classes/Domain/Model/Date.php | 4 +- Classes/Domain/Repository/DateRepository.php | 3 +- .../Service/DestinationDataImportService.php | 15 ++-- .../TCA/tx_events_domain_model_date.php | 12 +-- ext_tables.sql | 85 +++++++++---------- 5 files changed, 55 insertions(+), 64 deletions(-) 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/Repository/DateRepository.php b/Classes/Domain/Repository/DateRepository.php index 7440753..0061396 100644 --- a/Classes/Domain/Repository/DateRepository.php +++ b/Classes/Domain/Repository/DateRepository.php @@ -86,7 +86,8 @@ class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository ] ); } else { - $constraints['untilnow'] = $query->greaterThanOrEqual('start', date("Y-m-d H:i:s")); + $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 8d8f7dd..1fd0b2b 100644 --- a/Classes/Service/DestinationDataImportService.php +++ b/Classes/Service/DestinationDataImportService.php @@ -346,15 +346,15 @@ class DestinationDataImportService { $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'])); @@ -369,13 +369,14 @@ class DestinationDataImportService { } else { if ($date['freq'] == 'Daily' && empty($date['weekdays'])) { + $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')); @@ -388,6 +389,7 @@ class DestinationDataImportService { $this->tmpCurrentEvent->addDate($dateObj); } } + } else if ($date['freq'] == 'Weekly' && !empty($date['weekdays'])) { @@ -397,9 +399,8 @@ class DestinationDataImportService { $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($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')); @@ -415,8 +416,8 @@ class DestinationDataImportService { } } } - $this->logger->info('Finished setup dates'); } + $this->logger->info('Finished setup dates'); } /** 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/ext_tables.sql b/ext_tables.sql index dfa2b6e..06729ef 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -3,32 +3,32 @@ # 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', + 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', - KEY dataHandler (l10n_parent, t3ver_oid, deleted, t3ver_wsid, t3ver_state) + KEY dataHandler (l10n_parent, t3ver_oid, deleted, t3ver_wsid, t3ver_state) ); # @@ -36,30 +36,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) ); # @@ -67,7 +64,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, ); @@ -76,6 +73,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, ); From b632a32fe77c2551921dd99891d46711c26f2f20 Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 7 Nov 2019 10:25:09 +0100 Subject: [PATCH 05/21] Remove cat parent uid from arguments --- .../Command/DestinationDataImportCommand.php | 9 +-------- .../Service/DestinationDataImportService.php | 17 ++++++++--------- Configuration/TypoScript/constants.typoscript | 2 ++ Configuration/TypoScript/setup.typoscript | 1 + 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/Classes/Command/DestinationDataImportCommand.php b/Classes/Command/DestinationDataImportCommand.php index 5cd0802..dd90041 100644 --- a/Classes/Command/DestinationDataImportCommand.php +++ b/Classes/Command/DestinationDataImportCommand.php @@ -23,7 +23,7 @@ class DestinationDataImportCommand extends Command { 'storage-pid', InputArgument::OPTIONAL, 'What is the storage pid?', - '6' + '284' ); $this->addArgument( 'region-uid', @@ -31,12 +31,6 @@ class DestinationDataImportCommand extends Command { 'What is the region uid?', '1' ); - $this->addArgument( - 'category-parent-uid', - InputArgument::OPTIONAL, - 'What is the default category parent uid?', - '52' - ); $this->addArgument('rest-experience', InputArgument::OPTIONAL, 'What is the rest experience?', @@ -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/Service/DestinationDataImportService.php b/Classes/Service/DestinationDataImportService.php index 1fd0b2b..da15e9a 100644 --- a/Classes/Service/DestinationDataImportService.php +++ b/Classes/Service/DestinationDataImportService.php @@ -185,27 +185,26 @@ 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->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 diff --git a/Configuration/TypoScript/constants.typoscript b/Configuration/TypoScript/constants.typoscript index 9b055f4..1aa0668 100644 --- a/Configuration/TypoScript/constants.typoscript +++ b/Configuration/TypoScript/constants.typoscript @@ -26,6 +26,8 @@ plugin.tx_events { 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..0f88a79 100644 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -52,6 +52,7 @@ plugin.tx_events { restLimit = {$plugin.tx_events.settings.destinationData.restLimit} restTemplate = {$plugin.tx_events.settings.destinationData.restTemplate} categoriesPid = {$plugin.tx_events.settings.destinationData.categoriesPid} + categoryParentUid = {$plugin.tx_events.settings.destinationData.categoryParentUid} } } } From 890dcd4b351c8dba5300022b21d3e582b5cdf36a Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 7 Nov 2019 14:16:28 +0100 Subject: [PATCH 06/21] Make default image configurable --- .../Command/DestinationDataImportCommand.php | 2 +- Configuration/TypoScript/constants.typoscript | 2 + Configuration/TypoScript/setup.typoscript | 1 + .../Private/Partials/Date/ListDefault.html | 4 +- .../Private/Partials/Date/ListTable.html | 4 +- Resources/Private/Templates/Date/List.html | 28 ++++---- Resources/Private/Templates/Date/Search.html | 2 +- Resources/Private/Templates/Date/Show.html | 68 +++++++++--------- Resources/Private/Templates/Date/Teaser.html | 4 +- Resources/Private/Templates/Event/List.html | 58 +++++++-------- Resources/Private/Templates/Event/Search.html | 4 +- Resources/Private/Templates/Event/Show.html | 64 +++++++++-------- Resources/Private/Templates/Event/Teaser.html | 4 +- Resources/Public/Images/default.jpg | Bin 0 -> 10345 bytes 14 files changed, 131 insertions(+), 114 deletions(-) create mode 100644 Resources/Public/Images/default.jpg diff --git a/Classes/Command/DestinationDataImportCommand.php b/Classes/Command/DestinationDataImportCommand.php index dd90041..af9f75b 100644 --- a/Classes/Command/DestinationDataImportCommand.php +++ b/Classes/Command/DestinationDataImportCommand.php @@ -29,7 +29,7 @@ class DestinationDataImportCommand extends Command { 'region-uid', InputArgument::OPTIONAL, 'What is the region uid?', - '1' + '6' ); $this->addArgument('rest-experience', InputArgument::OPTIONAL, diff --git a/Configuration/TypoScript/constants.typoscript b/Configuration/TypoScript/constants.typoscript index 1aa0668..6ae8951 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/ diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index 0f88a79..c3d1660 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 diff --git a/Resources/Private/Partials/Date/ListDefault.html b/Resources/Private/Partials/Date/ListDefault.html index 57e8b16..4bcb31f 100644 --- a/Resources/Private/Partials/Date/ListDefault.html +++ b/Resources/Private/Partials/Date/ListDefault.html @@ -10,7 +10,9 @@ - Dummy + + Dummy +
diff --git a/Resources/Private/Partials/Date/ListTable.html b/Resources/Private/Partials/Date/ListTable.html index 2099e60..3a5d01c 100644 --- a/Resources/Private/Partials/Date/ListTable.html +++ b/Resources/Private/Partials/Date/ListTable.html @@ -28,7 +28,9 @@ - Dummy + + Dummy +
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 c2360a0..cd26875 100644 --- a/Resources/Private/Templates/Date/Search.html +++ b/Resources/Private/Templates/Date/Search.html @@ -40,7 +40,7 @@ GLOBAL EVENT ID: {date.event.globalId} - Dummy + Dummy diff --git a/Resources/Private/Templates/Date/Show.html b/Resources/Private/Templates/Date/Show.html index b037174..bb388da 100644 --- a/Resources/Private/Templates/Date/Show.html +++ b/Resources/Private/Templates/Date/Show.html @@ -1,38 +1,38 @@ - - -
-
- - - - - - 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}
-

-
-
+
+
+

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

+
+
-
-
-
+
+
+
\ No newline at end of file diff --git a/Resources/Private/Templates/Date/Teaser.html b/Resources/Private/Templates/Date/Teaser.html index 9061dae..8d142ad 100644 --- a/Resources/Private/Templates/Date/Teaser.html +++ b/Resources/Private/Templates/Date/Teaser.html @@ -17,7 +17,9 @@ - Dummy + + Dummy +
diff --git a/Resources/Private/Templates/Event/List.html b/Resources/Private/Templates/Event/List.html index 3cfb726..b8235aa 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..56ace96 100644 --- a/Resources/Private/Templates/Event/Teaser.html +++ b/Resources/Private/Templates/Event/Teaser.html @@ -13,7 +13,9 @@ - Dummy + + Dummy +
diff --git a/Resources/Public/Images/default.jpg b/Resources/Public/Images/default.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1d216a4a67c99af218f7c380d055db181748e057 GIT binary patch literal 10345 zcmeH`OK;Oa5XaXfO+uQsvC>LaTM5g(03vpr#7S&5RK;mTgp8_E39hcaZLHJ}*$#1g z;=m{3%7GsE5Ij!3BlrkrZSttv26082l`PGUXZ|z$+u7(#bcNRUL-PcoUhgr=q1lRl zAi6Wu2j_@FY2w~ND7s1s{UC55j#Rn#&7Zg-1KPp{wZw95BcD)U?~| zuaBQt#x&aOYf-JJu7dmK^9v8Zx_Eh{Ukr4~V0WJ~JE0s}u7v}Q39U2Rm%}!jh|9!| z-8{=AA;F-{?!{G^H|hbSI38w1u2I&7y2vyoPH5EXlJtbBR)iK`Y4Jj>EHvbLMXpwv z@nT6e&p43}JKb?DvTL*BLyblwZdBtO@01rLN#ZM2zFIAlh_Zif2U=LR{q2cD2m88b zx`FA~OsuFKJHw#Ol1~2|!E&dvce1(`sH%StwX7IGBI^f-c-HTo!v4{@i}^$BJ3~*$ zBz!wgc4fuGTHts`j&nAlc+htO$L~8XqbM;oiFv4Mx@pJGM@g2d%01f;G+W2LPMak< zoM{?ztNv_X>9(3(so4^QeM#!Jx?Qm*ih@#8nw`B#ZpYDw7Pf;)t})AP&CQJm!g5LF z4))Bq*ywtW#Uuxp&H25EbM?l##{6Cyb8~sp3?E?E#@+r++rc0U(DwV#X_=*h2@pv%5tGp zT3s!bwl+66w;oIvmCa_C3QOz7;`+uKy|yv^@vla7iRfI4JnIxiqkA-!qN(UJdVwfv z_Wlzqd&`50H)9Ze%M*P=g%m}UQ#9H|AKu+ig)I;O0zd!=00AHX1b_e#00KY&2mk>f q00e*l5C8%|00;m9AOHk_01yBIKmZ5;0U!VbfB+Bx0{;(z=<9F8jwUAn literal 0 HcmV?d00001 From 6d94f8ccc127b347c024b36143d802cf9b2608c8 Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 7 Nov 2019 14:21:33 +0100 Subject: [PATCH 07/21] Change to fluid image --- Resources/Private/Partials/Date/ListDefault.html | 4 ++-- Resources/Private/Partials/Date/ListTable.html | 4 ++-- Resources/Private/Templates/Date/Teaser.html | 4 ++-- Resources/Private/Templates/Event/List.html | 4 ++-- Resources/Private/Templates/Event/Teaser.html | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Resources/Private/Partials/Date/ListDefault.html b/Resources/Private/Partials/Date/ListDefault.html index 4bcb31f..972152c 100644 --- a/Resources/Private/Partials/Date/ListDefault.html +++ b/Resources/Private/Partials/Date/ListDefault.html @@ -6,12 +6,12 @@ - + - Dummy + diff --git a/Resources/Private/Partials/Date/ListTable.html b/Resources/Private/Partials/Date/ListTable.html index 3a5d01c..284110f 100644 --- a/Resources/Private/Partials/Date/ListTable.html +++ b/Resources/Private/Partials/Date/ListTable.html @@ -24,12 +24,12 @@ - + - Dummy + diff --git a/Resources/Private/Templates/Date/Teaser.html b/Resources/Private/Templates/Date/Teaser.html index 8d142ad..4f2f9de 100644 --- a/Resources/Private/Templates/Date/Teaser.html +++ b/Resources/Private/Templates/Date/Teaser.html @@ -13,12 +13,12 @@ - + - Dummy + diff --git a/Resources/Private/Templates/Event/List.html b/Resources/Private/Templates/Event/List.html index b8235aa..d9ec46f 100644 --- a/Resources/Private/Templates/Event/List.html +++ b/Resources/Private/Templates/Event/List.html @@ -9,12 +9,12 @@ - + - Dummy + diff --git a/Resources/Private/Templates/Event/Teaser.html b/Resources/Private/Templates/Event/Teaser.html index 56ace96..b0019bb 100644 --- a/Resources/Private/Templates/Event/Teaser.html +++ b/Resources/Private/Templates/Event/Teaser.html @@ -9,12 +9,12 @@ - + - Dummy + From 24262675676092511eb3abcd7f8c16863d6197b0 Mon Sep 17 00:00:00 2001 From: Dirk Date: Mon, 11 Nov 2019 12:43:50 +0100 Subject: [PATCH 08/21] Refactoring --- Classes/Controller/DateController.php | 59 ++--- Configuration/FlexForms/DateList.xml | 236 ++++++++++++++++++ Configuration/FlexForms/Search.xml | 29 +++ Configuration/TCA/Overrides/tt_content.php | 32 +++ .../Private/Partials/Date/ListDefault.html | 12 +- .../Private/Partials/Date/ListTable.html | 33 ++- ...rchForm.html => ~OBSOLETE-SearchForm.html} | 6 +- Resources/Private/Templates/Date/Search.html | 114 +++++---- .../Private/Templates/Date/SearchHtml.html | 68 +++++ .../ViewHelpers/Widget/Paginate/Index.html | 162 ++++++------ ext_localconf.php | 35 ++- 11 files changed, 589 insertions(+), 197 deletions(-) create mode 100644 Configuration/FlexForms/DateList.xml create mode 100644 Configuration/FlexForms/Search.xml rename Resources/Private/Partials/Date/{SearchForm.html => ~OBSOLETE-SearchForm.html} (94%) create mode 100644 Resources/Private/Templates/Date/SearchHtml.html diff --git a/Classes/Controller/DateController.php b/Classes/Controller/DateController.php index 601bb9c..90e8444 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,19 @@ 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']; $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); - } /** @@ -172,13 +159,11 @@ 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'))); - 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'))); $demand->setSortBy((string)$this->settings['sortByDate']); $demand->setSortOrder((string)$this->settings['sortOrder']); diff --git a/Configuration/FlexForms/DateList.xml b/Configuration/FlexForms/DateList.xml new file mode 100644 index 0000000..e971c51 --- /dev/null +++ b/Configuration/FlexForms/DateList.xml @@ -0,0 +1,236 @@ + + + + + + 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/Search.xml b/Configuration/FlexForms/Search.xml new file mode 100644 index 0000000..dfaf631 --- /dev/null +++ b/Configuration/FlexForms/Search.xml @@ -0,0 +1,29 @@ + + + + + + Options + + array + + + + 1 + + + group + db + pages + 1 + 1 + 0 + 1 + + + + + + + + \ No newline at end of file diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index f83f45a..d6ae958 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -20,5 +20,37 @@ 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/Search.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' + ); + }); diff --git a/Resources/Private/Partials/Date/ListDefault.html b/Resources/Private/Partials/Date/ListDefault.html index 972152c..27013fc 100644 --- a/Resources/Private/Partials/Date/ListDefault.html +++ b/Resources/Private/Partials/Date/ListDefault.html @@ -21,11 +21,13 @@ {date.event.region.title} | {date.start}

{date.event.title}

{date.event.teaser}

- - - Hightlight - - + + + + Hightlight + + +
diff --git a/Resources/Private/Partials/Date/ListTable.html b/Resources/Private/Partials/Date/ListTable.html index 284110f..6cffa86 100644 --- a/Resources/Private/Partials/Date/ListTable.html +++ b/Resources/Private/Partials/Date/ListTable.html @@ -1,9 +1,9 @@ - - -
+ + +
{date.start}
{date.start}
@@ -11,30 +11,45 @@ {date.event.region.title}
-

{date.event.title}

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

+ + {date.event.title} + +

+

{date.event.teaser}

+ {date.event.details} +
+DEBUGGING:
+GLOBAL EVENT ID: {date.event.globalId}
+                
-
+
- + - + Dummy
+ + + + +
+
+
diff --git a/Resources/Private/Partials/Date/SearchForm.html b/Resources/Private/Partials/Date/~OBSOLETE-SearchForm.html similarity index 94% rename from Resources/Private/Partials/Date/SearchForm.html rename to Resources/Private/Partials/Date/~OBSOLETE-SearchForm.html index 315748f..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/Search.html b/Resources/Private/Templates/Date/Search.html index cd26875..3937095 100644 --- a/Resources/Private/Templates/Date/Search.html +++ b/Resources/Private/Templates/Date/Search.html @@ -1,60 +1,68 @@ + + +
+
+ + - +
+
+
+ + +
+
+
-
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
- - -
-
- {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/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/ext_localconf.php b/ext_localconf.php index 35e873e..b8c39cc 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -18,6 +18,31 @@ call_user_func( ] ); + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'Wrm.Events', + 'DateSearch', + [ + 'Date' => 'search' + ] + ); + + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'Wrm.Events', + 'DateList', + [ + 'Date' => 'list' + ] + ); + + /* + $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( 'mod { @@ -37,14 +62,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'] - ); - + */ } ); From c8dacc93dfb394200b51a7488359c664da059007 Mon Sep 17 00:00:00 2001 From: Dirk Date: Mon, 11 Nov 2019 13:36:56 +0100 Subject: [PATCH 09/21] Change plugin conf --- ext_localconf.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext_localconf.php b/ext_localconf.php index b8c39cc..42eeecf 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -21,6 +21,9 @@ call_user_func( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'Wrm.Events', 'DateSearch', + [ + 'Date' => 'search' + ], [ 'Date' => 'search' ] @@ -29,6 +32,9 @@ call_user_func( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'Wrm.Events', 'DateList', + [ + 'Date' => 'list' + ], [ 'Date' => 'list' ] From 6e11f00c134e0c2bba65f222f40c9f47b5dc5099 Mon Sep 17 00:00:00 2001 From: Dirk Date: Tue, 12 Nov 2019 08:16:35 +0100 Subject: [PATCH 10/21] Integrate new event search --- Configuration/FlexForms/Search.xml | 10 +++++ Resources/Private/Layouts/Default.html | 6 +-- Resources/Private/Templates/Date/Search.html | 39 +++++++++----------- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/Configuration/FlexForms/Search.xml b/Configuration/FlexForms/Search.xml index dfaf631..e75921a 100644 --- a/Configuration/FlexForms/Search.xml +++ b/Configuration/FlexForms/Search.xml @@ -22,6 +22,16 @@ + + + 1 + + + check + 0 + + + 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/Templates/Date/Search.html b/Resources/Private/Templates/Date/Search.html index 3937095..633f815 100644 --- a/Resources/Private/Templates/Date/Search.html +++ b/Resources/Private/Templates/Date/Search.html @@ -3,9 +3,7 @@
- -
@@ -14,9 +12,8 @@
-
-
+
@@ -27,7 +24,7 @@
-
+
@@ -39,24 +36,25 @@
- -
-
-
- - -
-
- - -
+ +
+
- - + +
- -
+ + +
+
+ + +
+
+
+
+
@@ -64,5 +62,4 @@
- \ No newline at end of file From 38a76b26f9868ae98ec5969b9dbd723b5419cdf1 Mon Sep 17 00:00:00 2001 From: Dirk Date: Wed, 13 Nov 2019 10:46:21 +0100 Subject: [PATCH 11/21] Add show plugin, prepare consider date --- Classes/Controller/DateController.php | 5 ++ Classes/Domain/Model/Dto/DateDemand.php | 21 +++++++ Classes/Domain/Repository/DateRepository.php | 2 +- .../FlexForms/{Search.xml => DateSearch.xml} | 0 Configuration/FlexForms/DateShow.xml | 57 +++++++++++++++++++ Configuration/TCA/Overrides/tt_content.php | 22 ++++++- Resources/Private/Templates/Date/Search.html | 10 ++++ ext_localconf.php | 11 ++++ 8 files changed, 124 insertions(+), 4 deletions(-) rename Configuration/FlexForms/{Search.xml => DateSearch.xml} (100%) create mode 100644 Configuration/FlexForms/DateShow.xml diff --git a/Classes/Controller/DateController.php b/Classes/Controller/DateController.php index 90e8444..ea5446e 100644 --- a/Classes/Controller/DateController.php +++ b/Classes/Controller/DateController.php @@ -88,6 +88,7 @@ class DateController extends ActionController $selRegion = $arguments['region']; $start = $arguments['start']; $end = $arguments['end']; + $considerDate = $arguments['considerDate']; $regions = $this->regionRepository->findAll(); $this->view->assign('regions', $regions); @@ -96,6 +97,7 @@ class DateController extends ActionController $this->view->assign('selRegion', $selRegion); $this->view->assign('start', $start); $this->view->assign('end', $end); + $this->view->assign('considerDate', $considerDate); } /** @@ -165,6 +167,9 @@ class DateController extends ActionController if ($this->request->hasArgument('end') && $this->request->getArgument('end') != '') $demand->setEnd(strtotime($this->request->getArgument('end'))); + 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/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/Repository/DateRepository.php b/Classes/Domain/Repository/DateRepository.php index 0061396..86ac8e3 100644 --- a/Classes/Domain/Repository/DateRepository.php +++ b/Classes/Domain/Repository/DateRepository.php @@ -82,7 +82,7 @@ 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 { diff --git a/Configuration/FlexForms/Search.xml b/Configuration/FlexForms/DateSearch.xml similarity index 100% rename from Configuration/FlexForms/Search.xml rename to Configuration/FlexForms/DateSearch.xml 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 d6ae958..ab4974d 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -25,7 +25,7 @@ call_user_func(function () { \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( 'Wrm.Events', 'DateSearch', - 'Events Date Search', + 'Events: Date Search', 'EXT:events/Resources/Public/Icons/user_plugin_events.svg' ); @@ -33,7 +33,7 @@ call_user_func(function () { \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( 'events_datesearch', - 'FILE:EXT:events/Configuration/FlexForms/Search.xml' + 'FILE:EXT:events/Configuration/FlexForms/DateSearch.xml' ); /* Date List Plugin */ @@ -41,7 +41,7 @@ call_user_func(function () { \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( 'Wrm.Events', 'DateList', - 'Events Date List', + 'Events: Date List', 'EXT:events/Resources/Public/Icons/user_plugin_events.svg' ); @@ -52,5 +52,21 @@ call_user_func(function () { '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/Resources/Private/Templates/Date/Search.html b/Resources/Private/Templates/Date/Search.html index 633f815..e26d859 100644 --- a/Resources/Private/Templates/Date/Search.html +++ b/Resources/Private/Templates/Date/Search.html @@ -12,6 +12,16 @@
+
diff --git a/ext_localconf.php b/ext_localconf.php index 42eeecf..fee4d97 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -40,6 +40,17 @@ call_user_func( ] ); + \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); From 054856e25800c8c4b65e62bf2d3b2c2e71005491 Mon Sep 17 00:00:00 2001 From: Dirk Date: Fri, 15 Nov 2019 08:25:50 +0100 Subject: [PATCH 12/21] Deactivate old plugin --- Configuration/FlexForms/DateSearch.xml | 4 ++-- Resources/Private/Templates/Date/Search.html | 2 +- ext_localconf.php | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Configuration/FlexForms/DateSearch.xml b/Configuration/FlexForms/DateSearch.xml index e75921a..ae07a9f 100644 --- a/Configuration/FlexForms/DateSearch.xml +++ b/Configuration/FlexForms/DateSearch.xml @@ -7,7 +7,7 @@ array - + 1 @@ -21,7 +21,7 @@ 1 - + 1 diff --git a/Resources/Private/Templates/Date/Search.html b/Resources/Private/Templates/Date/Search.html index e26d859..ffb62ff 100644 --- a/Resources/Private/Templates/Date/Search.html +++ b/Resources/Private/Templates/Date/Search.html @@ -3,7 +3,7 @@
- +
diff --git a/ext_localconf.php b/ext_localconf.php index fee4d97..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,7 @@ call_user_func( 'Date' => 'teaser, list, show, search' ] ); + */ \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'Wrm.Events', From 080e526b26307551ad1c393447f5e112c7fc8730 Mon Sep 17 00:00:00 2001 From: Dirk Date: Fri, 15 Nov 2019 08:26:52 +0100 Subject: [PATCH 13/21] Remove debug output --- Resources/Private/Partials/Date/ListTable.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Resources/Private/Partials/Date/ListTable.html b/Resources/Private/Partials/Date/ListTable.html index 6cffa86..9b49ae6 100644 --- a/Resources/Private/Partials/Date/ListTable.html +++ b/Resources/Private/Partials/Date/ListTable.html @@ -23,10 +23,6 @@

{date.event.teaser}

{date.event.details} -
-DEBUGGING:
-GLOBAL EVENT ID: {date.event.globalId}
-                
From e388ece205ccab759f073fff24cb7ffdfaabd199 Mon Sep 17 00:00:00 2001 From: Dirk Date: Wed, 11 Dec 2019 09:15:07 +0100 Subject: [PATCH 14/21] Fix date constraint for same days --- Classes/Controller/DateController.php | 4 ++-- Classes/Domain/Repository/DateRepository.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/Controller/DateController.php b/Classes/Controller/DateController.php index ea5446e..abefbaa 100644 --- a/Classes/Controller/DateController.php +++ b/Classes/Controller/DateController.php @@ -162,10 +162,10 @@ class DateController extends ActionController $demand->setSearchword((string)$this->request->getArgument('searchword')); if ($this->request->hasArgument('start') && $this->request->getArgument('start') != '') - $demand->setStart(strtotime($this->request->getArgument('start'))); + $demand->setStart(strtotime($this->request->getArgument('start') + ' 00:00:00')); if ($this->request->hasArgument('end') && $this->request->getArgument('end') != '') - $demand->setEnd(strtotime($this->request->getArgument('end'))); + $demand->setEnd(strtotime($this->request->getArgument('end') + ' 23:59:59')); if ($this->request->hasArgument('considerDate') && $this->request->getArgument('considerDate') != '') $demand->setConsiderDate(strtotime($this->request->getArgument('considerDate'))); diff --git a/Classes/Domain/Repository/DateRepository.php b/Classes/Domain/Repository/DateRepository.php index 86ac8e3..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(); } /** From c150158a17b380797ead230d9111132a4b5fb3da Mon Sep 17 00:00:00 2001 From: Dirk Date: Wed, 11 Dec 2019 15:13:59 +0100 Subject: [PATCH 15/21] Fix date demand --- Classes/Controller/DateController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Controller/DateController.php b/Classes/Controller/DateController.php index abefbaa..7b5d5f1 100644 --- a/Classes/Controller/DateController.php +++ b/Classes/Controller/DateController.php @@ -162,10 +162,10 @@ class DateController extends ActionController $demand->setSearchword((string)$this->request->getArgument('searchword')); if ($this->request->hasArgument('start') && $this->request->getArgument('start') != '') - $demand->setStart(strtotime($this->request->getArgument('start') + ' 00:00:00')); + $demand->setStart(strtotime($this->request->getArgument('start') . ' 00:00')); if ($this->request->hasArgument('end') && $this->request->getArgument('end') != '') - $demand->setEnd(strtotime($this->request->getArgument('end') + ' 23:59:59')); + $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'))); From d29999076548e6d2acdab853f3ca8deef31c99e3 Mon Sep 17 00:00:00 2001 From: Dirk Date: Wed, 19 Feb 2020 09:08:15 +0100 Subject: [PATCH 16/21] Add rest mode to destination data import --- Classes/Service/DestinationDataImportService.php | 7 ++++++- Configuration/TypoScript/constants.typoscript | 2 ++ Configuration/TypoScript/setup.typoscript | 3 ++- Resources/Private/Partials/Date/ListTable.html | 2 +- Resources/Private/Templates/Date/Search.html | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Classes/Service/DestinationDataImportService.php b/Classes/Service/DestinationDataImportService.php index da15e9a..b0c81c9 100644 --- a/Classes/Service/DestinationDataImportService.php +++ b/Classes/Service/DestinationDataImportService.php @@ -42,6 +42,10 @@ class DestinationDataImportService { * @var */ protected $restLimit; + /** + * @var + */ + protected $restMode; /** * @var */ @@ -189,6 +193,7 @@ class DestinationDataImportService { $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']; @@ -224,7 +229,7 @@ class DestinationDataImportService { $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)) { diff --git a/Configuration/TypoScript/constants.typoscript b/Configuration/TypoScript/constants.typoscript index 6ae8951..2e94d1c 100644 --- a/Configuration/TypoScript/constants.typoscript +++ b/Configuration/TypoScript/constants.typoscript @@ -24,6 +24,8 @@ plugin.tx_events { restType = Event # cat=plugin.tx_events//a; type=string; label=Data Limit restLimit = 200 + # 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 diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index c3d1660..46197a6 100644 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -51,6 +51,7 @@ 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} @@ -58,4 +59,4 @@ plugin.tx_events { } } -module.tx_events < plugin.tx_events \ No newline at end of file +module.tx_events < plugin.tx_events diff --git a/Resources/Private/Partials/Date/ListTable.html b/Resources/Private/Partials/Date/ListTable.html index 9b49ae6..48505e9 100644 --- a/Resources/Private/Partials/Date/ListTable.html +++ b/Resources/Private/Partials/Date/ListTable.html @@ -49,4 +49,4 @@ - \ No newline at end of file + diff --git a/Resources/Private/Templates/Date/Search.html b/Resources/Private/Templates/Date/Search.html index ffb62ff..8267fe0 100644 --- a/Resources/Private/Templates/Date/Search.html +++ b/Resources/Private/Templates/Date/Search.html @@ -72,4 +72,4 @@
- \ No newline at end of file + From bd3dd46ec55afbc5fc7c6cc64b292ab58e1c3cd6 Mon Sep 17 00:00:00 2001 From: Dirk Date: Tue, 25 Feb 2020 08:50:03 +0100 Subject: [PATCH 17/21] Remove Highlight --- Resources/Private/Partials/Date/ListDefault.html | 4 +++- Resources/Private/Partials/Date/ListTable.html | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Resources/Private/Partials/Date/ListDefault.html b/Resources/Private/Partials/Date/ListDefault.html index 27013fc..c62a6fb 100644 --- a/Resources/Private/Partials/Date/ListDefault.html +++ b/Resources/Private/Partials/Date/ListDefault.html @@ -22,15 +22,17 @@

{date.event.title}

{date.event.teaser}

+
- \ No newline at end of file + diff --git a/Resources/Private/Partials/Date/ListTable.html b/Resources/Private/Partials/Date/ListTable.html index 48505e9..533e1a2 100644 --- a/Resources/Private/Partials/Date/ListTable.html +++ b/Resources/Private/Partials/Date/ListTable.html @@ -11,11 +11,15 @@ {date.event.region.title}
+ +

{date.event.title} From aa3879255454df6cb2232c96a822d429178cac92 Mon Sep 17 00:00:00 2001 From: Dirk Date: Tue, 25 Feb 2020 09:03:33 +0100 Subject: [PATCH 18/21] Quickfix --- Resources/Private/Partials/Date/ListTable.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Resources/Private/Partials/Date/ListTable.html b/Resources/Private/Partials/Date/ListTable.html index 533e1a2..d959692 100644 --- a/Resources/Private/Partials/Date/ListTable.html +++ b/Resources/Private/Partials/Date/ListTable.html @@ -11,8 +11,9 @@ {date.event.region.title}

-