From 4a3eb42c73ea1e26be4d1b1215c74f64c128adb2 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 29 Sep 2022 14:10:36 +0200 Subject: [PATCH] Allow to import things organised by generic organisations (#74) Not all things are managed by TouristMarketingCompany, some are managed by generic organisations. Those are now handled the same way as TouristMarketingCompany are already handled. That way those things can also be imported, as they now can import their manager. --- Classes/Domain/Import/Entity/Organisation.php | 34 +++++++++++++++++++ .../Import/Entity/TouristMarketingCompany.php | 10 +++++- .../Typo3Converter/GeneralConverter.php | 2 ++ Documentation/Changelog/1.3.1.rst | 30 ++++++++++++++++ ext_emconf.php | 2 +- 5 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 Classes/Domain/Import/Entity/Organisation.php create mode 100644 Documentation/Changelog/1.3.1.rst diff --git a/Classes/Domain/Import/Entity/Organisation.php b/Classes/Domain/Import/Entity/Organisation.php new file mode 100644 index 0000000..f12d571 --- /dev/null +++ b/Classes/Domain/Import/Entity/Organisation.php @@ -0,0 +1,34 @@ + + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +namespace WerkraumMedia\ThueCat\Domain\Import\Entity; + +class Organisation extends Minimum implements MapsToType +{ + public static function getSupportedTypes(): array + { + return [ + 'ttgds:Organization', + ]; + } +} diff --git a/Classes/Domain/Import/Entity/TouristMarketingCompany.php b/Classes/Domain/Import/Entity/TouristMarketingCompany.php index 3e65123..084b5d4 100644 --- a/Classes/Domain/Import/Entity/TouristMarketingCompany.php +++ b/Classes/Domain/Import/Entity/TouristMarketingCompany.php @@ -23,7 +23,7 @@ declare(strict_types=1); namespace WerkraumMedia\ThueCat\Domain\Import\Entity; -class TouristMarketingCompany extends Minimum implements MapsToType +class TouristMarketingCompany extends Organisation { public static function getSupportedTypes(): array { @@ -31,4 +31,12 @@ class TouristMarketingCompany extends Minimum implements MapsToType 'thuecat:TouristMarketingCompany', ]; } + + /** + * Higher then default 10, as this is also an ttgds:Organization and Organisation would conflict in priority. + */ + public static function getPriority(): int + { + return 20; + } } diff --git a/Classes/Domain/Import/Typo3Converter/GeneralConverter.php b/Classes/Domain/Import/Typo3Converter/GeneralConverter.php index e9a3ac8..4a2cf59 100644 --- a/Classes/Domain/Import/Typo3Converter/GeneralConverter.php +++ b/Classes/Domain/Import/Typo3Converter/GeneralConverter.php @@ -31,6 +31,7 @@ use WerkraumMedia\ThueCat\Domain\Import\Entity\Base; use WerkraumMedia\ThueCat\Domain\Import\Entity\MapsToType; use WerkraumMedia\ThueCat\Domain\Import\Entity\MediaObject; use WerkraumMedia\ThueCat\Domain\Import\Entity\Minimum; +use WerkraumMedia\ThueCat\Domain\Import\Entity\Organisation; use WerkraumMedia\ThueCat\Domain\Import\Entity\ParkingFacility; use WerkraumMedia\ThueCat\Domain\Import\Entity\Place; use WerkraumMedia\ThueCat\Domain\Import\Entity\Properties\ForeignReference; @@ -96,6 +97,7 @@ class GeneralConverter implements Converter, LoggerAwareInterface Town::class => 'tx_thuecat_town', TouristInformation::class => 'tx_thuecat_tourist_information', TouristMarketingCompany::class => 'tx_thuecat_organisation', + Organisation::class => 'tx_thuecat_organisation', ]; public function __construct( diff --git a/Documentation/Changelog/1.3.1.rst b/Documentation/Changelog/1.3.1.rst new file mode 100644 index 0000000..62f87db --- /dev/null +++ b/Documentation/Changelog/1.3.1.rst @@ -0,0 +1,30 @@ +1.3.1 +===== + +Breaking +-------- + +Nothing + +Features +-------- + +Nothing + +Fixes +----- + +* Allow to import objects (e.g. Tourist Attractions) which are managed by generic + organisations instead of specific Tourist Marketing Company. + Those organisations will now also be imported, just like Tourist Marketing Company before. + Both are organizations internally and only used for the TYPO3 backend module. + +Tasks +----- + +Nothing +Deprecation +----------- + +Nothing + diff --git a/ext_emconf.php b/ext_emconf.php index e95ae0e..f3a836a 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -11,7 +11,7 @@ $EM_CONF[$_EXTKEY] = [ 'author' => 'Daniel Siepmann', 'author_email' => 'coding@daniel-siepmann.de', 'author_company' => '', - 'version' => '1.3.0', + 'version' => '1.3.1', 'constraints' => [ 'depends' => [ 'core' => '',