From 53b0abd977122260e162cf956f1493775e976d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Uzna=C5=84ski?= Date: Mon, 27 Nov 2023 13:31:13 +0100 Subject: [PATCH] [FEATURE] Make records timeable and hidable (#989) Resolves: #553 --- CHANGELOG.md | 1 + .../TCA/tx_tea_domain_model_product_tea.php | 78 ++++++++++++++++++- .../Private/Language/de.locallang_db.xlf | 4 + Resources/Private/Language/locallang_db.xlf | 3 + 4 files changed, 85 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2579433..382f009 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## x.y.z ### Added +- Make records timeable and hideable (#989) - Add support for PHP 8.3 (#965) - Add an FE editor (#864, #872, #874, #876) - Add automerging of green Dependabot PRs (#756) diff --git a/Configuration/TCA/tx_tea_domain_model_product_tea.php b/Configuration/TCA/tx_tea_domain_model_product_tea.php index 49b4ac2..781270e 100644 --- a/Configuration/TCA/tx_tea_domain_model_product_tea.php +++ b/Configuration/TCA/tx_tea_domain_model_product_tea.php @@ -12,6 +12,9 @@ $tca = [ 'searchFields' => 'title, description', 'enablecolumns' => [ 'fe_group' => 'fe_group', + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime', ], 'transOrigPointerField' => 'l18n_parent', 'transOrigDiffSourceField' => 'l18n_diffsource', @@ -24,16 +27,67 @@ $tca = [ '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general, title, description, image, owner, --div--;LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea.tabs.access, + --palette--;;hidden, --palette--;;access,', ], ], 'palettes' => [ + 'hidden' => [ + 'showitem' => ' + hidden;LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea.hidden + ', + ], 'access' => [ 'label' => 'LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea.palettes.access', - 'showitem' => 'fe_group', + 'showitem' => ' + starttime;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:starttime_formlabel, + endtime;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:endtime_formlabel, + --linebreak--, + fe_group;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:fe_group_formlabel, + ', ], ], 'columns' => [ + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea.hidden', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'items' => [ + [ + 'label' => '', + 'invertStateDisplay' => true, + ], + ], + ], + ], + 'starttime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', + 'config' => [ + 'type' => 'datetime', + 'default' => 0, + 'range' => [ + 'upper' => mktime(0, 0, 0, 1, 1, 2038), + ], + ], + 'l10n_mode' => 'exclude', + 'l10n_display' => 'defaultAsReadonly', + ], + 'endtime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', + 'config' => [ + 'type' => 'datetime', + 'default' => 0, + 'range' => [ + 'upper' => mktime(0, 0, 0, 1, 1, 2038), + ], + ], + 'l10n_mode' => 'exclude', + 'l10n_display' => 'defaultAsReadonly', + ], 'sys_language_uid' => [ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', @@ -192,6 +246,28 @@ if ($typo3Version->getMajorVersion() < 12) { ] ), ]; + $tca['columns']['hidden']['config'] = [ + 'type' => 'check', + 'label' => 'LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea.hidden', + 'items' => [ + [ + 0 => '', + 'invertStateDisplay' => true, + ], + ], + ]; + $tca['columns']['starttime']['config'] = [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + ]; + $tca['columns']['endtime']['config'] = [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + ]; $tca['columns']['fe_group']['config']['items'] = [ [ 0 => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hide_at_login', diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf index 0750c98..939220c 100644 --- a/Resources/Private/Language/de.locallang_db.xlf +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -31,6 +31,10 @@ Usergroup Access Rights Zugriffsrechte für Benutzergruppen + + Visible + Sichtbar + diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index 1068b6e..de64197 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -24,6 +24,9 @@ Usergroup Access Rights + + Visible +