diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php b/web/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php index 970aa056..7d5ec7a4 100644 --- a/web/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php @@ -45,6 +45,11 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements */ protected $daytrip = false; + /** + * @var bool + */ + protected $important; + /** * @var bool */ @@ -316,6 +321,22 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements $this->daytrip = (bool) $daytrip; } + /** + * @return bool + */ + public function isImportant() + { + return $this->important; + } + + /** + * @param bool $important + */ + public function setImportant($important) + { + $this->important = $important; + } + /** * @return bool */ diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php b/web/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php index 253bce69..722604e7 100644 --- a/web/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php @@ -110,6 +110,7 @@ class ProductRepository extends AbstractRepository ->addGroupBy('date.date_start') ->addGroupBy('date.nights') ->orderBy('date.concept_sorting') + ->addOrderBy('important', 'DESC') ->addOrderBy('date.product_name') ->addOrderBy('date.min_price') ->addOrderBy('date.date_start') @@ -160,7 +161,8 @@ class ProductRepository extends AbstractRepository ->addGroupBy('date.hotel') ->addGroupBy('date.date_start') ->addGroupBy('date.nights') - ->orderBy('concept_sorting') + ->orderBy('important', 'DESC') + ->addOrderBy('concept_sorting') ->addOrderBy('date_start') ; diff --git a/web/typo3conf/ext/ep_products/Classes/Service/DateImportService.php b/web/typo3conf/ext/ep_products/Classes/Service/DateImportService.php index 61569e75..165db3d8 100644 --- a/web/typo3conf/ext/ep_products/Classes/Service/DateImportService.php +++ b/web/typo3conf/ext/ep_products/Classes/Service/DateImportService.php @@ -228,9 +228,10 @@ class DateImportService implements SingletonInterface $dateCount = 0; $sql = ' - SELECT p.uid uid, p.daytrip daytrip, p.name product_name, p.bus_pro_id bus_pro_id, 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.region region, p.city city, + SELECT p.uid uid, p.daytrip daytrip, p.important important, p.name product_name, p.bus_pro_id bus_pro_id, + 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.region region, p.city city, 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, p.concept concept, con.name concept_name, con.code concept_code, con.sorting concept_sorting @@ -360,6 +361,7 @@ class DateImportService implements SingletonInterface 'bus_pro_id' => $busProId, 'code' => $code, 'daytrip' => $product['daytrip'], + 'important' => $product['important'], ]; $skiPass = $this->parseSelectionGroup($xmlDate, 'Leistungen Skipass'); diff --git a/web/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_product.php b/web/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_product.php index 6e223641..ad1b6422 100644 --- a/web/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_product.php +++ b/web/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_product.php @@ -44,7 +44,7 @@ return [ ], 'palettes' => [ 'destinations' => ['showitem' => 'country,region,city'], - 'top' => ['showitem' => 'searchable, bookable, daytrip, skipass_included, detail_page'], + 'top' => ['showitem' => 'searchable, bookable, daytrip, important, skipass_included, detail_page'], 'name' => ['showitem' => 'name,code'], 'alternative' => ['showitem' => 'alt_product, alt_label'], 'header' => ['showitem' => 'headline,subline,--linebreak--,header_title,header_subtitle'], @@ -161,6 +161,13 @@ return [ 'type' => 'check', ], ], + 'important' => [ + 'exclude' => 0, + 'label' => 'in Teasergruppen immer vorne', + 'config' => [ + 'type' => 'check', + ], + ], 'skipass_included' => [ 'exclude' => 0, 'label' => 'Skipass inklusive', diff --git a/web/typo3conf/ext/ep_products/ext_tables.sql b/web/typo3conf/ext/ep_products/ext_tables.sql index 4682590f..7265f41b 100644 --- a/web/typo3conf/ext/ep_products/ext_tables.sql +++ b/web/typo3conf/ext/ep_products/ext_tables.sql @@ -10,6 +10,7 @@ CREATE TABLE tx_epproducts_domain_model_product ( searchable tinyint(4) unsigned DEFAULT '1' NOT NULL, bookable tinyint(4) unsigned DEFAULT '1' NOT NULL, daytrip tinyint(4) unsigned DEFAULT '0' NOT NULL, + important tinyint(4) unsigned DEFAULT '0' NOT NULL, skipass_included tinyint(4) unsigned DEFAULT '1' NOT NULL, name varchar(255) DEFAULT '' NOT NULL, name_internal varchar(255) DEFAULT '' NOT NULL, @@ -114,6 +115,7 @@ CREATE TABLE tx_epproducts_domain_model_date ( available int(11) DEFAULT '0' NOT NULL, product int(11) unsigned DEFAULT '0', daytrip tinyint(1) unsigned DEFAULT '0' NOT NULL, + important tinyint(1) unsigned DEFAULT '0' NOT NULL, product_name varchar(255) DEFAULT '' NOT NULL, product_subline varchar(255) DEFAULT '' NOT NULL, product_fact varchar(255) DEFAULT '' NOT NULL,