From 8d3063798722d056f115d881857729e54af89c44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Nitzsche?= Date: Sun, 10 Dec 2023 21:08:41 +0100 Subject: [PATCH] Add video referee in fixtures digedag/cfc_league#74 --- Classes/Model/Fixture.php | 19 ++++++++++++++++-- Configuration/TCA/tx_cfcleague_games.php | 20 ++++++++++++++++++- .../Private/Language/de.locallang_db.xlf | 4 ++++ Resources/Private/Language/locallang_db.xlf | 3 +++ ext_tables.sql | 1 + 5 files changed, 44 insertions(+), 3 deletions(-) diff --git a/Classes/Model/Fixture.php b/Classes/Model/Fixture.php index 8c07f04..016f90d 100644 --- a/Classes/Model/Fixture.php +++ b/Classes/Model/Fixture.php @@ -478,9 +478,24 @@ public function getStadium() */ public function getReferee() { - if ($this->getProperty('referee')) { + return $this->getProfile('referee'); + } + + /** + * Liefert den Referee als Datenobjekt. + * + * @return Profile + */ + public function getVideoReferee() + { + return $this->getProfile('videoreferee'); + } + + private function getProfile(string $attr) + { + if ($this->getProperty($attr)) { try { - $profile = Profile::getProfileInstance($this->getProperty('referee')); + $profile = Profile::getProfileInstance($this->getProperty($attr)); return $profile->isValid() ? $profile : null; } catch (Exception $e) { diff --git a/Configuration/TCA/tx_cfcleague_games.php b/Configuration/TCA/tx_cfcleague_games.php index ae648dc..bf01a7f 100644 --- a/Configuration/TCA/tx_cfcleague_games.php +++ b/Configuration/TCA/tx_cfcleague_games.php @@ -372,6 +372,22 @@ ]), ], ], + 'videoreferee' => [ + 'exclude' => 1, + 'label' => 'LLL:EXT:cfc_league/Resources/Private/Language/locallang_db.xlf:tx_cfcleague_games.videoreferee', + 'config' => [ + 'type' => 'group', + 'internal_type' => 'db', + 'allowed' => 'tx_cfcleague_profiles', + 'size' => 1, + 'default' => 0, + 'minitems' => 0, + 'maxitems' => 1, + 'wizards' => Sys25\RnBase\Backend\Utility\TcaTool::getWizards('tx_cfcleague_profiles', [ + 'suggest' => true, + ]), + ], + ], 'videoassists' => [ 'exclude' => 1, 'label' => 'LLL:EXT:cfc_league/Resources/Private/Language/locallang_db.xlf:tx_cfcleague_games.videoassists', @@ -695,7 +711,7 @@ // goals_home_1, goals_guest_1, goals_home_2, goals_guest_2, '0' => [ 'showitem' => 'hidden,match_no,competition,home,guest,round,round_name,date,addinfo,status,--palette--;;6,sets,arena,stadium,visitors,extid, - --div--;LLL:EXT:cfc_league/Resources/Private/Language/locallang_db.xlf:tx_cfcleague_games.tab_lineup,coach_home, players_home, substitutes_home, system_home, system_guest, coach_guest, players_guest, substitutes_guest, referee, assists, videoassists, + --div--;LLL:EXT:cfc_league/Resources/Private/Language/locallang_db.xlf:tx_cfcleague_games.tab_lineup,coach_home, players_home, substitutes_home, system_home, system_guest, coach_guest, players_guest, substitutes_guest, referee, assists, videoreferee, videoassists, --div--;LLL:EXT:cfc_league/Resources/Private/Language/locallang_db.xlf:tx_cfcleague_games.tab_lineup_stat,players_home_stat, substitutes_home_stat, players_guest_stat, substitutes_guest_stat, scorer_home_stat, scorer_guest_stat, --div--;LLL:EXT:cfc_league/Resources/Private/Language/locallang_db.xlf:tx_cfcleague_games.tab_score, is_extratime,--palette--;;2, is_penalty,--palette--;;3, --div--;LLL:EXT:cfc_league/Resources/Private/Language/locallang_db.xlf:tx_cfcleague_games.game_report, game_report,--palette--;;4, game_report_author,--palette--;;5, t3images, dam_media, dam_media2, video, videoimg', @@ -719,6 +735,8 @@ 'game_report' => ['RTE' => ['defaultExtras' => $rteConfig]], 'referee' => ['targettable' => 'tx_cfcleague_profiles', 'suggest' => true], 'assists' => ['targettable' => 'tx_cfcleague_profiles', 'suggest' => true], + 'videoreferee' => ['targettable' => 'tx_cfcleague_profiles', 'suggest' => true], + 'videoassists' => ['targettable' => 'tx_cfcleague_profiles', 'suggest' => true], ]); $tx_cfcleague_games['columns']['t3images'] = \Sys25\RnBase\Utility\TSFAL::getMediaTCA('t3images', [ diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf index 89ef756..c2a9f0e 100644 --- a/Resources/Private/Language/de.locallang_db.xlf +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -511,6 +511,10 @@ Assists Linienrichter + + Video-Referee + Video-Schiedsrichter + Video-Assists Video-Assists diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index 7ac97c7..308e666 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -384,6 +384,9 @@ Assists + + Video-Referee + Video-Assists diff --git a/ext_tables.sql b/ext_tables.sql index cd3009b..5977759 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -224,6 +224,7 @@ CREATE TABLE tx_cfcleague_games ( referee int(11) DEFAULT '0' NOT NULL, assists text, + videoreferee int(11) DEFAULT '0' NOT NULL, videoassists int(11) DEFAULT '0' NOT NULL, coach_home int(11) DEFAULT '0' NOT NULL, coach_guest int(11) DEFAULT '0' NOT NULL,