diff --git a/public/typo3conf/ext/ep_events/Configuration/TCA/Overrides/tx_epevents_domain_model_offer.php b/public/typo3conf/ext/ep_events/Configuration/TCA/Overrides/tx_epevents_domain_model_offer.php new file mode 100644 index 00000000..da11fceb --- /dev/null +++ b/public/typo3conf/ext/ep_events/Configuration/TCA/Overrides/tx_epevents_domain_model_offer.php @@ -0,0 +1,37 @@ +get('ep_events'); + + $budgetItemsConfig = explode(';', $extensionConfiguration['budgetOptions']); + foreach ($budgetItemsConfig as $item) + { + [$value, $label] = explode(':', $item); + $budgetItems[] = [$label, $value]; + } + $GLOBALS['TCA']['tx_epevents_domain_model_offer']['columns']['configurator_budget']['config']['items'] = $budgetItems; + + $paxItemsConfig = explode(';', $extensionConfiguration['paxOptions']); + foreach ($paxItemsConfig as $item) + { + [$value, $label] = explode(':', $item); + $paxItems[] = [$label, $value]; + } + $GLOBALS['TCA']['tx_epevents_domain_model_offer']['columns']['configurator_pax']['config']['items'] = $paxItems; + + $periodItemsConfig = explode(';', $extensionConfiguration['periodOptions']); + foreach ($periodItemsConfig as $item) + { + [$value, $label] = explode(':', $item); + $periodItems[] = [$label, $value]; + } + $GLOBALS['TCA']['tx_epevents_domain_model_offer']['columns']['configurator_period']['config']['items'] = $periodItems; + +}); diff --git a/public/typo3conf/ext/ep_events/Configuration/TypoScript/setup.typoscript b/public/typo3conf/ext/ep_events/Configuration/TypoScript/setup.typoscript index 1e63f755..e1ef9ffb 100644 --- a/public/typo3conf/ext/ep_events/Configuration/TypoScript/setup.typoscript +++ b/public/typo3conf/ext/ep_events/Configuration/TypoScript/setup.typoscript @@ -60,9 +60,9 @@ plugin.tx_epevents { budget = 4 } options { - budget = 1:nicht festgelegt;2:400 - 600 €;3:600 - 800 €;4:800 - 1000 €;5:1000 - 1500 €;6:1500 - 2000 €;7:2500 - 3000 € - pax = 1:20 - 40;2:40 - 60;3:60 - 80;4:80 - 100;5:100 - 150;6:150 - 200;7:200 - 250;8:250 - 300;9:350 - 400;10:400 - 450;11:450 - 500;12:500+ - period = 1:Tagesevent;2:1 Nacht;3:2 Nächte;4:3 Nächte;5:4 Nächte;6:5 Nächte;7:6 Nächte;8:7 Nächte + budget = {$plugin.tx_epevents.settings.configurator.budgetOptions} + pax = {$plugin.tx_epevents.settings.configurator.paxOptions} + period = {$plugin.tx_epevents.settings.configurator.periodOptions} travelType = 1:Incentive;2:Teambuilding;3:Meeting;4:Corporate Event locationType = 1:Meer;2:Berge;3:Städte;4:Spezial accommodationType = 1:3-Sterne;2:4-Sterne;3:5-Sterne;4:Spezial diff --git a/public/typo3conf/ext/ep_events/ext_conf_template.txt b/public/typo3conf/ext/ep_events/ext_conf_template.txt new file mode 100644 index 00000000..00ce4ce0 --- /dev/null +++ b/public/typo3conf/ext/ep_events/ext_conf_template.txt @@ -0,0 +1,6 @@ +# cat=Configurator; type=string; label=Budget options +budgetOptions = 1:nicht festgelegt;2:400 - 600 €;3:600 - 800 €;4:800 - 1000 €;5:1000 - 1500 €;6:1500 - 2000 €;7:2500 - 3000 € +# cat=Configurator; type=string; label=Pax options +paxOptions = 1:20 - 40;2:40 - 60;3:60 - 80;4:80 - 100;5:100 - 150;6:150 - 200;7:200 - 250;8:250 - 300;9:350 - 400;10:400 - 450;11:450 - 500;12:500+ +# cat=Configurator; type=string; label=Period options +periodOptions = 1:Tagesevent;2:1 Nacht;3:2 Nächte;4:3 Nächte;5:4 Nächte;6:5 Nächte;7:6 Nächte;8:7 Nächte diff --git a/public/typo3conf/ext/ep_events/ext_localconf.php b/public/typo3conf/ext/ep_events/ext_localconf.php index d91ca49c..faa984c7 100644 --- a/public/typo3conf/ext/ep_events/ext_localconf.php +++ b/public/typo3conf/ext/ep_events/ext_localconf.php @@ -155,4 +155,15 @@ call_user_func(function() { ]; $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['activitySlug'] = \EP\EpEvents\Updates\ActivitySlugUpdater::class; + + $extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class)->get('ep_events'); + + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants(implode(PHP_EOL, [ + '# cat=plugin.tx_epevents//a; type=string; label=Configurator budget options', + 'plugin.tx_epevents.settings.configurator.budgetOptions = ' . $extensionConfiguration['budgetOptions'], + '# cat=plugin.tx_epevents//a; type=string; label=Configurator pax options', + 'plugin.tx_epevents.settings.configurator.paxOptions = ' . $extensionConfiguration['paxOptions'], + '# cat=plugin.tx_epevents//a; type=string; label=Configurator period options', + 'plugin.tx_epevents.settings.configurator.periodOptions = ' . $extensionConfiguration['periodOptions'] + ])); });