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;
/**
* @var int
*/
protected $languageUid;
/**
* @return \DateTime $start
*/
@ -74,4 +79,19 @@ class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
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;
/**
* @var int
*/
protected $languageUid;
/**
* __construct
*/
@ -702,4 +707,19 @@ class Event extends AbstractEntity
{
$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 = '';
/**
* @var int
*/
protected $languageUid;
/**
* Returns the name
*
@ -263,4 +268,19 @@ class Organizer extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
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

@ -24,6 +24,11 @@ class Region extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @var string
*/
protected $title = '';
/**
* @var int
*/
protected $languageUid;
/**
* Returns the title
@ -67,4 +72,19 @@ class Region extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
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!
$this->tmpCurrentEvent = $this->getOrCreateEvent($event['global_id'], $event['title']);
// Set language UID
$this->tmpCurrentEvent->setLanguageUid(-1);
// Set selected Region
$this->tmpCurrentEvent->setRegion($selectedRegion);
@ -369,6 +372,8 @@ class DestinationDataImportService {
$end = new \DateTime($date['end'], new \DateTimeZone($date['tz']));
$this->logger->info('Start transformed ' . $start->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->setEnd($end);
$this->tmpCurrentEvent->addDate($dateObj);
@ -393,6 +398,7 @@ class DestinationDataImportService {
$eventEnd->setTimestamp($i);
$eventEnd->setTime($until->format('H'), $until->format('i'));
$dateObj = $this->objectManager->get(\Wrm\Events\Domain\Model\Date::class);
$dateObj->setLanguageUid(-1);
$dateObj->setStart($eventStart);
$dateObj->setEnd($eventEnd);
$this->tmpCurrentEvent->addDate($dateObj);
@ -418,6 +424,7 @@ class DestinationDataImportService {
$eventEnd->setTimestamp($i);
$eventEnd->setTime($until->format('H'), $until->format('i'));
$dateObj = $this->objectManager->get(\Wrm\Events\Domain\Model\Date::class);
$dateObj->setLanguageUid(-1);
$dateObj->setStart($eventStart);
$dateObj->setEnd($eventEnd);
$this->tmpCurrentEvent->addDate($dateObj);
@ -443,6 +450,7 @@ class DestinationDataImportService {
continue;
}
$tmpOrganizer = $this->objectManager->get(\Wrm\Events\Domain\Model\Organizer::class);
$tmpOrganizer->setLanguageUid(-1);
$tmpOrganizer->setName($address['name']);
$tmpOrganizer->setCity($address['city']);
$tmpOrganizer->setZip($address['zip']);

View file

@ -8,7 +8,6 @@
"role": "Developer"
}
],
"version": "1.0.0",
"require": {
"typo3/cms-core": "^9.5"
},
@ -26,4 +25,4 @@
"events": "self.version",
"typo3-ter/events": "self.version"
}
}
}

View file

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

View file

@ -5,21 +5,6 @@ call_user_func(
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(
'Wrm.Events',
'DateSearch',