Add field 'season' to product

This commit is contained in:
Björn Fromme
2020-06-02 12:48:18 +02:00
parent 6134048c91
commit 2bfb3518e0
8 changed files with 67 additions and 15 deletions
@@ -100,6 +100,11 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements
*/ */
protected $code = ''; protected $code = '';
/**
* @var string
*/
protected $season = 'w';
/** /**
* @var string * @var string
*/ */
@@ -500,6 +505,22 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements
$this->code = $code; $this->code = $code;
} }
/**
* @return string
*/
public function getSeason()
{
return $this->season;
}
/**
* @param string $season
*/
public function setSeason($season)
{
$this->season = $season;
}
/** /**
* @return string * @return string
*/ */
@@ -151,7 +151,7 @@ class ProductRepository extends AbstractRepository
'region_feature as regionFeature', 'region_feature as regionFeature',
'country_name as countryName', 'country_code as countryCode', 'country_name as countryName', 'country_code as countryCode',
'date_start as dateStart', 'date_end as dateEnd', 'uid as dateUid', 'min_price as minPrice', 'date_start as dateStart', 'date_end as dateEnd', 'uid as dateUid', 'min_price as minPrice',
'pseudo_price as pseudoPrice', 'nights as nights', 'available as available', 'pseudo_price as pseudoPrice', 'nights as nights', 'available as available', 'season as season',
'skipass_included as skipassIncluded', 'bus_included as busIncluded', 'skipass_included as skipassIncluded', 'bus_included as busIncluded',
'earlybird', 'new', 'daytrip', 'hide_booking_button as hideBookingButton', 'earlybird', 'new', 'daytrip', 'hide_booking_button as hideBookingButton',
'low_contingent as lowContingent', 'concept_code as conceptCode', 'concept_name as conceptName', 'low_contingent as lowContingent', 'concept_code as conceptCode', 'concept_name as conceptName',
@@ -214,7 +214,7 @@ class ProductRepository extends AbstractRepository
->select( ->select(
'date.uid as dateUid', 'date.date_start as dateStart', 'date.date_end as dateEnd', 'date.bus_pro_id as dateBusProId', 'date.uid as dateUid', 'date.date_start as dateStart', 'date.date_end as dateEnd', 'date.bus_pro_id as dateBusProId',
'date.hotel as hotelUid', 'date.hotel_bus_pro_id as hotelBusProId', 'date.bus_included as dateBusIncluded', 'date.hotel as hotelUid', 'date.hotel_bus_pro_id as hotelBusProId', 'date.bus_included as dateBusIncluded',
'date.skipass_included as dateSkipassIncluded', 'date.skipass_included as dateSkipassIncluded', 'date.season as season',
'room.uid as roomUid', 'room.bus_pro_id as roomBusProId', 'room.name as roomName', 'room.uid as roomUid', 'room.bus_pro_id as roomBusProId', 'room.name as roomName',
'room.price as roomPrice', 'date.discount as roomDiscount', 'date.bus_price as busPrice', 'room.price as roomPrice', 'date.discount as roomDiscount', 'date.bus_price as busPrice',
'room.services as roomOptionalServices', 'room.nights as roomNights', 'room.available as roomAvailable' 'room.services as roomOptionalServices', 'room.nights as roomNights', 'room.available as roomAvailable'
@@ -259,11 +259,12 @@ class ProductRepository extends AbstractRepository
$query = $qb $query = $qb
->select( ->select(
'date.uid as dateUid', 'date.date_start as dateStart', 'date.date_end as dateEnd', 'date.uid as dateUid', 'date.date_start as dateStart', 'date.date_end as dateEnd',
'date.min_price as dateMinPrice', 'date.pseudo_price as datePseudoPrice', 'date.discount as dateDiscount', 'date.season as season', 'date.min_price as dateMinPrice', 'date.pseudo_price as datePseudoPrice',
'date.bus_price as busPrice', 'date.nights as dateNights', 'date.bus_included as dateBusIncluded', 'date.discount as dateDiscount', 'date.bus_price as busPrice', 'date.nights as dateNights',
'date.services_included as dateServicesIncluded', 'date.services_general as dateServicesGeneral', 'date.bus_included as dateBusIncluded', 'date.services_included as dateServicesIncluded',
'date.skipass_included as dateSkipassIncluded', 'date.bus_pro_id as dateBusProId', 'date.services_general as dateServicesGeneral', 'date.skipass_included as dateSkipassIncluded',
'date.hotel_bus_pro_id as hotelBusProId', 'date.available as available' 'date.bus_pro_id as dateBusProId', 'date.hotel_bus_pro_id as hotelBusProId',
'date.available as available'
) )
->from('tx_epproducts_domain_model_date', 'date') ->from('tx_epproducts_domain_model_date', 'date')
->innerJoin('date', 'tx_epproducts_domain_model_room', 'room', 'room.date = date.uid') ->innerJoin('date', 'tx_epproducts_domain_model_room', 'room', 'room.date = date.uid')
@@ -231,7 +231,7 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
SELECT p.uid uid, p.daytrip daytrip, p.hide_booking_button, p.important important, p.name product_name, SELECT p.uid uid, p.daytrip daytrip, p.hide_booking_button, p.important important, p.name product_name,
p.searchable product_searchable, p.detail_page product_detail_page, p.keywords product_keywords, p.searchable product_searchable, p.detail_page product_detail_page, p.keywords product_keywords,
p.teaser product_teaser, p.feature product_feature, p.subline product_subline, p.country country, p.teaser product_teaser, p.feature product_feature, p.subline product_subline, p.country country,
p.region region, p.city city, p.path_segment slug, p.region region, p.city city, p.path_segment slug, p.season season,
cnt.name country_name, cnt.code country_code, cnt.keywords country_keywords, r.name region_name, cnt.name country_name, cnt.code country_code, cnt.keywords country_keywords, r.name region_name,
r.keywords region_keywords, r.feature region_feature, c.name city_name, c.keywords city_keywords, r.keywords region_keywords, r.feature region_feature, c.name city_name, c.keywords city_keywords,
p.concept concept, con.name concept_name, con.code concept_code, con.sorting concept_sorting p.concept concept, con.name concept_name, con.code concept_code, con.sorting concept_sorting
@@ -355,6 +355,7 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
'concept_name' => $product['concept_name'], 'concept_name' => $product['concept_name'],
'concept_code' => $product['concept_code'], 'concept_code' => $product['concept_code'],
'concept_sorting' => $product['concept_sorting'], 'concept_sorting' => $product['concept_sorting'],
'season' => empty($product['season']) ? 'w' : $product['season'],
'date_start' => $dateStart->format('Y-m-d'), 'date_start' => $dateStart->format('Y-m-d'),
'date_end' => $dateEnd->format('Y-m-d'), 'date_end' => $dateEnd->format('Y-m-d'),
'nights' => $nights, 'nights' => $nights,
@@ -306,6 +306,7 @@ class DateService implements SingletonInterface
$priceTable[] = [ $priceTable[] = [
'dateStart' => $dateStart->format('d.m.Y'), 'dateStart' => $dateStart->format('d.m.Y'),
'dateEnd' => $dateEnd->format('d.m.Y'), 'dateEnd' => $dateEnd->format('d.m.Y'),
'season' => $row['season'],
'dateBusIncluded' => (bool) $row['dateBusIncluded'], 'dateBusIncluded' => (bool) $row['dateBusIncluded'],
'dateSkipassIncluded' => (bool) $row['dateSkipassIncluded'], 'dateSkipassIncluded' => (bool) $row['dateSkipassIncluded'],
'roomUid' => $row['roomUid'], 'roomUid' => $row['roomUid'],
@@ -376,6 +377,7 @@ class DateService implements SingletonInterface
'dateSkipassIncluded' => (bool) $row['dateSkipassIncluded'], 'dateSkipassIncluded' => (bool) $row['dateSkipassIncluded'],
'dateServicesIncluded' => unserialize($row['dateServicesIncluded'], ['allowed_classes' => false]), 'dateServicesIncluded' => unserialize($row['dateServicesIncluded'], ['allowed_classes' => false]),
'dateServicesGeneral' => unserialize($row['dateServicesGeneral'], ['allowed_classes' => false]), 'dateServicesGeneral' => unserialize($row['dateServicesGeneral'], ['allowed_classes' => false]),
'season' => $row['season'],
'available' => $row['available'], 'available' => $row['available'],
'bookingUrl' => $bookingUrl, 'bookingUrl' => $bookingUrl,
'isHideBookingButton' => $isHideBookingButton, 'isHideBookingButton' => $isHideBookingButton,
@@ -199,6 +199,7 @@ class ProductDataService implements SingletonInterface
'hideBookingButton' => $teaserData['hideBookingButton'], 'hideBookingButton' => $teaserData['hideBookingButton'],
'lowContingent' => $teaserData['lowContingent'], 'lowContingent' => $teaserData['lowContingent'],
'servicesIncluded' => unserialize($teaserData['servicesIncluded']), 'servicesIncluded' => unserialize($teaserData['servicesIncluded']),
'season' => $teaserData['season'],
'product' => [ 'product' => [
'uid' => $teaserData['productUid'], 'uid' => $teaserData['productUid'],
'name' => $teaserData['productName'], 'name' => $teaserData['productName'],
@@ -158,6 +158,18 @@ return [
'default' => 0 'default' => 0
] ]
], ],
'season' => [
'exclude' => 0,
'label' => 'Saison',
'config' => [
'type' => 'select',
'items' => [
[ 'Winter', 'w' ],
[ 'Sommer', 's' ],
],
'default' => 'w',
],
],
'date_start' => [ 'date_start' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Datum von', 'label' => 'Datum von',
@@ -24,12 +24,12 @@ return [
], ],
'interface' => [ 'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, searchable, bookable, 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, searchable, bookable,
detail_page, name, name_internal, subline, keywords, headline, code, feature, bus_pro_id, teaser, teaser_long, season, detail_page, name, name_internal, subline, keywords, headline, code, feature, bus_pro_id, teaser,
concept_description, board_description, additional_services, programme_description, ski_pass_description, teaser_long, concept_description, board_description, additional_services, programme_description,
rating_average, rating_votes_count, teaser_images, header_images, images, concept, country, region, city, ski_pass_description, rating_average, rating_votes_count, teaser_images, header_images, images, concept,
journey, facts, officetip, hotels, calendar_hotel, faqs,header_title,header_subtitle, alt_product, alt_label, country, region, city, journey, facts, officetip, hotels, calendar_hotel, faqs,header_title,header_subtitle,
video, banner, additional_regions, badge, daytrip, testimonials, external_link, path_segment, alt_product, alt_label, video, banner, additional_regions, badge, daytrip, testimonials, external_link,
hide_booking_button,non_bookable_dates', path_segment, hide_booking_button,non_bookable_dates',
], ],
'types' => [ 'types' => [
'1' => [ '1' => [
@@ -47,7 +47,7 @@ return [
'palettes' => [ 'palettes' => [
'destinations' => ['showitem' => 'country,region,city'], 'destinations' => ['showitem' => 'country,region,city'],
'top' => ['showitem' => 'searchable, bookable, hide_booking_button, daytrip, important, skipass_included, 'top' => ['showitem' => 'searchable, bookable, hide_booking_button, daytrip, important, skipass_included,
detail_page, external_link, path_segment'], season, detail_page, external_link, path_segment'],
'name' => ['showitem' => 'name,code'], 'name' => ['showitem' => 'name,code'],
'alternative' => ['showitem' => 'alt_product, alt_label'], 'alternative' => ['showitem' => 'alt_product, alt_label'],
'header' => ['showitem' => 'headline,subline,--linebreak--,header_title,header_subtitle'], 'header' => ['showitem' => 'headline,subline,--linebreak--,header_title,header_subtitle'],
@@ -186,6 +186,18 @@ return [
'default' => true, 'default' => true,
], ],
], ],
'season' => [
'exclude' => 0,
'label' => 'Saison',
'config' => [
'type' => 'select',
'items' => [
[ 'Winter', 'w' ],
[ 'Sommer', 's' ],
],
'default' => 'w',
],
],
'detail_page' => [ 'detail_page' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Detailseite', 'label' => 'Detailseite',
@@ -10,6 +10,7 @@ CREATE TABLE tx_epproducts_domain_model_product
searchable tinyint(4) unsigned DEFAULT '1' NOT NULL, searchable tinyint(4) unsigned DEFAULT '1' NOT NULL,
bookable tinyint(4) unsigned DEFAULT '1' NOT NULL, bookable tinyint(4) unsigned DEFAULT '1' NOT NULL,
season varchar(64) DEFAULT '' NOT NULL,
hide_booking_button tinyint(4) unsigned DEFAULT '0' NOT NULL, hide_booking_button tinyint(4) unsigned DEFAULT '0' NOT NULL,
daytrip tinyint(4) unsigned DEFAULT '0' NOT NULL, daytrip tinyint(4) unsigned DEFAULT '0' NOT NULL,
important tinyint(4) unsigned DEFAULT '0' NOT NULL, important tinyint(4) unsigned DEFAULT '0' NOT NULL,
@@ -101,6 +102,7 @@ CREATE TABLE tx_epproducts_domain_model_date
bus_pro_id int(11) DEFAULT '0' NOT NULL, bus_pro_id int(11) DEFAULT '0' NOT NULL,
hotel_bus_pro_id int(11) DEFAULT '0' NOT NULL, hotel_bus_pro_id int(11) DEFAULT '0' NOT NULL,
code varchar(255) DEFAULT '' NOT NULL, code varchar(255) DEFAULT '' NOT NULL,
season varchar(64) DEFAULT '' NOT NULL,
date_start date DEFAULT '0000-00-00', date_start date DEFAULT '0000-00-00',
date_end date DEFAULT '0000-00-00', date_end date DEFAULT '0000-00-00',
nights int(11) DEFAULT '0' NOT NULL, nights int(11) DEFAULT '0' NOT NULL,