From d1fcbb19af11f0fb683119802f9e4a0c915ab1a3 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Thu, 26 Aug 2021 12:13:47 +0200 Subject: [PATCH] Add `Tea.internalNotes` and break XLIFF, PHP < 7.4, and the sniffer --- Classes/Domain/Model/Product/Tea.php | 12 +++++++++++- .../TCA/tx_tea_domain_model_product_tea.php | 12 +++++++++++- Resources/Private/Language/de.locallang_db.xlf | 4 ++++ Resources/Private/Language/locallang_db.xlf | 3 +++ ext_tables.sql | 1 + 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Classes/Domain/Model/Product/Tea.php b/Classes/Domain/Model/Product/Tea.php index 9060a55..4c13b77 100644 --- a/Classes/Domain/Model/Product/Tea.php +++ b/Classes/Domain/Model/Product/Tea.php @@ -25,7 +25,9 @@ class Tea extends AbstractEntity */ protected string $description = ''; - /** + private string $internalNotes; + + /** * @var FileReference|null * @phpstan-var FileReference|LazyLoadingProxy|null * @Extbase\ORM\Lazy @@ -59,6 +61,14 @@ class Tea extends AbstractEntity $this->description = $description; } + public function getInternalNotes(): string { + return $this->internalNotes; + } + + public function setInternalNotes(string $notes): void { + $this->internalNotes = $notes; + } + public function getImage(): ?FileReference { if ($this->image instanceof LazyLoadingProxy) { diff --git a/Configuration/TCA/tx_tea_domain_model_product_tea.php b/Configuration/TCA/tx_tea_domain_model_product_tea.php index 781270e..f707442 100644 --- a/Configuration/TCA/tx_tea_domain_model_product_tea.php +++ b/Configuration/TCA/tx_tea_domain_model_product_tea.php @@ -25,7 +25,7 @@ $tca = [ '1' => [ 'showitem' => '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general, - title, description, image, owner, + title, description, internalNotes, image, owner, --div--;LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea.tabs.access, --palette--;;hidden, --palette--;;access,', @@ -146,6 +146,16 @@ $tca = [ 'eval' => 'trim', ], ], + 'internalNotes' => [ + 'label' => 'LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea.internalNotes', + 'config' => [ + 'type' => 'text', + 'rows' => 8, + 'cols' => 40, + 'max' => 2000, + 'eval' => 'trim', + ], + ], 'image' => [ 'label' => 'LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea.image', 'config' => [ diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf index 939220c..b1ed6bb 100644 --- a/Resources/Private/Language/de.locallang_db.xlf +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -19,6 +19,10 @@ Description Beschreibung + + Internal notes + Interne Notizen + Image Bild diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index de64197..077c04a 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -15,6 +15,9 @@ Description + + Internal notes + Image diff --git a/ext_tables.sql b/ext_tables.sql index d013de3..388f539 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -1,6 +1,7 @@ CREATE TABLE tx_tea_domain_model_product_tea ( title varchar(255) DEFAULT '' NOT NULL, description varchar(2000) DEFAULT '' NOT NULL, + internalNotes varchar(2000) DEFAULT '' NOT NULL, image int(11) unsigned DEFAULT '0' NOT NULL, owner int(11) unsigned DEFAULT '0' NOT NULL,