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