Add social links

This commit is contained in:
Dirk 2020-08-19 11:30:13 +02:00
parent e13cc33e41
commit 3e643176a3
6 changed files with 68 additions and 49 deletions

View file

@ -23,13 +23,13 @@ class DestinationDataImportCommand extends Command {
'storage-pid', 'storage-pid',
InputArgument::OPTIONAL, InputArgument::OPTIONAL,
'What is the storage pid?', 'What is the storage pid?',
'284' '6'
); );
$this->addArgument( $this->addArgument(
'region-uid', 'region-uid',
InputArgument::OPTIONAL, InputArgument::OPTIONAL,
'What is the region uid?', 'What is the region uid?',
'6' '1'
); );
$this->addArgument('rest-experience', $this->addArgument('rest-experience',
InputArgument::OPTIONAL, InputArgument::OPTIONAL,

View file

@ -106,7 +106,7 @@ class Event extends AbstractEntity
protected $country = ''; protected $country = '';
/** /**
* web * phone
* *
* @var string * @var string
*/ */
@ -119,13 +119,6 @@ class Event extends AbstractEntity
*/ */
protected $web = ''; protected $web = '';
/**
* booking
*
* @var string
*/
protected $booking = '';
/** /**
* ticket * ticket
* *
@ -147,6 +140,13 @@ class Event extends AbstractEntity
*/ */
protected $youtube = ''; protected $youtube = '';
/**
* instagram
*
* @var string
*/
protected $instagram = '';
/** /**
* latitude * latitude
* *
@ -421,23 +421,6 @@ class Event extends AbstractEntity
$this->web = $web; $this->web = $web;
} }
/**
* @return string $booking
*/
public function getBooking()
{
return $this->booking;
}
/**
* @param string $booking
* @return void
*/
public function setBooking($booking)
{
$this->booking = $booking;
}
/** /**
* @return string $ticket * @return string $ticket
*/ */
@ -489,6 +472,22 @@ class Event extends AbstractEntity
$this->youtube = $youtube; $this->youtube = $youtube;
} }
/**
* @return string $instagram
*/
public function getInstagram()
{
return $this->instagram;
}
/**
* @param string $instagram
*/
public function setInstagram(string $instagram)
{
$this->instagram = $instagram;
}
/** /**
* @return string $latitude * @return string $latitude
*/ */

View file

