Use constants for TCA select values

This commit is contained in:
Björn Fromme
2019-06-27 13:01:59 +02:00
parent 97643396f4
commit a45b3cb9da
9 changed files with 212 additions and 192 deletions
@@ -32,6 +32,11 @@ namespace EP\EpEvents\Domain\Model;
*/ */
class Activity extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity class Activity extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{ {
const TYPE_OUTDOOR_ACTION = 1;
const TYPE_EVENTGASTRO = 2;
const TYPE_SIGHTSEEING = 3;
const TYPE_SPECIAL = 4;
/** /**
* @var array * @var array
*/ */
@@ -32,6 +32,11 @@ namespace EP\EpEvents\Domain\Model;
*/ */
class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{ {
const TYPE_3STARS = 1;
const TYPE_4STARS = 2;
const TYPE_5STARS = 3;
const TYPE_SPECIAL = 4;
/** /**
* name * name
* *
@@ -36,6 +36,11 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
const DISTANCE_EUROPE = 2; const DISTANCE_EUROPE = 2;
const DISTANCE_WORLD = 3; const DISTANCE_WORLD = 3;
const TYPE_SEA = 1;
const TYPE_MOUNTAINS = 2;
const TYPE_CITIES = 3;
const TYPE_SPECIAL = 4;
/** /**
* name * name
* *
@@ -32,6 +32,11 @@ namespace EP\EpEvents\Domain\Model;
*/ */
class Traveltype extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity class Traveltype extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{ {
const TYPE_INCENTIVE = 1;
const TYPE_TEAMBUILDING = 2;
const TYPE_MEETING = 3;
const TYPE_CORPORATE_EVENT = 4;
/** /**
* @var string * @var string
*/ */
@@ -293,12 +293,12 @@ return [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [ 'items' => [
['Outdoor & Action', 1], ['Outdoor & Action', \EP\EpEvents\Domain\Model\Activity::TYPE_OUTDOOR_ACTION],
['Event-Gastronomie', 2], ['Event-Gastronomie', \EP\EpEvents\Domain\Model\Activity::TYPE_EVENTGASTRO],
['Sightseeing', 3], ['Sightseeing', \EP\EpEvents\Domain\Model\Activity::TYPE_SIGHTSEEING],
['Spezial', 4], ['Spezial', \EP\EpEvents\Domain\Model\Activity::TYPE_SPECIAL],
], ],
'default' => 1, 'default' => \EP\EpEvents\Domain\Model\Activity::TYPE_OUTDOOR_ACTION,
'size' => 1, 'size' => 1,
'minitems' => 1, 'minitems' => 1,
'maxitems' => 1, 'maxitems' => 1,
@@ -219,12 +219,12 @@ return [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [ 'items' => [
['3-Sterne', 1], ['3-Sterne', \EP\EpEvents\Domain\Model\Hotel::TYPE_3STARS],
['4-Sterne', 2], ['4-Sterne', \EP\EpEvents\Domain\Model\Hotel::TYPE_4STARS],
['5-Sterne', 3], ['5-Sterne', \EP\EpEvents\Domain\Model\Hotel::TYPE_5STARS],
['Spezial', 4], ['Spezial', \EP\EpEvents\Domain\Model\Hotel::TYPE_SPECIAL],
], ],
'default' => 1, 'default' => \EP\EpEvents\Domain\Model\Hotel::TYPE_3STARS,
'size' => 1, 'size' => 1,
'minitems' => 1, 'minitems' => 1,
'maxitems' => 1, 'maxitems' => 1,
@@ -1,102 +1,102 @@
<?php <?php
return [ return [
'ctrl' => [ 'ctrl' => [
'title' => 'LLL:EXT:ep_events/Resources/Private/Language/locallang.xlf:tx_epevents_domain_model_location', 'title' => 'LLL:EXT:ep_events/Resources/Private/Language/locallang.xlf:tx_epevents_domain_model_location',
'label' => 'name', 'label' => 'name',
'default_sortby' => 'ORDER BY name', 'default_sortby' => 'ORDER BY name',
'tstamp' => 'tstamp', 'tstamp' => 'tstamp',
'crdate' => 'crdate', 'crdate' => 'crdate',
'cruser_id' => 'cruser_id', 'cruser_id' => 'cruser_id',
'dividers2tabs' => true, 'dividers2tabs' => true,
'versioningWS' => true, 'versioningWS' => true,
'languageField' => 'sys_language_uid', 'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent', 'transOrigPointerField' => 'l10n_parent',
'transOrigDiffSourceField' => 'l10n_diffsource', 'transOrigDiffSourceField' => 'l10n_diffsource',
'delete' => 'deleted', 'delete' => 'deleted',
'enablecolumns' => [ 'enablecolumns' => [
'disabled' => 'hidden', 'disabled' => 'hidden',
'starttime' => 'starttime', 'starttime' => 'starttime',
'endtime' => 'endtime', 'endtime' => 'endtime',
], ],
'searchFields' => 'name,description_short,description_long,season,image_header,image_teaser,image_offer, 'searchFields' => 'name,description_short,description_long,season,image_header,image_teaser,image_offer,
configurator_type,configurator_distance,footer_text1,footer_text2,footer_text3,', configurator_type,configurator_distance,footer_text1,footer_text2,footer_text3,',
'iconfile' => 'EXT:ep_events/Resources/Public/images/tx_epevents_domain_model_location.gif' 'iconfile' => 'EXT:ep_events/Resources/Public/images/tx_epevents_domain_model_location.gif'
], ],
'interface' => [ 'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, description_short, 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, description_short,
description_long, season, image_header, image_teaser, image_offer, configurator_type, configurator_distance, description_long, season, image_header, image_teaser, image_offer, configurator_type, configurator_distance,
footer_text1, footer_text2, footer_text3', footer_text1, footer_text2, footer_text3',
], ],
'types' => [ 'types' => [
'1' => [ '1' => [
'showitem' => 'hidden, --palette--;;configurator, 'showitem' => 'hidden, --palette--;;configurator,
name, description_short, description_long, season, footer_text1, footer_text2, footer_text3, name, description_short, description_long, season, footer_text1, footer_text2, footer_text3,
--div--;Bilder, image_header, image_teaser, image_offer', --div--;Bilder, image_header, image_teaser, image_offer',
], ],
], ],
'palettes' => [ 'palettes' => [
'configurator' => ['showitem' => 'configurator_type, configurator_distance'], 'configurator' => ['showitem' => 'configurator_type, configurator_distance'],
], ],
'columns' => [ 'columns' => [
'sys_language_uid' => [ 'sys_language_uid' => [
'exclude' => 1, 'exclude' => 1,
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.language', 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.language',
'config' => [ 'config' => [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'foreign_table' => 'sys_language', 'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY sys_language.title', 'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => [ 'items' => [
['LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1], ['LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1],
['LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.default_value', 0] ['LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.default_value', 0]
], ],
], ],
], ],
'l10n_parent' => [ 'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0', 'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1, 'exclude' => 1,
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
'config' => [ 'config' => [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [ 'items' => [
['', 0], ['', 0],
], ],
'foreign_table' => 'tx_epevents_domain_model_location', 'foreign_table' => 'tx_epevents_domain_model_location',
'foreign_table_where' => 'AND tx_epevents_domain_model_location.pid=###CURRENT_PID### AND tx_epevents_domain_model_location.sys_language_uid IN (-1,0)', 'foreign_table_where' => 'AND tx_epevents_domain_model_location.pid=###CURRENT_PID### AND tx_epevents_domain_model_location.sys_language_uid IN (-1,0)',
], ],
], ],
'l10n_diffsource' => [ 'l10n_diffsource' => [
'config' => [ 'config' => [
'type' => 'passthrough', 'type' => 'passthrough',
], ],
], ],
't3ver_label' => [ 't3ver_label' => [
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel', 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
'max' => 255, 'max' => 255,
] ]
], ],
'hidden' => [ 'hidden' => [
'exclude' => 1, 'exclude' => 1,
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.hidden', 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.hidden',
'config' => [ 'config' => [
'type' => 'check', 'type' => 'check',
], ],
], ],
'starttime' => [ 'starttime' => [
'exclude' => 1, 'exclude' => 1,
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 13, 'size' => 13,
'eval' => 'datetime', 'eval' => 'datetime',
'checkbox' => 0, 'checkbox' => 0,
'default' => 0, 'default' => 0,
'range' => [ 'range' => [
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y')) 'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
], ],
'behaviour' => [ 'behaviour' => [
'allowLanguageSynchronization' => true, 'allowLanguageSynchronization' => true,
@@ -104,17 +104,17 @@ return [
'renderType' => 'inputDateTime', 'renderType' => 'inputDateTime',
], ],
], ],
'endtime' => [ 'endtime' => [
'exclude' => 1, 'exclude' => 1,
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.endtime',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 13, 'size' => 13,
'eval' => 'datetime', 'eval' => 'datetime',
'checkbox' => 0, 'checkbox' => 0,
'default' => 0, 'default' => 0,
'range' => [ 'range' => [
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y')) 'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
], ],
'behaviour' => [ 'behaviour' => [
'allowLanguageSynchronization' => true, 'allowLanguageSynchronization' => true,
@@ -122,34 +122,34 @@ return [
'renderType' => 'inputDateTime', 'renderType' => 'inputDateTime',
], ],
], ],
'name' => [ 'name' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Bezeichnung', 'label' => 'Bezeichnung',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'input',
'size' => 30, 'size' => 30,
'eval' => 'trim' 'eval' => 'trim'
], ],
], ],
'description_short' => [ 'description_short' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Beschreibung kurz', 'label' => 'Beschreibung kurz',
'config' => [ 'config' => [
'type' => 'text', 'type' => 'text',
'cols' => 40, 'cols' => 40,
'rows' => 15, 'rows' => 15,
'eval' => 'trim', 'eval' => 'trim',
'enableRichtext' => true, 'enableRichtext' => true,
], ],
], ],
'description_long' => [ 'description_long' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Beschreibung lang', 'label' => 'Beschreibung lang',
'config' => [ 'config' => [
'type' => 'text', 'type' => 'text',
'cols' => 40, 'cols' => 40,
'rows' => 15, 'rows' => 15,
'eval' => 'trim', 'eval' => 'trim',
'enableRichtext' => true, 'enableRichtext' => true,
], ],
], ],
@@ -164,14 +164,14 @@ return [
'enableRichtext' => true, 'enableRichtext' => true,
], ],
], ],
'image_header' => [ 'image_header' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Bild Header', 'label' => 'Bild Header',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'image_header', 'image_header',
[ [
'appearance' => [ 'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference' 'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference'
], ],
'overrideChildTca' => [ 'overrideChildTca' => [
'types' => [ 'types' => [
@@ -182,19 +182,19 @@ return [
], ],
], ],
], ],
'maxitems' => 1 'maxitems' => 1
], ],
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
), ),
], ],
'image_teaser' => [ 'image_teaser' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Bild Teaser', 'label' => 'Bild Teaser',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'image_teaser', 'image_teaser',
[ [
'appearance' => [ 'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference' 'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference'
], ],
'overrideChildTca' => [ 'overrideChildTca' => [
'types' => [ 'types' => [
@@ -222,19 +222,19 @@ return [
], ],
], ],
], ],
'maxitems' => 1 'maxitems' => 1
], ],
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
), ),
], ],
'image_offer' => [ 'image_offer' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Bild Angebotsseite', 'label' => 'Bild Angebotsseite',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'image_offer', 'image_offer',
[ [
'appearance' => [ 'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference' 'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference'
], ],
'overrideChildTca' => [ 'overrideChildTca' => [
'types' => [ 'types' => [
@@ -245,41 +245,41 @@ return [
], ],
], ],
], ],
'maxitems' => 1 'maxitems' => 1
], ],
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
), ),
], ],
'footer_text1' => [ 'footer_text1' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Footer Text 1', 'label' => 'Footer Text 1',
'config' => [ 'config' => [
'type' => 'text', 'type' => 'text',
'cols' => 40, 'cols' => 40,
'rows' => 15, 'rows' => 15,
'eval' => 'trim', 'eval' => 'trim',
'enableRichtext' => true, 'enableRichtext' => true,
], ],
], ],
'footer_text2' => [ 'footer_text2' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Footer Text 2', 'label' => 'Footer Text 2',
'config' => [ 'config' => [
'type' => 'text', 'type' => 'text',
'cols' => 40, 'cols' => 40,
'rows' => 15, 'rows' => 15,
'eval' => 'trim', 'eval' => 'trim',
'enableRichtext' => true, 'enableRichtext' => true,
], ],
], ],
'footer_text3' => [ 'footer_text3' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Footer Text 3', 'label' => 'Footer Text 3',
'config' => [ 'config' => [
'type' => 'text', 'type' => 'text',
'cols' => 40, 'cols' => 40,
'rows' => 15, 'rows' => 15,
'eval' => 'trim', 'eval' => 'trim',
'enableRichtext' => true, 'enableRichtext' => true,
], ],
], ],
@@ -290,12 +290,12 @@ return [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [ 'items' => [
['Meer', 1], ['Meer', \EP\EpEvents\Domain\Model\Location::TYPE_SEA],
['Berge', 2], ['Berge', \EP\EpEvents\Domain\Model\Location::TYPE_MOUNTAINS],
['Städte', 3], ['Städte', \EP\EpEvents\Domain\Model\Location::TYPE_CITIES],
['Spezial', 4], ['Spezial', \EP\EpEvents\Domain\Model\Location::TYPE_SPECIAL],
], ],
'default' => 1, 'default' => \EP\EpEvents\Domain\Model\Location::TYPE_SEA,
'size' => 1, 'size' => 1,
'minitems' => 1, 'minitems' => 1,
'maxitems' => 1, 'maxitems' => 1,
@@ -310,9 +310,9 @@ return [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [ 'items' => [
[ 'Deutschland', \EP\EpEvents\Domain\Model\Location::DISTANCE_GERMANY ], ['Deutschland', \EP\EpEvents\Domain\Model\Location::DISTANCE_GERMANY],
[ 'Europa', \EP\EpEvents\Domain\Model\Location::DISTANCE_EUROPE ], ['Europa', \EP\EpEvents\Domain\Model\Location::DISTANCE_EUROPE],
[ 'Welt', \EP\EpEvents\Domain\Model\Location::DISTANCE_WORLD ], ['Welt', \EP\EpEvents\Domain\Model\Location::DISTANCE_WORLD],
] ]
], ],
], ],
@@ -408,12 +408,12 @@ return [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [ 'items' => [
['Incentive', 1], ['Incentive', \EP\EpEvents\Domain\Model\Traveltype::TYPE_INCENTIVE],
['Teambuilding', 2], ['Teambuilding', \EP\EpEvents\Domain\Model\Traveltype::TYPE_TEAMBUILDING],
['Meeting', 3], ['Meeting', \EP\EpEvents\Domain\Model\Traveltype::TYPE_MEETING],
['Corporate Event', 4], ['Corporate Event', \EP\EpEvents\Domain\Model\Traveltype::TYPE_CORPORATE_EVENT],
], ],
'default' => 1, 'default' => \EP\EpEvents\Domain\Model\Traveltype::TYPE_INCENTIVE,
'size' => 1, 'size' => 1,
'minitems' => 1, 'minitems' => 1,
'maxitems' => 1, 'maxitems' => 1,
@@ -279,12 +279,12 @@ return [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [ 'items' => [
['Incentive', 1], ['Incentive', \EP\EpEvents\Domain\Model\Traveltype::TYPE_INCENTIVE],
['Team Building', 2], ['Team Building', \EP\EpEvents\Domain\Model\Traveltype::TYPE_TEAMBUILDING],
['Meeting', 3], ['Meeting', \EP\EpEvents\Domain\Model\Traveltype::TYPE_MEETING],
['Corporate Event', 4], ['Corporate Event', \EP\EpEvents\Domain\Model\Traveltype::TYPE_CORPORATE_EVENT],
], ],
'default' => 1, 'default' => \EP\EpEvents\Domain\Model\Traveltype::TYPE_INCENTIVE,
'size' => 1, 'size' => 1,
'minitems' => 1, 'minitems' => 1,
'maxitems' => 1, 'maxitems' => 1,