Skip to content

Commit

Permalink
Add video assists in fixtures #74
Browse files Browse the repository at this point in the history
  • Loading branch information
digedag committed Dec 9, 2023
1 parent b20961b commit a8ac269
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Änderungen
==========

## v1.11.7 (??.12.2023)
* Add fields for video assists (#74)

## v1.11.6 (09.12.2023)
* Support for CSP-Headers in TYPO3 12

Expand Down
16 changes: 16 additions & 0 deletions Classes/Model/Repository/ProfileRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace System25\T3sports\Model\Repository;

use Sys25\RnBase\Domain\Repository\PersistenceRepository;
use Sys25\RnBase\Search\SearchBase;
use System25\T3sports\Model\MatchNote;
use System25\T3sports\Model\Profile;
use System25\T3sports\Search\ProfileSearch;
Expand Down Expand Up @@ -44,6 +45,21 @@ public function getSearchClass()
return ProfileSearch::class;
}

/**
*
* @return Collection<Profile>
*/
public function findByFixtureRelation(int $fixtureUid, string $fieldName)
{
$fields = $options = [];
$fields['PROFILEMM.UID_FOREIGN'][OP_EQ_INT] = $fixtureUid;
$fields['PROFILEMM.TABLENAMES'][OP_EQ] = 'tx_cfcleague_games';
$fields['PROFILEMM.FIELDNAME'][OP_EQ] = $fieldName;
$options['orderby']['PROFILEMM.SORTING_FOREIGN'] = 'asc';

return $this->search($fields, $options);
}

/**
* @param string $uids
*
Expand Down
7 changes: 6 additions & 1 deletion Classes/Search/ProfileSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/***************************************************************
* Copyright notice
*
* (c) 2006-2021 Rene Nitzsche
* (c) 2006-2023 Rene Nitzsche
* Contact: [email protected]
* All rights reserved
*
Expand Down Expand Up @@ -40,6 +40,7 @@ protected function getTableMappings()
{
$tableMapping = [
'PROFILE' => 'tx_cfcleague_profiles',
'PROFILEMM' => 'tx_cfcleague_profiles_mm',
'TEAM' => 'tx_cfcleague_teams',
'TEAMNOTE' => 'tx_cfcleague_team_notes',
];
Expand Down Expand Up @@ -72,6 +73,10 @@ protected function getJoins($tableAliases)
if (isset($tableAliases['TEAM'])) {
$join[] = new Join('PROFILE', 'tx_cfcleague_teams', 'FIND_IN_SET(PROFILE.uid, TEAM.players)', 'TEAM');
}
if (isset($tableAliases['PROFILEMM'])) {
$join[] = new Join('PROFILE', 'tx_cfcleague_profiles_mm', 'PROFILE.uid = PROFILEMM.uid_local', 'PROFILEMM');
}

if (isset($tableAliases['TEAMNOTE'])) {
$join[] = new Join('PROFILE', 'tx_cfcleague_team_notes', 'PROFILE.uid = TEAMNOTE.player', 'TEAMNOTE');
}
Expand Down
27 changes: 24 additions & 3 deletions Configuration/TCA/tx_cfcleague_games.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
'default' => 0,
'minitems' => 0,
'maxitems' => 1,
'wizards' => Tx_Rnbase_Utility_TcaTool::getWizards('tx_cfcleague_profiles', [
'wizards' => Sys25\RnBase\Backend\Utility\TcaTool::getWizards('tx_cfcleague_profiles', [
'suggest' => true,
]),
],
Expand All @@ -367,11 +367,32 @@
'size' => 3,
'minitems' => 0,
'maxitems' => 5,
'wizards' => Tx_Rnbase_Utility_TcaTool::getWizards('tx_cfcleague_profiles', [
'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',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'tx_cfcleague_profiles',
'size' => 5,
'selectedListStyle' => 'width: 450px;',
'autoSizeMax' => 10,
'minitems' => 0,
'maxitems' => 10,
'MM' => 'tx_cfcleague_profiles_mm',
'MM_foreign_select' => 1,
'MM_opposite_field' => 'relitems',
'MM_match_fields' => [
'tablenames' => 'tx_cfcleague_games',
'fieldname' => 'videoassists',
],
],
],

'goals_home_1' => [
'exclude' => 1,
Expand Down Expand Up @@ -674,7 +695,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,
--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_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 Down
2 changes: 1 addition & 1 deletion Configuration/TCA/tx_cfcleague_profiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
'label' => 'LLL:EXT:cfc_league/Resources/Private/Language/locallang_db.xlf:tx_cfcleague_profiles.duration_of_contract',
'config' => [
'type' => 'input',
'renderType' => (\Sys25\RnBase\Utility\TYPO3::isTYPO86OrHigher() ? 'inputDateTime' : ''),
'renderType' => 'inputDateTime',
'size' => '8',
'eval' => 'date',
'checkbox' => '0',
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.videoassists" xml:space="preserve">
<source>Video-Assists</source>
<target>Video-Assists</target>
</trans-unit>
<trans-unit id="tx_cfcleague_games.parts_4_default" xml:space="preserve">
<source>Quarter</source>
<target>Viertel</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.videoassists" xml:space="preserve">
<source>Video-Assists</source>
</trans-unit>
<trans-unit id="tx_cfcleague_games.parts_4_default" xml:space="preserve">
<source>Quarter</source>
</trans-unit>
Expand Down
19 changes: 18 additions & 1 deletion 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,
videoassists int(11) DEFAULT '0' NOT NULL,
coach_home int(11) DEFAULT '0' NOT NULL,
coach_guest int(11) DEFAULT '0' NOT NULL,
players_home text,
Expand Down Expand Up @@ -309,7 +310,8 @@ CREATE TABLE tx_cfcleague_profiles (
description text,
types varchar(150) DEFAULT '' NOT NULL,
extid varchar(255) DEFAULT '' NOT NULL,

relitems int(11) DEFAULT '0' NOT NULL,

PRIMARY KEY (uid),
KEY parent (pid)
);
Expand All @@ -328,6 +330,21 @@ CREATE TABLE tx_cfcleague_profiletypes_mm (
KEY uid_foreign (uid_foreign)
);

#
# Table structure for table 'tx_cfcleague_profiletypes_mm'
# uid_local used for fixture
#
CREATE TABLE tx_cfcleague_profiles_mm (
uid_local int(11) unsigned DEFAULT '0' NOT NULL,
uid_foreign int(11) unsigned DEFAULT '0' NOT NULL,
tablenames varchar(50) DEFAULT '' NOT NULL,
fieldname varchar(50) DEFAULT '' NOT NULL,
sorting int(11) unsigned DEFAULT '0' NOT NULL,
sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL,
KEY uid_local (uid_local),
KEY uid_foreign (uid_foreign)
);

#
# Table structure for table 'tx_cfcleague_saison'
#
Expand Down

0 comments on commit a8ac269

Please sign in to comment.