diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Date.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Date.php index f112a886..f3198055 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Date.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Date.php @@ -169,6 +169,11 @@ class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity */ protected $new = false; + /** + * @var string + */ + protected $guide = ''; + public function getProduct() { return $this->product; @@ -489,8 +494,16 @@ class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity public function setCoursesIncluded($coursesIncluded) { $this->coursesIncluded = $coursesIncluded; + } - return $this; + public function getGuide() + { + return unserialize($this->guide); + } + + public function setGuide($guide): Date + { + $this->guide = serialize($guide); } /** diff --git a/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php b/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php index 35581246..d406a6e1 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php @@ -491,6 +491,9 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface }); $date['pickups'] = serialize($pickups); + $guide = $this->parseGuide($xmlDate); + $date['guide'] = serialize($guide); + return $date; } @@ -544,6 +547,27 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface return true; } + protected function parseGuide(\SimpleXMLElement $xmlDate) + { + $transportationServicesBus = $xmlDate->xpath('lei_befoerderung/leistung[@unterart="BUS"]'); + + foreach ($transportationServicesBus as $service) { + if ('RUECK' === (string) $service->richtung) { + continue; + } + if (false === isset($service->zustiegsplanung->reiseleiter)) { + continue; + } + + return [ + 'name' => (string) $service->zustiegsplanung->reiseleiter->name, + 'phone' => (string) $service->zustiegsplanung->reiseleiter->telefon, + ]; + } + + return []; + } + /** * @param \SimpleXMLElement $xmlHotel * @param int $hotelUid diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_date.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_date.php index dc7d837f..761d008f 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_date.php +++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_date.php @@ -25,7 +25,7 @@ return [ 'types' => [ '1' => ['showitem' => 'hidden, bus_pro_id, hotel_bus_pro_id, code, daytrip, date_start, date_end, nights, board, board_code, board_bus_pro_id, bus_included, bus_available, skipass_included, services_included, - services_general, courses_included, pickups, discount, min_price, pseudo_price, available, new'], + services_general, courses_included, guide, pickups, discount, min_price, pseudo_price, available, new'], ], 'palettes' => [ '1' => ['showitem' => ''], @@ -306,6 +306,16 @@ return [ 'eval' => 'trim' ] ], + 'guide' => [ + 'exclude' => false, + 'label' => 'Reiseleiter', + 'config' => [ + 'type' => 'text', + 'cols' => 40, + 'rows' => 15, + 'eval' => 'trim' + ] + ], 'pickups' => [ 'exclude' => false, 'label' => 'Zustiege', diff --git a/public/typo3conf/ext/ep_products/ext_tables.sql b/public/typo3conf/ext/ep_products/ext_tables.sql index 6ab240b8..55cbcd99 100644 --- a/public/typo3conf/ext/ep_products/ext_tables.sql +++ b/public/typo3conf/ext/ep_products/ext_tables.sql @@ -121,6 +121,7 @@ CREATE TABLE tx_epproducts_domain_model_date services_general text NOT NULL, courses_included text NOT NULL, pickups text NOT NULL, + guide text NOT NULL, discount int(11) DEFAULT '0' NOT NULL, min_price int(11) DEFAULT '0' NOT NULL, pseudo_price int(11) DEFAULT '0' NOT NULL, diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Travelinfo/Index.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Travelinfo/Index.html index 3067f835..65c301f1 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Travelinfo/Index.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Travelinfo/Index.html @@ -154,6 +154,13 @@
+ +

+ E&P Reiseleitung +
+ {date.guide.name} {date.guide.phone} +

+
{travelinfo.importantPhoneNumbers -> f:format.html()}