@ -87,9 +87,9 @@ class DestinationDataImportService {
*/ */
protected $environment; protected $environment;
/** /**
* @var bool * @var
*/ */
protected $tmpCurrentEvent = FALSE; protected $tmpCurrentEvent;
/** /**
* @var * @var
*/ */
@ -275,8 +275,7 @@ class DestinationDataImportService {
$this->setTexts($event['texts']); $this->setTexts($event['texts']);
// Set address and geo data // Set address and geo data
if($event['name'] || $event['street'] || $event['city'] || $event['zip'] || $event['country'] || $event['web'])
if($event['name'] || $event['street'] || $event['city'] || $event['zip'] || $event['country'])
$this->setAddress($event); $this->setAddress($event);
// Set LatLng // Set LatLng
@ -291,6 +290,10 @@ class DestinationDataImportService {
if($event['addresses']) if($event['addresses'])
$this->setOrganizer($event['addresses']); $this->setOrganizer($event['addresses']);
// Set Social and Tickets
if($event['media_objects'])
$this->setSocial($event['media_objects']);
// Set Dates // Set Dates
if($event['timeIntervals']) if($event['timeIntervals'])
$this->setDates($event['timeIntervals']); $this->setDates($event['timeIntervals']);
@ -474,6 +477,23 @@ class DestinationDataImportService {
$this->tmpCurrentEvent->setWeb($event['web']); $this->tmpCurrentEvent->setWeb($event['web']);
} }
/**
* @param array $media
*/
protected function setSocial(Array $media) {
foreach ($media as $link)
{
if ($link['rel'] == "socialmedia" && $link['value'] == "Facebook")
$this->tmpCurrentEvent->setFacebook($link['url']);
if ($link['rel'] == "socialmedia" && $link['value'] == "YouTube")
$this->tmpCurrentEvent->setYouTube($link['url']);
if ($link['rel'] == "socialmedia" && $link['value'] == "Instagram")
$this->tmpCurrentEvent->setInstagram($link['url']);
if ($link['rel'] == "booking")
$this->tmpCurrentEvent->setTicket($link['url']);
}
}
/** /**
* @param string $lat * @param string $lat
* @param string $lng * @param string $lng
@ -491,13 +511,13 @@ class DestinationDataImportService {
foreach ($texts as $text) foreach ($texts as $text)
{ {
if ($text['rel'] == "details" && $text['type'] == "text/plain") { if ($text['rel'] == "details" && $text['type'] == "text/plain") {
$this->tmpCurrentEvent->setDetails($text['value']); $this->tmpCurrentEvent->setDetails(str_replace('\n\n', '\n', $text['value']));
} }
if ($text['rel'] == "teaser" && $text['type'] == "text/plain") { if ($text['rel'] == "teaser" && $text['type'] == "text/plain") {
$this->tmpCurrentEvent->setTeaser($text['value']); $this->tmpCurrentEvent->setTeaser(str_replace('\n\n', '\n', $text['value']));
} }
if ($text['rel'] == "PRICE_INFO" && $text['type'] == "text/plain") { if ($text['rel'] == "PRICE_INFO" && $text['type'] == "text/plain") {
$this->tmpCurrentEvent->setPriceInfo($text['value']); $this->tmpCurrentEvent->setPriceInfo(str_replace('\n\n', '\n', $text['value']));
} }
} }
} }

View file

@ -20,10 +20,10 @@ return [
'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_event.gif' 'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_event.gif'
], ],
'interface' => [ '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, phone, 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, ticket, facebook, youtube, instagram, latitude, longitude, images, categories, dates, organizer, region',
], ],
'types' => [ '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, 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'], '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, ticket, facebook, youtube, instagram, latitude, longitude, images, categories, dates, organizer, region, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
], ],
'columns' => [ 'columns' => [
'sys_language_uid' => [ 'sys_language_uid' => [
@ -273,15 +273,6 @@ return [
'eval' => 'trim' 'eval' => 'trim'
], ],
], ],
'booking' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.booking',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'ticket' => [ 'ticket' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.ticket', 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.ticket',
@ -309,6 +300,15 @@ return [
'eval' => 'trim' 'eval' => 'trim'
], ],
], ],
'instagram' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.instagram',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'latitude' => [ 'latitude' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.latitude', 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_db.xlf:tx_events_domain_model_event.latitude',

View file

@ -57,9 +57,6 @@
<trans-unit id="tx_events_domain_model_event.phone"> <trans-unit id="tx_events_domain_model_event.phone">
<source>Phone</source> <source>Phone</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.booking">
<source>Booking</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.ticket"> <trans-unit id="tx_events_domain_model_event.ticket">
<source>Ticket</source> <source>Ticket</source>
</trans-unit> </trans-unit>
@ -69,6 +66,9 @@
<trans-unit id="tx_events_domain_model_event.youtube"> <trans-unit id="tx_events_domain_model_event.youtube">
<source>Youtube</source> <source>Youtube</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_event.instagram">
<source>Instagram</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.latitude"> <trans-unit id="tx_events_domain_model_event.latitude">
<source>Latitude</source> <source>Latitude</source>
</trans-unit> </trans-unit>

View file

@ -18,10 +18,10 @@ CREATE TABLE tx_events_domain_model_event (
country varchar(255) DEFAULT '' NOT NULL, country varchar(255) DEFAULT '' NOT NULL,
web varchar(255) DEFAULT '' NOT NULL, web varchar(255) DEFAULT '' NOT NULL,
phone varchar(255) DEFAULT '' NOT NULL, phone varchar(255) DEFAULT '' NOT NULL,
booking varchar(255) DEFAULT '' NOT NULL,
ticket varchar(255) DEFAULT '' NOT NULL, ticket varchar(255) DEFAULT '' NOT NULL,
facebook varchar(255) DEFAULT '' NOT NULL, facebook varchar(255) DEFAULT '' NOT NULL,
youtube varchar(255) DEFAULT '' NOT NULL, youtube varchar(255) DEFAULT '' NOT NULL,
instagram varchar(255) DEFAULT '' NOT NULL,
latitude varchar(255) DEFAULT '' NOT NULL, latitude varchar(255) DEFAULT '' NOT NULL,
longitude varchar(255) DEFAULT '' NOT NULL, longitude varchar(255) DEFAULT '' NOT NULL,
images int(11) unsigned NOT NULL default '0', images int(11) unsigned NOT NULL default '0',