Fix incomplete TCA due to unintentionally removed extension configuration
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
defined('TYPO3_MODE') or die();
|
||||
|
||||
call_user_func(function() {
|
||||
|
||||
$budgetItems = $paxItems = $periodItems = [
|
||||
['keine Auswahl', 0]
|
||||
];
|
||||
|
||||
$extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class)->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;
|
||||
|
||||
});
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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']
|
||||
]));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user