Skip to content

Commit

Permalink
Add video referee in fixtures #74
Browse files Browse the repository at this point in the history
  • Loading branch information
digedag committed Dec 10, 2023
1 parent 03be092 commit 8d30637
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 3 deletions.
19 changes: 17 additions & 2 deletions Classes/Model/Fixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
20 changes: 19 additions & 1 deletion Configuration/TCA/tx_cfcleague_games.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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', [
Expand Down
4 changes: 4 additions & 0 deletions Resources/Private/Language/de.locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,10 @@
<source>Assists</source>
<target>Linienrichter</target>
</trans-unit>
<trans-unit id="tx_cfcleague_games.videoreferee" xml:space="preserve">
<source>Video-Referee</source>
<target>Video-Schiedsrichter</target>
</trans-unit>
<trans-unit id="tx_cfcleague_games.videoassists" xml:space="preserve">
<source>Video-Assists</source>
<target>Video-Assists</target>
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Language/locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@
<trans-unit id="tx_cfcleague_games.assists" xml:space="preserve">
<source>Assists</source>
</trans-unit>
<trans-unit id="tx_cfcleague_games.videoreferee" xml:space="preserve">
<source>Video-Referee</source>
</trans-unit>
<trans-unit id="tx_cfcleague_games.videoassists" xml:space="preserve">
<source>Video-Assists</source>
</trans-unit>
Expand Down
1 change: 1 addition & 0 deletions ext_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8d30637

Please sign in to comment.