Make running costs editable in plugin config

This commit is contained in:
Björn Fromme
2022-08-22 17:20:07 +02:00
parent 87898b4970
commit 2db9ff0ecc
4 changed files with 36 additions and 0 deletions
@@ -41,6 +41,7 @@ class GroupsPriceController extends ActionController
});
$this->view->assign('hotel', $hotel);
$this->view->assign('runningCosts', $this->settings['runningCosts']);
$this->view->assign('configs', json_encode(array_values($configs), JSON_HEX_APOS));
$this->view->assign('boards', json_encode($hotel->getGroupsPriceBoards()->toArray(), JSON_HEX_APOS));
$this->view->assign('options', json_encode($hotel->getGroupsPriceOptions()->toArray(), JSON_HEX_APOS));
@@ -0,0 +1,28 @@
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>Konfiguration</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<settings.runningCosts>
<TCEforms>
<exclude>0</exclude>
<label>Strom- und Entsorgungspauschale</label>
<config>
<type>input</type>
<default>1.7</default>
<eval>double2,required</eval>
</config>
</TCEforms>
</settings.runningCosts>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
@@ -262,4 +262,10 @@ call_user_func(function () {
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_teammembers.xml'
);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_hotel_groups_price'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
'epproducts_hotel_groups_price',
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_groups_price_calculator.xml'
);
});
@@ -13,6 +13,7 @@
configs-json='{configs}'
boards-json='{boards}'
options-json='{options}'
running-costs-factor="{runningCosts}"
endpoint="{ep:uri.ajax(action: 'processForm', controller: 'AjaxGroupsPrice', pageUid: settings.defaultAjaxUid, arguments: '{hotel: hotel}')}"
loader-uri="{f:uri.image(src: 'EXT:ep_theme/Resources/Public/images/ajax-loader-white.gif')}"
>