From 3181fc95a9d9634874a0fb4a78d7e7035360d897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Tue, 26 Jun 2018 17:12:21 +0200 Subject: [PATCH] Implement XML export functionality for resellers --- composer.json | 4 +- composer.lock | 404 +++++++++++++++++- .../Classes/Controller/ResellerController.php | 112 +++++ .../Classes/Domain/Model/Product.php | 25 ++ .../Classes/Domain/Model/Reseller.php | 104 +++++ .../Domain/Repository/ProductRepository.php | 37 ++ .../Classes/Domain/Serialization/City.php | 79 ++++ .../Classes/Domain/Serialization/Date.php | 111 +++++ .../Classes/Domain/Serialization/Hotel.php | 68 +++ .../Classes/Domain/Serialization/Product.php | 111 +++++ .../Classes/Domain/Serialization/Region.php | 104 +++++ .../Classes/Domain/Serialization/Room.php | 81 ++++ .../Classes/Domain/Serialization/Service.php | 56 +++ .../Classes/Service/ExcelService.php | 41 ++ .../Classes/Service/ResellerService.php | 112 +++++ .../Classes/Utility/SerializationUtility.php | 69 +++ .../FlexForms/flexform_city_detail.xml | 2 +- .../FlexForms/flexform_concept_detail.xml | 2 +- .../FlexForms/flexform_country.xml | 2 +- .../Configuration/FlexForms/flexform_faq.xml | 2 +- .../FlexForms/flexform_hotel_detail.xml | 2 +- .../FlexForms/flexform_hotel_detail_event.xml | 4 +- .../FlexForms/flexform_pricetable.xml | 2 +- .../FlexForms/flexform_product_detail.xml | 4 +- .../FlexForms/flexform_product_pricetable.xml | 4 +- .../FlexForms/flexform_region_detail.xml | 2 +- .../tx_epproducts_domain_model_product.php | 28 +- .../tx_epproducts_domain_model_reseller.php | 149 +++++++ .../Resources/Private/Language/locallang.xlf | 12 + .../tx_epproducts_domain_model_reseller.gif | Bin 0 -> 230 bytes .../ext/ep_products/ext_localconf.php | 11 + web/typo3conf/ext/ep_products/ext_tables.php | 6 + web/typo3conf/ext/ep_products/ext_tables.sql | 57 ++- .../Private/Templates/Reseller/List.html | 24 ++ web/typo3conf/realurl_conf.php | 27 ++ 35 files changed, 1829 insertions(+), 29 deletions(-) create mode 100644 web/typo3conf/ext/ep_products/Classes/Controller/ResellerController.php create mode 100644 web/typo3conf/ext/ep_products/Classes/Domain/Model/Reseller.php create mode 100644 web/typo3conf/ext/ep_products/Classes/Domain/Serialization/City.php create mode 100644 web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Date.php create mode 100644 web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Hotel.php create mode 100644 web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Product.php create mode 100644 web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Region.php create mode 100644 web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Room.php create mode 100644 web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Service.php create mode 100644 web/typo3conf/ext/ep_products/Classes/Service/ExcelService.php create mode 100644 web/typo3conf/ext/ep_products/Classes/Service/ResellerService.php create mode 100644 web/typo3conf/ext/ep_products/Classes/Utility/SerializationUtility.php create mode 100644 web/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_reseller.php create mode 100644 web/typo3conf/ext/ep_products/Resources/Public/Icons/tx_epproducts_domain_model_reseller.gif create mode 100644 web/typo3conf/ext/ep_theme/Resources/Private/Templates/Reseller/List.html diff --git a/composer.json b/composer.json index 29eea2d5..b4042e08 100644 --- a/composer.json +++ b/composer.json @@ -63,7 +63,9 @@ "typo3-ter/loginlimit": "^1.0", "doctrine/dbal": "^2.5", "yohang/calendr": "^2.1", - "wyrihaximus/html-compress": "^1.4" + "wyrihaximus/html-compress": "^1.4", + "symfony/serializer": "3.3.*", + "symfony/property-access": "^3.4" }, "scripts": { "typo3-cms-scripts": [ diff --git a/composer.lock b/composer.lock index 4ac99bbb..b555f0a8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0268a42800e1640546fc8e83592c9887", + "content-hash": "218f290216c085ca0d43c4cb1fde6c13", "packages": [ { "name": "cogpowered/finediff", @@ -1266,6 +1266,55 @@ ], "time": "2013-09-13T10:26:14+00:00" }, + { + "name": "paragonie/random_compat", + "version": "v2.0.15", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "10bcb46e8f3d365170f6de9d05245aa066b81f09" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/10bcb46e8f3d365170f6de9d05245aa066b81f09", + "reference": "10bcb46e8f3d365170f6de9d05245aa066b81f09", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "time": "2018-06-08T15:26:40+00:00" + }, { "name": "patchwork/jsqueeze", "version": "v2.0.5", @@ -1809,6 +1858,64 @@ "homepage": "https://symfony.com", "time": "2018-05-15T21:17:45+00:00" }, + { + "name": "symfony/inflector", + "version": "v3.4.11", + "source": { + "type": "git", + "url": "https://github.com/symfony/inflector.git", + "reference": "bc27e8f793a571313132923b5ad10fdf2843e26c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/inflector/zipball/bc27e8f793a571313132923b5ad10fdf2843e26c", + "reference": "bc27e8f793a571313132923b5ad10fdf2843e26c", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Inflector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Inflector Component", + "homepage": "https://symfony.com", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string", + "symfony", + "words" + ], + "time": "2018-05-01T22:53:27+00:00" + }, { "name": "symfony/options-resolver", "version": "v3.4.11", @@ -1863,6 +1970,61 @@ ], "time": "2018-01-11T07:56:07+00:00" }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-04-30T19:57:29+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.8.0", @@ -1922,6 +2084,65 @@ ], "time": "2018-04-26T10:06:28+00:00" }, + { + "name": "symfony/polyfill-php70", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/77454693d8f10dd23bb24955cffd2d82db1007a6", + "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2018-04-26T10:06:28+00:00" + }, { "name": "symfony/process", "version": "v3.4.11", @@ -1971,6 +2192,152 @@ "homepage": "https://symfony.com", "time": "2018-05-16T08:49:21+00:00" }, + { + "name": "symfony/property-access", + "version": "v3.4.11", + "source": { + "type": "git", + "url": "https://github.com/symfony/property-access.git", + "reference": "a6e8c778b220dfd5cd5f5dcb09f87ee232dd608a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/property-access/zipball/a6e8c778b220dfd5cd5f5dcb09f87ee232dd608a", + "reference": "a6e8c778b220dfd5cd5f5dcb09f87ee232dd608a", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/inflector": "~3.1|~4.0", + "symfony/polyfill-php70": "~1.0" + }, + "require-dev": { + "symfony/cache": "~3.1|~4.0" + }, + "suggest": { + "psr/cache-implementation": "To cache access methods." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\PropertyAccess\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony PropertyAccess Component", + "homepage": "https://symfony.com", + "keywords": [ + "access", + "array", + "extraction", + "index", + "injection", + "object", + "property", + "property path", + "reflection" + ], + "time": "2018-01-03T07:37:34+00:00" + }, + { + "name": "symfony/serializer", + "version": "v3.3.17", + "source": { + "type": "git", + "url": "https://github.com/symfony/serializer.git", + "reference": "49a429eba5a2f96c170e8b4b834ce612c257fb32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/serializer/zipball/49a429eba5a2f96c170e8b4b834ce612c257fb32", + "reference": "49a429eba5a2f96c170e8b4b834ce612c257fb32", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "phpdocumentor/type-resolver": "<0.2.1", + "symfony/dependency-injection": "<3.2", + "symfony/property-access": ">=3.0,<3.0.4|>=2.8,<2.8.4", + "symfony/property-info": "<3.1", + "symfony/yaml": "<3.3" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "phpdocumentor/reflection-docblock": "^3.0|^4.0", + "symfony/cache": "~3.1", + "symfony/config": "~2.8|~3.0", + "symfony/dependency-injection": "~3.2", + "symfony/http-foundation": "~2.8|~3.0", + "symfony/property-access": "~2.8|~3.0", + "symfony/property-info": "~3.1", + "symfony/yaml": "~3.3" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "For using the XML mapping loader.", + "symfony/http-foundation": "To use the DataUriNormalizer.", + "symfony/property-access": "For using the ObjectNormalizer.", + "symfony/property-info": "To deserialize relations.", + "symfony/yaml": "For using the default YAML mapping loader." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Serializer\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Serializer Component", + "homepage": "https://symfony.com", + "time": "2018-01-17T08:02:20+00:00" + }, { "name": "tedivm/jshrink", "version": "v1.3.0", @@ -2051,6 +2418,7 @@ } ], "description": "This extension integrates the grid layout concept also to regular content elements - the grid elements.\r\nIt offers a lot of new features like advanced drag & drop or real references, that improve the usability of the page and list module to speed up the daily work with the backend.", + "homepage": "https://extensions.typo3.org/extension/gridelements/", "time": "2017-12-23T18:15:17+00:00" }, { @@ -2084,6 +2452,7 @@ } ], "description": "Compress/minify your HTML output", + "homepage": "https://extensions.typo3.org/extension/html_compress/", "time": "2016-12-26T10:19:02+00:00" }, { @@ -2116,6 +2485,7 @@ } ], "description": "Optimize uploaded/processed images with binaries of your choice", + "homepage": "https://extensions.typo3.org/extension/imageoptimizer/", "time": "2017-03-11T11:37:47+00:00" }, { @@ -2148,6 +2518,7 @@ } ], "description": "Protect backend and/or frontend login against brute-force attacks.", + "homepage": "https://extensions.typo3.org/extension/loginlimit/", "time": "2017-09-23T10:40:00+00:00" }, { @@ -2184,6 +2555,7 @@ } ], "description": "Media management system for TYPO3 CMS.", + "homepage": "https://extensions.typo3.org/extension/media/", "time": "2017-11-02T13:08:04+00:00" }, { @@ -2217,6 +2589,7 @@ } ], "description": "Search Engine Optimization (SEO), Indexed Google-Sitemap (TXT- and XML-Sitemap) for all Extensions (pibase, extbase), Metatags, Canonical-URL, Pagetitle manipulations, Crawler verification, Piwik and Google Analytics support and some more... multi-language- and multi-tree-support", + "homepage": "https://extensions.typo3.org/extension/metaseo/", "time": "2017-06-11T18:32:55+00:00" }, { @@ -2256,6 +2629,7 @@ } ], "description": "Simply manage (permanent 301) redirects in the list view. The extension supports multidomain sites, count the redirect usage and shows the last referer. UPDATE! imports the records from realurl.", + "homepage": "https://extensions.typo3.org/extension/ods_redirects/", "time": "2017-05-22T22:07:45+00:00" }, { @@ -2289,6 +2663,7 @@ } ], "description": "Provides API for Backend modules to get a proper path to the Frontend page (simulateStatic/RealURL/CoolURI-like)", + "homepage": "https://extensions.typo3.org/extension/pagepath/", "time": "2017-02-15T15:40:25+00:00" }, { @@ -2325,6 +2700,7 @@ "username": "plusb" } ], + "homepage": "https://extensions.typo3.org/extension/pb_social/", "time": "2018-02-14T11:05:37+00:00" }, { @@ -2358,6 +2734,7 @@ } ], "description": "Optimization of the final page: reformatting the (x)html output, removal of new lines, and quotes. Move development repository to https://github.com/lochmueller/sourceopt", + "homepage": "https://extensions.typo3.org/extension/sourceopt/", "time": "2017-06-15T17:25:53+00:00" }, { @@ -2390,6 +2767,7 @@ } ], "description": "Generic listing of records with versatile ways of interacting with the data, e.g. advanced filter, inline editing, mass editing, ... Veni, vidi, vici!", + "homepage": "https://extensions.typo3.org/extension/vidi/", "time": "2017-11-02T13:05:47+00:00" }, { @@ -3733,16 +4111,16 @@ }, { "name": "react/promise", - "version": "v2.6.0", + "version": "v2.7.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "5e60e5596a5422287f9d2205f405bef2ae0cef4b" + "reference": "f4edc2581617431aea50430749db55cc3fc031b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/5e60e5596a5422287f9d2205f405bef2ae0cef4b", - "reference": "5e60e5596a5422287f9d2205f405bef2ae0cef4b", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f4edc2581617431aea50430749db55cc3fc031b3", + "reference": "f4edc2581617431aea50430749db55cc3fc031b3", "shasum": "" }, "require": { @@ -3775,26 +4153,26 @@ "promise", "promises" ], - "time": "2018-06-11T11:05:43+00:00" + "time": "2018-06-13T15:59:06+00:00" }, { "name": "react/promise-timer", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise-timer.git", - "reference": "c21781145955892900efba366ec236eb66e3ee35" + "reference": "a11206938ca2394dc7bb368f5da25cd4533fa603" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise-timer/zipball/c21781145955892900efba366ec236eb66e3ee35", - "reference": "c21781145955892900efba366ec236eb66e3ee35", + "url": "https://api.github.com/repos/reactphp/promise-timer/zipball/a11206938ca2394dc7bb368f5da25cd4533fa603", + "reference": "a11206938ca2394dc7bb368f5da25cd4533fa603", "shasum": "" }, "require": { "php": ">=5.3", "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", - "react/promise": "^2.6.0 || ^1.2.1" + "react/promise": "^2.7.0 || ^1.2.1" }, "require-dev": { "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" @@ -3819,7 +4197,7 @@ } ], "description": "A trivial implementation of timeouts for Promises, built on top of ReactPHP.", - "homepage": "https://github.com/react/promise-timer", + "homepage": "https://github.com/reactphp/promise-timer", "keywords": [ "async", "event-loop", @@ -3828,7 +4206,7 @@ "timeout", "timer" ], - "time": "2018-06-11T14:11:05+00:00" + "time": "2018-06-13T16:45:37+00:00" }, { "name": "react/react", diff --git a/web/typo3conf/ext/ep_products/Classes/Controller/ResellerController.php b/web/typo3conf/ext/ep_products/Classes/Controller/ResellerController.php new file mode 100644 index 00000000..6909bfb5 --- /dev/null +++ b/web/typo3conf/ext/ep_products/Classes/Controller/ResellerController.php @@ -0,0 +1,112 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +use EP\EpProducts\Domain\Model\Product; +use EP\EpProducts\Domain\Model\Reseller; +use EP\EpProducts\Service\ExcelService; +use EP\EpProducts\Service\ResellerService; +use Symfony\Component\Serializer\Encoder\XmlEncoder; +use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; +use Symfony\Component\Serializer\Serializer; +use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; + +class ResellerController extends ActionController +{ + + /** + * @var ResellerService + */ + protected $resellerService; + + /** + * @var ExcelService + */ + protected $excelService; + + /** + * @param ResellerService $resellerService + * @param ExcelService $excelService + */ + public function __construct(ResellerService $resellerService, ExcelService $excelService) + { + parent::__construct(); + $this->resellerService = $resellerService; + $this->excelService = $excelService; + } + + /** + * @param Reseller $reseller + */ + public function listAction(Reseller $reseller) + { + $products = $reseller->getProducts(); + + $this->view->assign('reseller', $reseller); + $this->view->assign('products', $products); + } + + /** + * @param Reseller $reseller + * @param Product $product + * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException + * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException + */ + public function excelAction(Reseller $reseller, Product $product) + { + if (!$reseller->getProducts()->contains($product)) { + $this->redirect('list', null, null, [ 'reseller' => $reseller ]); + } + + $data = $this->resellerService->preprocessSingle($product); + var_dump($data);exit; + //TODO: Implement Excel sheet generation + } + + /** + * @param Reseller $reseller + * @return mixed + */ + public function xmlAction(Reseller $reseller) + { + $products = $reseller->getProducts(); + + $data = $this->resellerService->preprocessAll($products); + + $encoders = [new XmlEncoder('products')]; + $normalizers = [new ObjectNormalizer()]; + + $serializer = new Serializer($normalizers, $encoders); + + header('Content-type: text/xml;charset=utf-8'); + + echo $serializer->serialize($data, 'xml', [ 'xml_encoding' => 'utf-8', 'xml_format_output' => true ]); + exit; + } + +} 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 1509dad1..3cdd47d2 100644 --- a/web/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php @@ -140,6 +140,11 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements */ protected $images; + /** + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> + */ + protected $resellerImages; + /** * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> */ @@ -585,6 +590,26 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements $this->images = $images; } + /** + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference $resellerImages> + */ + public function getResellerImages() + { + if (!$this->resellerImages) { + return $this->images; + } + + return $this->resellerImages; + } + + /** + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $images + */ + public function setResellerImages(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $images) + { + $this->resellerImages = $images; + } + /** * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage */ diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Model/Reseller.php b/web/typo3conf/ext/ep_products/Classes/Domain/Model/Reseller.php new file mode 100644 index 00000000..f163f11a --- /dev/null +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Model/Reseller.php @@ -0,0 +1,104 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +class Reseller extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +{ + + /** + * @var string + */ + protected $name; + + /** + * @var string + */ + protected $code; + + /** + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Product> + */ + protected $products; + + public function __construct() + { + $this->products = new ObjectStorage(); + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * @return string + */ + public function getCode() + { + return $this->code; + } + + /** + * @param string $code + */ + public function setCode($code) + { + $this->code = $code; + } + + /** + * @return ObjectStorage + */ + public function getProducts() + { + return $this->products; + } + + /** + * @param ObjectStorage $products + */ + public function setProducts($products) + { + $this->products = $products; + } + +} + 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 90735581..d79c4fd6 100644 --- a/web/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php @@ -241,6 +241,43 @@ class ProductRepository extends AbstractRepository return $query->execute()->fetchAll(); } + /** + * @param Product $product + * @param Hotel $hotel + * + * @return array + */ + public function getDatesForExport(Product $product, Hotel $hotel) + { + $qb = DbUtility::getDbConnection()->createQueryBuilder(); + + $query = $qb + ->select( + 'date.date_start dateStart', 'date.date_end dateEnd', + 'date.min_price dateMinPrice', 'date.discount dateDiscount', 'date.bus_price busPrice', + 'date.nights dateNights', 'date.bus_included dateBusIncluded', 'date.services_included dateServicesIncluded', + 'date.services_general dateServicesGeneral', 'date.skipass_included dateSkipassIncluded', + 'date.bus_pro_id dateBusProId', 'date.hotel_bus_pro_id hotelBusProId', + 'room.uid as roomUid', 'room.bus_pro_id roomBusProId', 'room.name roomName', + 'room.price roomPrice', 'date.discount roomDiscount', 'date.bus_price busPrice', + 'room.services roomOptionalServices', 'room.nights roomNights', 'room.available roomAvailable' + ) + ->from('tx_epproducts_domain_model_date', 'date') + ->innerJoin('date', 'tx_epproducts_domain_model_room', 'room', 'room.date = date.uid') + ->orderBy('date.date_start', 'ASC') + ->addOrderBy('date.min_price', 'ASC') + ->where('date.date_start >= NOW()') + ->andWhere('date.product = :product') + ->andWhere('date.hotel = :hotel') + ->setParameters([ + 'product' => $product->getUid(), + 'hotel' => $hotel->getUid(), + ]) + ; + + return $query->execute()->fetchAll(); + } + /** * @param Product $product * diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/City.php b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/City.php new file mode 100644 index 00000000..36569d1b --- /dev/null +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/City.php @@ -0,0 +1,79 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +use EP\EpProducts\Utility\SerializationUtility; + +class City +{ + + /** + * @var string + */ + public $name; + + /** + * @var string + */ + public $description; + + /** + * @var string + */ + public $party; + + /** + * @var string + */ + public $leisure; + + /** + * @var array + */ + public $facts = []; + + /** + * @param \EP\EpProducts\Domain\Model\City $entity + * @return City + */ + public static function fromEntity(\EP\EpProducts\Domain\Model\City $entity) + { + $city = new self; + + $city->name = $entity->getName(); + $city->description = SerializationUtility::sanitizeText($entity->getDescription()); + $city->party = SerializationUtility::sanitizeText($entity->getParty()); + $city->leisure = SerializationUtility::sanitizeText($entity->getLeisure()); + $city->facts['fact'] = array_map(function ($fact) { + return htmlspecialchars($fact->getName()); + }, $entity->getFacts()->toArray()); + + return $city; + } + +} diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Date.php b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Date.php new file mode 100644 index 00000000..e9966a92 --- /dev/null +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Date.php @@ -0,0 +1,111 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +class Date +{ + /** + * @var string + */ + public $from; + + /** + * @var string + */ + public $to; + + /** + * @var string + */ + public $minprice; + + /** + * @var string + */ + public $nights; + + /** + * @var string + */ + public $busincluded; + + /** + * @var string + */ + public $skipassincluded; + + /** + * @var array + */ + public $servicesincluded = []; + + /** + * @var array + */ + public $services = []; + + /** + * @var array + */ + public $rooms = []; + + /** + * @var string + */ + public $available; + + /** + * @var string + */ + public $bookingurl; + + /** + * @param array $array + * @return Date + */ + public static function fromArray(array $array) + { + $date = new self; + + $date->from = $array['dateStart']; + $date->to = $array['dateEnd']; + $date->minprice = $array['dateMinPrice']; + $date->nights = $array['dateNights']; + $date->skipassincluded = $array['dateSkipassIncluded']; + $date->busincluded = $array['dateBusIncluded']; + $date->servicesincluded['service'] = unserialize($array['dateServicesIncluded']); + + foreach (unserialize($array['dateServicesGeneral']) as $row) + { + $date->services['service'][] = Service::fromArray($row); + } + + return $date; + } + +} diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Hotel.php b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Hotel.php new file mode 100644 index 00000000..9a1ffdef --- /dev/null +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Hotel.php @@ -0,0 +1,68 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +class Hotel +{ + + /** + * @var string + */ + public $name; + + /** + * @var string + */ + public $description; + + /** + * @var string + */ + public $features; + + /** + * @var array + */ + public $dates = []; + + /** + * @param \EP\EpProducts\Domain\Model\Hotel $entity + * @return Hotel + */ + public static function fromEntity(\EP\EpProducts\Domain\Model\Hotel $entity) + { + $hotel = new self; + + $hotel->name = $entity->getName(); + $hotel->description = SerializationUtility::sanitizeText($entity->getDescription()); + $hotel->features = SerializationUtility::sanitizeText($entity->getFeatures()); + + return $hotel; + } +} diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Product.php b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Product.php new file mode 100644 index 00000000..193efc64 --- /dev/null +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Product.php @@ -0,0 +1,111 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +use EP\EpProducts\Utility\SerializationUtility; + +class Product +{ + /** + * @var string + */ + public $name; + + /** + * @var array + */ + public $facts = []; + + /** + * @var string + */ + public $skipass; + + /** + * @var array + */ + public $concept = []; + + /** + * @var string + */ + public $board; + + /** + * @var string + */ + public $programme; + + /** + * @var Region + */ + public $region; + + /** + * @var City + */ + public $city; + + /** + * @var array + */ + public $images = []; + + /** + * @var array + */ + public $hotels = []; + + /** + * @param \EP\EpProducts\Domain\Model\Product $entity + * @return Product + */ + public static function fromEntity(\EP\EpProducts\Domain\Model\Product $entity) + { + $product = new self; + + $product->name = preg_replace('/[\r\n\s]+/', ' ', $entity->getName()); + + $product->facts['fact'] = array_map(function ($fact) { + return htmlspecialchars($fact->getName()); + }, $entity->getFacts()->toArray()); + + $product->skipass = SerializationUtility::sanitizeText($entity->getSkiPassDescription()); + $product->concept['name'] = $entity->getConcept()->getName(); + $product->concept['description'] = SerializationUtility::sanitizeText($entity->getConcept()->getDescription()); + $product->board = SerializationUtility::sanitizeText($entity->getBoardDescription()); + $product->programme = SerializationUtility::sanitizeText($entity->getProgrammeDescription()); + $product->images['image'] = SerializationUtility::preprocessImages($entity->getResellerImages()); + + $product->region = Region::fromEntity($entity->getRegion()); + $product->city = City::fromEntity($entity->getCity()); + + return $product; + } + +} diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Region.php b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Region.php new file mode 100644 index 00000000..4adca799 --- /dev/null +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Region.php @@ -0,0 +1,104 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +use EP\EpProducts\Utility\SerializationUtility; + +class Region +{ + + /** + * @var string + */ + public $name; + + /** + * @var string + */ + public $description; + + /** + * @var string + */ + public $descriptionExtended; + + /** + * @var string + */ + public $piste; + + /** + * @var string + */ + public $height; + + /** + * @var string + */ + public $lifts; + + /** + * @var string + */ + public $skipass; + + /** + * @var + */ + public $news; + + /** + * @var array + */ + public $facts = []; + + /** + * @param \EP\EpProducts\Domain\Model\Region $entity + * @return Region + */ + public static function fromEntity(\EP\EpProducts\Domain\Model\Region $entity) + { + $region = new self; + + $region->name = $entity->getName(); + $region->description = SerializationUtility::sanitizeText($entity->getSkiArea()); + $region->descriptionExtended = SerializationUtility::sanitizeText($entity->getSkiAreaExtended()); + $region->piste = $entity->getLength(); + $region->height = $entity->getHeight(); + $region->lifts = $entity->getLifts(); + $region->skipass = SerializationUtility::sanitizeText($entity->getSkiPass()); + $region->news = SerializationUtility::sanitizeText($entity->getNews()); + + $region->facts['fact'] = array_map(function ($fact) { + return htmlspecialchars($fact->getName()); + }, $entity->getFacts()->toArray()); + + return $region; + } + +} diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Room.php b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Room.php new file mode 100644 index 00000000..5a21bf66 --- /dev/null +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Room.php @@ -0,0 +1,81 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +class Room +{ + + /** + * @var string + */ + public $name; + + /** + * @var string + */ + public $price; + + /** + * @var string + */ + public $busprice; + + /** + * @var array + */ + public $services; + + /** + * @var string + */ + public $nigthts; + + /** + * @var string + */ + public $available; + + /** + * @param array $array + * @return Room + */ + public static function fromArray(array $array) + { + $room = new self; + + $room->name = $array['roomName']; + $room->price = $array['roomPrice']; + $room->busprice = $array['busPrice']; + + foreach (unserialize($array['roomOptionalServices']) as $row) + { + $room->services['service'][] = Service::fromArray($row); + } + + return $room; + } +} diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Service.php b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Service.php new file mode 100644 index 00000000..41bf0ca9 --- /dev/null +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Service.php @@ -0,0 +1,56 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +class Service +{ + + /** + * @var string + */ + public $label; + + /** + * @var string + */ + public $price; + + /** + * @param array $array + * @return Service + */ + public static function fromArray(array $array) + { + $service = new self; + + $data = reset($array); + $service->label = $data['label']; + $service->price = $data['price']; + + return $service; + } +} diff --git a/web/typo3conf/ext/ep_products/Classes/Service/ExcelService.php b/web/typo3conf/ext/ep_products/Classes/Service/ExcelService.php new file mode 100644 index 00000000..7faea68c --- /dev/null +++ b/web/typo3conf/ext/ep_products/Classes/Service/ExcelService.php @@ -0,0 +1,41 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +use TYPO3\CMS\Core\SingletonInterface; + +class ExcelService implements SingletonInterface +{ + public function createDocument() + {} + + public function addWorksheet() + {} + + public function renderDocument() + {} +} diff --git a/web/typo3conf/ext/ep_products/Classes/Service/ResellerService.php b/web/typo3conf/ext/ep_products/Classes/Service/ResellerService.php new file mode 100644 index 00000000..2d8d7b24 --- /dev/null +++ b/web/typo3conf/ext/ep_products/Classes/Service/ResellerService.php @@ -0,0 +1,112 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +use EP\EpProducts\Domain\Model\Hotel; +use EP\EpProducts\Domain\Model\Product; +use EP\EpProducts\Domain\Repository\ProductRepository; +use EP\EpProducts\Domain\Serialization\Date; +use EP\EpProducts\Domain\Serialization\Room; +use TYPO3\CMS\Core\SingletonInterface; +use TYPO3\CMS\Extbase\Persistence\ObjectStorage; + +class ResellerService implements SingletonInterface +{ + /** + * @var ProductRepository + */ + protected $productRepository; + + /** + * @param ProductRepository $productRepository + */ + public function __construct(ProductRepository $productRepository) + { + $this->productRepository = $productRepository; + } + + /** + * @param ObjectStorage $products + * @return array + */ + public function preprocessAll(ObjectStorage $products) + { + $data = []; + + foreach ($products as $product) + { + /** @var Product $product */ + $data['product'][] = $this->preprocessSingle($product); + } + + return $data; + } + + /** + * @param Product $product + * @return \EP\EpProducts\Domain\Serialization\Product + */ + public function preprocessSingle(Product $product) + { + $data = \EP\EpProducts\Domain\Serialization\Product::fromEntity($product); + + $hotels = $product->getHotels(); + + foreach ($hotels as $hotel) + { + /** @var Hotel $hotel */ + $hotelData = \EP\EpProducts\Domain\Serialization\Hotel::fromEntity($hotel); + $dates = $this->productRepository->getDatesForExport($product, $hotel); + $hotelData->dates['date'] = $this->preprocessDates($dates); + $data->hotels['hotel'] = $hotelData; + } + + return $data; + } + + /** + * @param array $dates + * @return array + */ + public function preprocessDates(array $dates) + { + $data = []; + + foreach ($dates as $row) + { + if (!isset($data[$row['dateStart']])) { + $date = Date::fromArray($row); + $data[$row['dateStart']] = $date; + } + + $date->rooms[] = Room::fromArray($row); + } + + return array_values($data); + } +} diff --git a/web/typo3conf/ext/ep_products/Classes/Utility/SerializationUtility.php b/web/typo3conf/ext/ep_products/Classes/Utility/SerializationUtility.php new file mode 100644 index 00000000..25433351 --- /dev/null +++ b/web/typo3conf/ext/ep_products/Classes/Utility/SerializationUtility.php @@ -0,0 +1,69 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Domain\Model\FileReference; +use TYPO3\CMS\Extbase\Persistence\ObjectStorage; + +class SerializationUtility +{ + /** + * @param $text + * @return string + */ + public static function sanitizeText($text) + { + //$text = html_entity_decode($text, null, 'utf-8'); + //$text = strip_tags($text); + //$text = htmlspecialchars($text); + //$text = nl2br($text); + $text = str_replace(' ', ' ', $text); + + return trim($text); + } + + /** + * @param ObjectStorage $images + * @return array + */ + public static function preprocessImages(ObjectStorage $images) + { + $hostname = GeneralUtility::getHostname(); + $data = []; + foreach ($images as $image) + { + /** @var FileReference $image + */ + $data[] = 'https://' . $hostname . '/' . $image->getOriginalResource()->getOriginalFile()->getPublicUrl(); + } + + return $data; + } + +} diff --git a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_city_detail.xml b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_city_detail.xml index 5b0f42f0..6f790110 100644 --- a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_city_detail.xml +++ b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_city_detail.xml @@ -18,7 +18,7 @@ select selectSingle tx_epproducts_domain_model_city - ORDER BY name + AND tx_epproducts_domain_model_city.hidden = 0 AND tx_epproducts_domain_model_city.deleted = 0 ORDER BY tx_epproducts_domain_model_city.name 1 1 diff --git a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_concept_detail.xml b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_concept_detail.xml index 8155d8c3..20238195 100644 --- a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_concept_detail.xml +++ b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_concept_detail.xml @@ -18,7 +18,7 @@ select selectSingle tx_epproducts_domain_model_concept - ORDER BY name + AND tx_epproducts_domain_model_concept.hidden = 0 AND tx_epproducts_domain_model_concept.deleted = 0 ORDER BY tx_epproducts_domain_model_concept.name Alle diff --git a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_country.xml b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_country.xml index 7e9cb9b4..0d7880a1 100644 --- a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_country.xml +++ b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_country.xml @@ -18,7 +18,7 @@ select selectSingle tx_epproducts_domain_model_country - ORDER BY name + AND tx_epproducts_domain_model_country.hidden = 0 AND tx_epproducts_domain_model_country.deleted = 0 ORDER BY tx_epproducts_domain_model_country.name diff --git a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_faq.xml b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_faq.xml index 7937046a..cb9d8095 100644 --- a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_faq.xml +++ b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_faq.xml @@ -18,7 +18,7 @@ select selectMultipleSideBySide tx_epproducts_domain_model_faq - ORDER BY label + AND tx_epproducts_domain_model_faq.hidden = 0 AND tx_epproducts_domain_model_faq.deleted = 0 ORDER BY tx_epproducts_domain_model_faq.label 1 50 10 diff --git a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_hotel_detail.xml b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_hotel_detail.xml index 0911fa31..a14ecf77 100644 --- a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_hotel_detail.xml +++ b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_hotel_detail.xml @@ -18,7 +18,7 @@ select selectSingle tx_epproducts_domain_model_hotel - ORDER BY name + AND tx_epproducts_domain_model_hotel.hidden = 0 AND tx_epproducts_domain_model_hotel.deleted = 0 ORDER BY tx_epproducts_domain_model_hotel.name Alle diff --git a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_hotel_detail_event.xml b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_hotel_detail_event.xml index 11a518bb..3a2262b1 100644 --- a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_hotel_detail_event.xml +++ b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_hotel_detail_event.xml @@ -18,7 +18,7 @@ select selectSingle tx_epproducts_domain_model_product - ORDER BY name + AND tx_epproducts_domain_model_product.hidden = 0 AND tx_epproducts_domain_model_product.deleted = 0 ORDER BY tx_epproducts_domain_model_product.name 1 1 @@ -32,7 +32,7 @@ select selectSingle tx_epproducts_domain_model_hotel - ORDER BY name + AND tx_epproducts_domain_model_hotel.hidden = 0 AND tx_epproducts_domain_model_hotel.deleted = 0 ORDER BY tx_epproducts_domain_model_hotel.name Alle diff --git a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_pricetable.xml b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_pricetable.xml index 3e12e06f..945e79e8 100644 --- a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_pricetable.xml +++ b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_pricetable.xml @@ -51,7 +51,7 @@ select selectSingle tx_epproducts_domain_model_product - ORDER BY name + AND tx_epproducts_domain_model_product.hidden = 0 AND tx_epproducts_domain_model_product.deleted = 0 ORDER BY tx_epproducts_domain_model_product.name 1 1 diff --git a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_product_detail.xml b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_product_detail.xml index 2b1670af..78663454 100644 --- a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_product_detail.xml +++ b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_product_detail.xml @@ -18,7 +18,7 @@ select selectSingle tx_epproducts_domain_model_product - ORDER BY name + AND tx_epproducts_domain_model_product.hidden = 0 AND tx_epproducts_domain_model_product.deleted = 0 ORDER BY tx_epproducts_domain_model_product.name Alle @@ -38,7 +38,7 @@ select selectSingle tx_epproducts_domain_model_hotel - ORDER BY name + AND tx_epproducts_domain_model_hotel.hidden = 0 AND tx_epproducts_domain_model_hotel.deleted = 0 ORDER BY tx_epproducts_domain_model_hotel.name Alle diff --git a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_product_pricetable.xml b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_product_pricetable.xml index 11a518bb..3a2262b1 100644 --- a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_product_pricetable.xml +++ b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_product_pricetable.xml @@ -18,7 +18,7 @@ select selectSingle tx_epproducts_domain_model_product - ORDER BY name + AND tx_epproducts_domain_model_product.hidden = 0 AND tx_epproducts_domain_model_product.deleted = 0 ORDER BY tx_epproducts_domain_model_product.name 1 1 @@ -32,7 +32,7 @@ select selectSingle tx_epproducts_domain_model_hotel - ORDER BY name + AND tx_epproducts_domain_model_hotel.hidden = 0 AND tx_epproducts_domain_model_hotel.deleted = 0 ORDER BY tx_epproducts_domain_model_hotel.name Alle diff --git a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_region_detail.xml b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_region_detail.xml index 46baa674..2e313c07 100644 --- a/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_region_detail.xml +++ b/web/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_region_detail.xml @@ -18,7 +18,7 @@ select selectSingle tx_epproducts_domain_model_region - ORDER BY name + AND tx_epproducts_domain_model_region.hidden = 0 AND tx_epproducts_domain_model_region.deleted = 0 ORDER BY tx_epproducts_domain_model_region.name 1 1 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 d2287e47..bfed4160 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 @@ -41,7 +41,7 @@ return [ programme_description, ski_pass_description, --div--;Verknüpfungen, journey, --palette--;;concept, hotels, facts, faqs, officetip, additional_regions, badge, - --div--;Bilder/Dateien, teaser_images, header_images, images, banner, video', + --div--;Bilder/Dateien, teaser_images, header_images, images, reseller_images, banner, video', 'columnsOverrides' => [ 'teaser' => [ 'defaultExtras' => 'richtext[]:rte_transform[mode=ts_links]', @@ -455,6 +455,32 @@ return [ $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] ), ], + 'reseller_images' => [ + 'exclude' => 0, + 'label' => 'Bilder für Vertriebspartner', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'reseller_images', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'foreign_types' => [ + '0' => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ], + ], + 'maxitems' => 10 + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], 'concept' => [ 'exclude' => 0, 'label' => 'LLL:EXT:ep_products/Resources/Private/Language/locallang.xlf:tx_epproducts_domain_model_product.concept', diff --git a/web/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_reseller.php b/web/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_reseller.php new file mode 100644 index 00000000..be0ffb82 --- /dev/null +++ b/web/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_reseller.php @@ -0,0 +1,149 @@ + [ + 'title' => 'LLL:EXT:ep_products/Resources/Private/Language/locallang.xlf:tx_epproducts_domain_model_reseller', + 'label' => 'name', + 'default_sortby' => 'ORDER BY name', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'cruser_id' => 'cruser_id', + 'dividers2tabs' => true, + 'versioningWS' => 2, + 'versioning_followPages' => true, + 'languageField' => 'sys_language_uid', + 'transOrigPointerField' => 'l10n_parent', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'delete' => 'deleted', + 'enablecolumns' => [ + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime', + ], + 'searchFields' => 'name', + 'iconfile' => 'EXT:ep_products/Resources/Public/Icons/tx_epproducts_domain_model_reseller.gif' + ], + 'interface' => [ + 'showRecordFieldList' => 'name,code,products', + ], + 'types' => [ + '1' => ['showitem' => 'name, code, products'], + ], + 'palettes' => [], + 'columns' => [ + + 'sys_language_uid' => [ + 'exclude' => 0, + 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'foreign_table' => 'sys_language', + 'foreign_table_where' => 'ORDER BY sys_language.title', + 'items' => [ + ['LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1], + ['LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0] + ], + ], + ], + 'l10n_parent' => [ + 'displayCond' => 'FIELD:sys_language_uid:>:0', + 'exclude' => 0, + 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'items' => [ + ['', 0], + ], + 'foreign_table' => 'tx_epproducts_domain_model_reseller', + 'foreign_table_where' => 'AND tx_epproducts_domain_model_reseller.pid=###CURRENT_PID### AND tx_epproducts_domain_model_reseller.sys_language_uid IN (-1,0)', + ], + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + + 't3ver_label' => [ + 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'max' => 255, + ] + ], + + 'hidden' => [ + 'exclude' => 0, + 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.hidden', + 'config' => [ + 'type' => 'check', + ], + ], + 'starttime' => [ + 'exclude' => 0, + 'l10n_mode' => 'mergeIfNotBlank', + 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.starttime', + 'config' => [ + 'type' => 'input', + 'size' => 13, + 'max' => 20, + 'eval' => 'datetime', + 'checkbox' => 0, + 'default' => 0, + 'range' => [ + 'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y')) + ], + ], + ], + 'endtime' => [ + 'exclude' => 0, + 'l10n_mode' => 'mergeIfNotBlank', + 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.endtime', + 'config' => [ + 'type' => 'input', + 'size' => 13, + 'max' => 20, + 'eval' => 'datetime', + 'checkbox' => 0, + 'default' => 0, + 'range' => [ + 'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y')) + ], + ], + ], + + 'name' => [ + 'exclude' => 0, + 'label' => 'LLL:EXT:ep_products/Resources/Private/Language/locallang.xlf:tx_epproducts_domain_model_reseller.name', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim,required' + ], + ], + 'code' => [ + 'exclude' => 0, + 'label' => 'LLL:EXT:ep_products/Resources/Private/Language/locallang.xlf:tx_epproducts_domain_model_reseller.code', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim,required' + ], + ], + 'products' => [ + 'exclude' => 0, + 'label' => 'LLL:EXT:ep_products/Resources/Private/Language/locallang.xlf:tx_epproducts_domain_model_reseller.products', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', + 'foreign_table' => 'tx_epproducts_domain_model_product', + 'MM' => 'tx_epproducts_reseller_product_mm', + 'foreign_table_where' => 'AND 1=1 ORDER BY tx_epproducts_domain_model_product.name', + 'minitems' => 1, + 'maxitems' => 99, + ], + ], + ], +]; diff --git a/web/typo3conf/ext/ep_products/Resources/Private/Language/locallang.xlf b/web/typo3conf/ext/ep_products/Resources/Private/Language/locallang.xlf index acf95bef..10b22ea9 100644 --- a/web/typo3conf/ext/ep_products/Resources/Private/Language/locallang.xlf +++ b/web/typo3conf/ext/ep_products/Resources/Private/Language/locallang.xlf @@ -589,6 +589,18 @@ Statisches Suchergebnis + + Vertriebspartner + + + Name + + + Code + + + Produkte + Deine Suche %s%s ergab %s Treffer diff --git a/web/typo3conf/ext/ep_products/Resources/Public/Icons/tx_epproducts_domain_model_reseller.gif b/web/typo3conf/ext/ep_products/Resources/Public/Icons/tx_epproducts_domain_model_reseller.gif new file mode 100644 index 0000000000000000000000000000000000000000..37ba37b9b3a220018e3a291bf2ee413d0da30ce0 GIT binary patch literal 230 zcmZ?wbh9u|6krfwIKlt|GBPr{y1EAX`lY3%Jv}|Mz+f2|Yy*R1U~nA_UV_1QFaYW; z2AhC~Q2fcl$iN`NpaW6^vXg-|S;5tE3G-Y5<#kHRdp8`B$dNv*cXpRhl~&t>ccvU1 zeHPQ2GIn^1cr6p&73IaoD$=91iK~a{(6rVH&ROOxH+%Y4hNqsq`BO~MkEuZ}q3Mby Zn_ZKDm69U|7Z(ptCx?^igb9ia)&LfwP0|1W literal 0 HcmV?d00001 diff --git a/web/typo3conf/ext/ep_products/ext_localconf.php b/web/typo3conf/ext/ep_products/ext_localconf.php index 4591cb36..f41d9b5c 100644 --- a/web/typo3conf/ext/ep_products/ext_localconf.php +++ b/web/typo3conf/ext/ep_products/ext_localconf.php @@ -297,6 +297,17 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\EP\EpProducts\T ] ); +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'EP.' . $_EXTKEY, + 'reseller', + [ + 'Reseller' => 'list,xml,excel', + ], + [ + 'Reseller' => '', + ] +); + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'EP.' . $_EXTKEY, 'ajax', diff --git a/web/typo3conf/ext/ep_products/ext_tables.php b/web/typo3conf/ext/ep_products/ext_tables.php index 1b7fafae..bc95113a 100644 --- a/web/typo3conf/ext/ep_products/ext_tables.php +++ b/web/typo3conf/ext/ep_products/ext_tables.php @@ -137,6 +137,12 @@ if (!defined('TYPO3_MODE')) { 'Preistabelle' ); +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'EP.' . $_EXTKEY, + 'reseller', + 'Vertriebspartner Export' +); + $extensionName = strtolower(\TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY)); $pluginSignature = str_replace('_', '', $_EXTKEY) . '_product_detail'; diff --git a/web/typo3conf/ext/ep_products/ext_tables.sql b/web/typo3conf/ext/ep_products/ext_tables.sql index ff080628..3238c01a 100644 --- a/web/typo3conf/ext/ep_products/ext_tables.sql +++ b/web/typo3conf/ext/ep_products/ext_tables.sql @@ -33,6 +33,7 @@ CREATE TABLE tx_epproducts_domain_model_product ( teaser_images int(11) unsigned NOT NULL default '0', header_images int(11) unsigned NOT NULL default '0', images int(11) unsigned NOT NULL default '0', + reseller_images int(11) unsigned NOT NULL default '0', concept int(11) unsigned DEFAULT '0' NOT NULL, country int(11) unsigned DEFAULT '0' NOT NULL, region int(11) unsigned DEFAULT '0' NOT NULL, @@ -1064,6 +1065,47 @@ CREATE TABLE tx_epproducts_domain_model_staticsearchparams ( KEY path_segment (path_segment) ); +# +# Table structure for table 'tx_epproducts_domain_model_reseller' +# +CREATE TABLE tx_epproducts_domain_model_reseller ( + + uid int(11) NOT NULL auto_increment, + pid int(11) DEFAULT '0' NOT NULL, + + name varchar(255) DEFAULT '' NOT NULL, + code varchar(255) DEFAULT '' NOT NULL, + products int(11) unsigned DEFAULT '0' NOT NULL, + + tstamp int(11) unsigned DEFAULT '0' NOT NULL, + crdate int(11) unsigned DEFAULT '0' NOT NULL, + cruser_id int(11) unsigned DEFAULT '0' NOT NULL, + deleted tinyint(4) unsigned DEFAULT '0' NOT NULL, + hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, + starttime int(11) unsigned DEFAULT '0' NOT NULL, + endtime int(11) unsigned DEFAULT '0' NOT NULL, + + t3ver_oid int(11) DEFAULT '0' NOT NULL, + t3ver_id int(11) DEFAULT '0' NOT NULL, + t3ver_wsid int(11) DEFAULT '0' NOT NULL, + t3ver_label varchar(255) DEFAULT '' NOT NULL, + t3ver_state tinyint(4) DEFAULT '0' NOT NULL, + t3ver_stage int(11) DEFAULT '0' NOT NULL, + t3ver_count int(11) DEFAULT '0' NOT NULL, + t3ver_tstamp int(11) DEFAULT '0' NOT NULL, + t3ver_move_id int(11) DEFAULT '0' NOT NULL, + + sys_language_uid int(11) DEFAULT '0' NOT NULL, + l10n_parent int(11) DEFAULT '0' NOT NULL, + l10n_diffsource mediumblob, + + PRIMARY KEY (uid), + KEY parent (pid), + KEY t3ver_oid (t3ver_oid,t3ver_wsid), + KEY language (l10n_parent,sys_language_uid) + +); + # # Table structure for table 'tx_epproducts_product_hotel_mm' # @@ -1181,6 +1223,19 @@ CREATE TABLE tx_epproducts_city_fact_mm ( KEY uid_foreign (uid_foreign) ); +# +# Table structure for table 'tx_epproducts_reseller_product_mm' +# +CREATE TABLE tx_epproducts_reseller_product_mm ( + uid_local int(11) unsigned DEFAULT '0' NOT NULL, + uid_foreign int(11) unsigned DEFAULT '0' NOT NULL, + sorting int(11) unsigned DEFAULT '0' NOT NULL, + sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL, + + KEY uid_local (uid_local), + KEY uid_foreign (uid_foreign) +); + # # Table structure for table 'tx_epproducts_log' # @@ -1193,4 +1248,4 @@ CREATE TABLE tx_epproducts_log ( data text, KEY request (request_id) -); \ No newline at end of file +); diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Reseller/List.html b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Reseller/List.html new file mode 100644 index 00000000..9665edff --- /dev/null +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Reseller/List.html @@ -0,0 +1,24 @@ + + + + + +
+
+
+

Gesamtexport XML

+ Export XML +

Einzelexport Excel

+
    + +
  • Export XLS: {product.name}
  • +
    +
+
+
+
+
+ + diff --git a/web/typo3conf/realurl_conf.php b/web/typo3conf/realurl_conf.php index 051581c2..c89c6245 100644 --- a/web/typo3conf/realurl_conf.php +++ b/web/typo3conf/realurl_conf.php @@ -125,6 +125,32 @@ $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = [ ], ], ], + 'reseller' => [ + [ + 'GETvar' => 'tx_epproducts_reseller[controller]', + 'noMatch' => 'bypass', + ], + [ + 'GETvar' => 'tx_epproducts_reseller[reseller]', + 'lookUpTable' => [ + 'table' => 'tx_epproducts_domain_model_reseller', + 'id_field' => 'uid', + 'alias_field' => 'code', + 'addWhereClause' => ' AND NOT deleted', + 'useUniqueCache' => 1, + 'useUniqueCache_conf' => [ + 'strtolower' => 1, + 'spaceCharacter' => '-' + ] + ], + ], + [ + 'GETvar' => 'tx_epproducts_reseller[action]', + ], + [ + 'GETvar' => 'tx_epproducts_reseller[product]', + ], + ], 41 => 'searchresult', 855 => 'ajax', 878 => 'ajax', @@ -135,6 +161,7 @@ $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = [ 1446 => 'team', 987 => 'events_contactform', 1300 => 'events_activity', + 1448 => 'reseller', 'newsDetailConfiguration' => [ [ 'GETvar' => 'tx_news_pi1[news]',