Add lanuage handling

This commit is contained in:
Dirk Koritnik 2020-10-01 08:34:13 +02:00
parent f2973a4a99
commit 9464ad6018
8 changed files with 90 additions and 18 deletions

View file

@ -23,6 +23,11 @@ class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/ */
protected $event = null; protected $event = null;
/**
* @var int
*/
protected $languageUid;
/** /**
* @return \DateTime $start * @return \DateTime $start
*/ */
@ -74,4 +79,19 @@ class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
return $this; return $this;
} }
/**
* @param int $languageUid
* @return void
*/
public function setLanguageUid($languageUid) {
$this->languageUid = $languageUid;
}
/**
* @return int
*/
public function getLanguageUid() {
return $this->languageUid;
}
} }

View file

@ -198,6 +198,11 @@ class Event extends AbstractEntity
*/ */
protected $categories; protected $categories;
/**
* @var int
*/
protected $languageUid;
/** /**
* __construct * __construct
*/ */
@ -702,4 +707,19 @@ class Event extends AbstractEntity
{ {
$this->categories = $categories; $this->categories = $categories;
} }
/**
* @param int $languageUid
* @return void
*/
public function setLanguageUid($languageUid) {
$this->languageUid = $languageUid;
}
/**
* @return int
*/
public function getLanguageUid() {
return $this->languageUid;
}
} }

View file

@ -74,6 +74,11 @@ class Organizer extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/ */
protected $email = ''; protected $email = '';
/**
* @var int
*/
protected $languageUid;
/** /**
* Returns the name * Returns the name
* *
@ -263,4 +268,19 @@ class Organizer extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
protected function initStorageObjects() protected function initStorageObjects()
{ {
} }
/**
* @param int $languageUid
* @return void
*/
public function setLanguageUid($languageUid) {
$this->languageUid = $languageUid;
}
/**
* @return int
*/
public function getLanguageUid() {
return $this->languageUid;
}
} }

View file

@ -25,6 +25,11 @@ class Region extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/ */
protected $title = ''; protected $title = '';
/**
* @var int
*/
protected $languageUid;
/** /**
* Returns the title * Returns the title
* *
@ -67,4 +72,19 @@ class Region extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
protected function initStorageObjects() protected function initStorageObjects()
{ {
} }
/**
* @param int $languageUid
* @return void
*/
public function setLanguageUid($languageUid) {
$this->languageUid = $languageUid;
}
/**
* @return int
*/
public function getLanguageUid() {
return $this->languageUid;
}
} }

View file

@ -260,6 +260,9 @@ class DestinationDataImportService {
// Event already exists? If not create one! // Event already exists? If not create one!
$this->tmpCurrentEvent = $this->getOrCreateEvent($event['global_id'], $event['title']); $this->tmpCurrentEvent = $this->getOrCreateEvent($event['global_id'], $event['title']);
// Set language UID
$this->tmpCurrentEvent->setLanguageUid(-1);
// Set selected Region // Set selected Region
$this->tmpCurrentEvent->setRegion($selectedRegion); $this->tmpCurrentEvent->setRegion($selectedRegion);
@ -369,6 +372,8 @@ class DestinationDataImportService {
$end = new \DateTime($date['end'], new \DateTimeZone($date['tz'])); $end = new \DateTime($date['end'], new \DateTimeZone($date['tz']));
$this->logger->info('Start transformed ' . $start->format('Y-m-d H:i')); $this->logger->info('Start transformed ' . $start->format('Y-m-d H:i'));
$this->logger->info('End transformed ' . $end->format('Y-m-d H:i')); $this->logger->info('End transformed ' . $end->format('Y-m-d H:i'));
// Set language UID
$dateObj->setLanguageUid(-1);
$dateObj->setStart($start); $dateObj->setStart($start);
$dateObj->setEnd($end); $dateObj->setEnd($end);
$this->tmpCurrentEvent->addDate($dateObj); $this->tmpCurrentEvent->addDate($dateObj);
@ -393,6 +398,7 @@ class DestinationDataImportService {
$eventEnd->setTimestamp($i); $eventEnd->setTimestamp($i);
$eventEnd->setTime($until->format('H'), $until->format('i')); $eventEnd->setTime($until->format('H'), $until->format('i'));
$dateObj = $this->objectManager->get(\Wrm\Events\Domain\Model\Date::class); $dateObj = $this->objectManager->get(\Wrm\Events\Domain\Model\Date::class);
$dateObj->setLanguageUid(-1);
$dateObj->setStart($eventStart); $dateObj->setStart($eventStart);
$dateObj->setEnd($eventEnd); $dateObj->setEnd($eventEnd);
$this->tmpCurrentEvent->addDate($dateObj); $this->tmpCurrentEvent->addDate($dateObj);
@ -418,6 +424,7 @@ class DestinationDataImportService {
$eventEnd->setTimestamp($i); $eventEnd->setTimestamp($i);
$eventEnd->setTime($until->format('H'), $until->format('i')); $eventEnd->setTime($until->format('H'), $until->format('i'));
$dateObj = $this->objectManager->get(\Wrm\Events\Domain\Model\Date::class); $dateObj = $this->objectManager->get(\Wrm\Events\Domain\Model\Date::class);
$dateObj->setLanguageUid(-1);
$dateObj->setStart($eventStart); $dateObj->setStart($eventStart);
$dateObj->setEnd($eventEnd); $dateObj->setEnd($eventEnd);
$this->tmpCurrentEvent->addDate($dateObj); $this->tmpCurrentEvent->addDate($dateObj);
@ -443,6 +450,7 @@ class DestinationDataImportService {
continue; continue;
} }
$tmpOrganizer = $this->objectManager->get(\Wrm\Events\Domain\Model\Organizer::class); $tmpOrganizer = $this->objectManager->get(\Wrm\Events\Domain\Model\Organizer::class);
$tmpOrganizer->setLanguageUid(-1);
$tmpOrganizer->setName($address['name']); $tmpOrganizer->setName($address['name']);
$tmpOrganizer->setCity($address['city']); $tmpOrganizer->setCity($address['city']);
$tmpOrganizer->setZip($address['zip']); $tmpOrganizer->setZip($address['zip']);

View file

@ -8,7 +8,6 @@
"role": "Developer" "role": "Developer"
} }
], ],
"version": "1.0.0",
"require": { "require": {
"typo3/cms-core": "^9.5" "typo3/cms-core": "^9.5"
}, },

View file

@ -20,7 +20,7 @@ $EM_CONF[$_EXTKEY] = [
'uploadfolder' => 1, 'uploadfolder' => 1,
'createDirs' => '', 'createDirs' => '',
'clearCacheOnLoad' => 0, 'clearCacheOnLoad' => 0,
'version' => '1.0.0', 'version' => '1.0.1',
'constraints' => [ 'constraints' => [
'depends' => [ 'depends' => [
'typo3' => '9.5.0-9.5.99', 'typo3' => '9.5.0-9.5.99',

View file

@ -5,21 +5,6 @@ call_user_func(
function() function()
{ {
/*
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Wrm.Events',
'Pi1',
[
'Event' => 'teaser, list, show, search',
'Date' => 'teaser, list, show, search'
],
[
'Event' => 'teaser, list, show, search',
'Date' => 'teaser, list, show, search'
]
);
*/
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Wrm.Events', 'Wrm.Events',
'DateSearch', 'DateSearch',