diff --git a/web/typo3conf/ext/ep_products/Classes/Controller/MapController.php b/web/typo3conf/ext/ep_products/Classes/Controller/MapController.php index 12247f67..ff970e2c 100644 --- a/web/typo3conf/ext/ep_products/Classes/Controller/MapController.php +++ b/web/typo3conf/ext/ep_products/Classes/Controller/MapController.php @@ -92,6 +92,7 @@ class MapController extends ActionController $markerData[] = [ 'name' => $product->getName(), 'uri' => $this->getUriForPageUid($product->getDetailPage()), + 'externalLink' => $hotel->getExternalLink(), 'teaser' => $product->getTeaser(), 'lat' => $hotel->getLatitude(), 'lng' => $hotel->getLongitude(), diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php b/web/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php index ded33f5b..72ce1ca2 100644 --- a/web/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php @@ -222,6 +222,11 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te */ protected $facts; + /** + * @var string + */ + protected $externalLink; + public function __construct() { $this->initStorageObjects(); @@ -832,4 +837,20 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te $this->facts = $facts; } + /** + * @return string + */ + public function getExternalLink() + { + return $this->externalLink; + } + + /** + * @param string $externalLink + */ + public function setExternalLink($externalLink) + { + $this->externalLink = $externalLink; + } + } diff --git a/web/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php b/web/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php index 935cdb32..0798dd04 100644 --- a/web/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php +++ b/web/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php @@ -22,14 +22,14 @@ return [ 'endtime' => 'endtime', ], 'searchFields' => 'name,headline,teaser,description,features,room_types,additional_information,teaser_images, - header_images,images,reseller_images,code,type,category,country,region,city,teamer,products,', + header_images,images,reseller_images,code,type,category,country,region,city,teamer,products,external_link', 'iconfile' => 'EXT:ep_products/Resources/Public/Icons/tx_epproducts_domain_model_hotel.gif' ], 'interface' => [ 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, detail_page, keywords, address, longitude, latitude, headline, teaser, description, features, room_types, additional_information, teaser_images, header_images, images, reseller_images, code, type, category, country, region, city, facts, - teamer, products, header_title,header_subtitle, earlybird, low_contingent, show_as_teaser', + teamer, products, header_title,header_subtitle, earlybird, low_contingent, show_as_teaser, external_link', ], 'types' => [ '1' => [ @@ -58,7 +58,7 @@ return [ ], ], 'palettes' => [ - 'top' => ['showitem' => 'hidden,earlybird,low_contingent,show_as_teaser,--linebreak--,groupsch_id,detail_page'], + 'top' => ['showitem' => 'hidden,earlybird,low_contingent,show_as_teaser,--linebreak--,groupsch_id,detail_page,--linebreak--,external_link'], 'geolocation' => ['showitem' => 'address, longitude, latitude'], 'destinations' => ['showitem' => 'country,region,city'], 'name' => ['showitem' => 'name,code,--linebreak--,header_title,header_subtitle'], @@ -412,6 +412,29 @@ return [ 'eval' => 'trim,int' ], ], + 'external_link' => [ + 'exclude' => 0, + 'label' => 'Externer Link (Google MyBusiness)', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'wizards' => [ + 'link' => [ + 'type' => 'popup', + 'title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_link_formlabel', + 'icon' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_link.gif', + 'module' => [ + 'name' => 'wizard_link', + 'urlParameters' => [ + 'mode' => 'wizard' + ] + ], + 'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1' + ] + ], + ], + ], 'type' => [ 'exclude' => 0, 'label' => 'LLL:EXT:ep_products/Resources/Private/Language/locallang.xlf:tx_epproducts_domain_model_hotel.type', diff --git a/web/typo3conf/ext/ep_products/ext_tables.sql b/web/typo3conf/ext/ep_products/ext_tables.sql index 4d2e46a2..cd7c4290 100644 --- a/web/typo3conf/ext/ep_products/ext_tables.sql +++ b/web/typo3conf/ext/ep_products/ext_tables.sql @@ -208,6 +208,7 @@ CREATE TABLE tx_epproducts_domain_model_hotel ( reseller_images int(11) unsigned NOT NULL default '0', code varchar(255) DEFAULT '' NOT NULL, groupsch_id varchar(8) DEFAULT '' NOT NULL, + external_link varchar(255) DEFAULT '' NOT NULL, type varchar(255) DEFAULT '' NOT NULL, category int(11) DEFAULT '0' NOT NULL, country int(11) unsigned DEFAULT '0', diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/Gmap.vue b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/Gmap.vue index ae0ac748..7633e0af 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/Gmap.vue +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/Gmap.vue @@ -21,6 +21,10 @@ markers: { type: Array, default: null + }, + externalLink: { + type: String, + default: null } }, data () { @@ -37,6 +41,11 @@ if (this.lat && this.lng) { const position = L.latLng(this.lat, this.lng); const marker = L.marker(position); + if (this.externalLink) { + marker.on('click', () => { + window.open(this.externalLink, '_blank'); + }); + } marker.addTo(this.map); this.map.setView(position); } else if (this.markers) { @@ -44,12 +53,16 @@ for (let item of this.markers) { const position = L.latLng(item.lat, item.lng); const marker = L.marker(position); + if (item.externalLink) { + marker.on('click', () => { + window.open(item.externalLink, '_blank'); + }); + } else { + const popupContent = '
'; + marker.bindPopup(popupContent); + } marker.addTo(this.map); - - const popupContent = ''; - marker.bindPopup(popupContent); - bounds.extend(position); } this.map.fitBounds(bounds); diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html index 4a715d52..f51b782b 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html @@ -92,9 +92,8 @@