Skip to content

Commit

Permalink
#99 Add judo as sports
Browse files Browse the repository at this point in the history
  • Loading branch information
digedag committed Mar 11, 2024
1 parent dd6b356 commit ea3bb72
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 33 deletions.
12 changes: 6 additions & 6 deletions Classes/Controller/Competition/MatchEdit.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ private function getHeadline($parts, $competition)
if ($sports->isSetBased()) {
$arr[] = $LANG->getLL('tx_cfcleague_games_sets');
}
if ($sports->hasPoints()) {
$arr[] = $LANG->getLL(sprintf('tx_cfcleague_games_%s_points_home', $sports->getIdentifier()));
$arr[] = $LANG->getLL(sprintf('tx_cfcleague_games_%s_points_guest', $sports->getIdentifier()));
if ($sports->hasScore()) {
$arr[] = $LANG->getLL(sprintf('tx_cfcleague_games_%s_score_home', $sports->getIdentifier()));
$arr[] = $LANG->getLL(sprintf('tx_cfcleague_games_%s_score_guest', $sports->getIdentifier()));
}

$arr[] = $LANG->getLL('tx_cfcleague_games.visitors');
Expand Down Expand Up @@ -357,9 +357,9 @@ private function createTableArray($matches, $competition)
if ($sports->isSetBased()) {
$row[] = $this->formTool->createTxtInput('data[tx_cfcleague_games]['.$matchUid.'][sets]', $match->getProperty('sets'), 12);
}
if ($sports->hasPoints()) {
$row[] = $this->formTool->createTxtInput('data[tx_cfcleague_games]['.$matchUid.'][points_home]', $match->getProperty('points_home'), 6);
$row[] = $this->formTool->createTxtInput('data[tx_cfcleague_games]['.$matchUid.'][points_guest]', $match->getProperty('points_guest'), 6);
if ($sports->hasScore()) {
$row[] = $this->formTool->createTxtInput('data[tx_cfcleague_games]['.$matchUid.'][score_home]', $match->getProperty('score_home'), 6);
$row[] = $this->formTool->createTxtInput('data[tx_cfcleague_games]['.$matchUid.'][score_guest]', $match->getProperty('score_guest'), 6);
}

$row[] = $this->formTool->createIntInput('data[tx_cfcleague_games]['.$matchUid.'][visitors]', $match->getProperty('visitors'), 6);
Expand Down
12 changes: 11 additions & 1 deletion Classes/Model/Fixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/***************************************************************
* Copyright notice
*
* (c) 2007-2023 Rene Nitzsche ([email protected])
* (c) 2007-2027 Rene Nitzsche ([email protected])
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
Expand Down Expand Up @@ -91,6 +91,16 @@ public function getGoalsGuest($matchPart = '')
return $ret;
}

public function getScoreHome(): int
{
return (int) $this->getProperty('score_home');
}

public function getScoreGuest(): int
{
return (int) $this->getProperty('score_guest');
}

/**
* Liefert den TOTO-Wert des Spiels.
* Als 0 für ein Unentschieden, 1 für einen Heim-
Expand Down
2 changes: 1 addition & 1 deletion Classes/Sports/Football.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function isSetBased(): bool
return false;
}

public function hasPoints(): bool
public function hasScore(): bool
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Sports/Handball.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function isSetBased(): bool
return false;
}

public function hasPoints(): bool
public function hasScore(): bool
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Sports/ISports.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getTCALabel();
*/
public function isSetBased(): bool;

public function hasPoints(): bool;
public function hasScore(): bool;

/**
* @return MatchInfo
Expand Down
2 changes: 1 addition & 1 deletion Classes/Sports/IceHockey.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function isSetBased(): bool
return false;
}

public function hasPoints(): bool
public function hasScore(): bool
{
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/Sports/Judo.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function isSetBased(): bool
return false;
}

public function hasPoints(): bool
public function hasScore(): bool
{
return true;
}
Expand All @@ -81,7 +81,7 @@ public function getMatchInfo()
if (null === $this->matchInfo) {
$this->matchInfo = tx_rnbase::makeInstance('MatchInfo', [
MatchInfo::MATCH_TIME => 60,
MatchInfo::MATCH_PARTS => 2,
MatchInfo::MATCH_PARTS => 1,
MatchInfo::MATCH_EXTRA_TIME => 10,
]);
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Sports/Volleyball.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function isSetBased(): bool
return true;
}

public function hasPoints(): bool
public function hasScore(): bool
{
return false;
}
Expand Down
14 changes: 7 additions & 7 deletions Configuration/TCA/tx_cfcleague_games.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
],
'interface' => [
'showRecordFieldList' => 'hidden,home,guest,competition,round,round_name,status, goals_home_1,goals_guest_1,
goals_home_2,goals_guest_2,goals_home_3,goals_guest_3,goals_home_4,goals_guest_4,points_home,points_guest,date,
goals_home_2,goals_guest_2,goals_home_3,goals_guest_3,goals_home_4,goals_guest_4,score_home,score_guest,date,
game_report,visitors,t3images,goals_home_et,goals_guest_et,goals_home_ap,goals_guest_ap',
'maxDBListItems' => '5',
],
'feInterface' => [
'fe_admin_fieldList' => 'hidden, home, guest, competition, round, round_name, status, coach_home,
coach_guest, players_home, players_guest, substitutes_home, substitutes_guest, goals_home_1,
goals_guest_1, goals_home_2, goals_guest_2, goals_home_3, goals_guest_3, goals_home_4, goals_guest_4,points_home,points_guest,
goals_guest_1, goals_home_2, goals_guest_2, goals_home_3, goals_guest_3, goals_home_4, goals_guest_4,score_home,score_guest,
date, link_report, link_ticker, game_report, visitors, goals_home_et, goals_guest_et, goals_home_ap,
goals_guest_ap',
],
Expand Down Expand Up @@ -531,9 +531,9 @@
'default' => 0,
],
],
'points_home' => [
'score_home' => [
'exclude' => 1,
'label' => 'LLL:EXT:cfc_league/Resources/Private/Language/locallang_db.xlf:tx_cfcleague_games.points_home',
'label' => 'LLL:EXT:cfc_league/Resources/Private/Language/locallang_db.xlf:tx_cfcleague_games.score_home',
'config' => [
'type' => 'input',
'size' => '4',
Expand All @@ -546,9 +546,9 @@
'default' => 0,
],
],
'points_guest' => [
'score_guest' => [
'exclude' => 1,
'label' => 'LLL:EXT:cfc_league/Resources/Private/Language/locallang_db.xlf:tx_cfcleague_games.points_guest',
'label' => 'LLL:EXT:cfc_league/Resources/Private/Language/locallang_db.xlf:tx_cfcleague_games.score_guest',
'config' => [
'type' => 'input',
'size' => '4',
Expand Down Expand Up @@ -753,7 +753,7 @@
'4' => ['showitem' => 'link_report, link_ticker'],
'5' => ['showitem' => 'liveticker_author'],
'6' => ['showitem' => 'goals_home_2, goals_guest_2, goals_home_1, goals_guest_1'],
'7' => ['showitem' => 'points_home, points_guest'],
'7' => ['showitem' => 'score_home, score_guest'],
],
];

Expand Down
12 changes: 6 additions & 6 deletions Resources/Private/Language/de.locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -588,21 +588,21 @@
<target/>
</trans-unit>

<trans-unit id="tx_cfcleague_games.points_home" xml:space="preserve">
<trans-unit id="tx_cfcleague_games.score_home" xml:space="preserve">
<source>Sub-Score Home</source>
<target>Unterbewertung Heim</target>
</trans-unit>
<trans-unit id="tx_cfcleague_games.points_guest" xml:space="preserve">
<trans-unit id="tx_cfcleague_games.score_guest" xml:space="preserve">
<source>Sub-Score Guest</source>
<target>Unterbewertung Gast</target>
</trans-unit>
<trans-unit id="tx_cfcleague_games_judo_points_home" xml:space="preserve">
<trans-unit id="tx_cfcleague_games_judo_score_home" xml:space="preserve">
<source>Sub-Score Home</source>
<target>Unterbewertung Heim</target>
<target>Wertungen Heim</target>
</trans-unit>
<trans-unit id="tx_cfcleague_games_judo_points_guest" xml:space="preserve">
<trans-unit id="tx_cfcleague_games_judo_score_guest" xml:space="preserve">
<source>Sub-Score Guest</source>
<target>Unterbewertung Gast</target>
<target>Wertungen Gast</target>
</trans-unit>

<trans-unit id="tx_cfcleague_games.date" xml:space="preserve">
Expand Down
8 changes: 4 additions & 4 deletions Resources/Private/Language/locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -442,16 +442,16 @@
<source>Goals Guest Part 4</source>
</trans-unit>

<trans-unit id="tx_cfcleague_games.points_home" xml:space="preserve">
<trans-unit id="tx_cfcleague_games.score_home" xml:space="preserve">
<source>Sub-Score Home</source>
</trans-unit>
<trans-unit id="tx_cfcleague_games.points_guest" xml:space="preserve">
<trans-unit id="tx_cfcleague_games.score_guest" xml:space="preserve">
<source>Sub-Score Guest</source>
</trans-unit>
<trans-unit id="tx_cfcleague_games_judo_points_home" xml:space="preserve">
<trans-unit id="tx_cfcleague_games_judo_score_home" xml:space="preserve">
<source>Sub-Score Home</source>
</trans-unit>
<trans-unit id="tx_cfcleague_games_judo_points_guest" xml:space="preserve">
<trans-unit id="tx_cfcleague_games_judo_score_guest" xml:space="preserve">
<source>Sub-Score Guest</source>
</trans-unit>

Expand Down
4 changes: 2 additions & 2 deletions ext_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ CREATE TABLE tx_cfcleague_games (
goals_guest_3 int(11) DEFAULT '0' NOT NULL,
goals_home_4 int(11) DEFAULT '0' NOT NULL,
goals_guest_4 int(11) DEFAULT '0' NOT NULL,
points_home int(11) DEFAULT '0' NOT NULL,
points_guest int(11) DEFAULT '0' NOT NULL,
score_home int(11) DEFAULT '0' NOT NULL,
score_guest int(11) DEFAULT '0' NOT NULL,

date int(11) DEFAULT '0' NOT NULL,
link_report tinyint(4) DEFAULT '0' NOT NULL,
Expand Down

0 comments on commit ea3bb72

Please sign in to comment.