Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
digedag committed Jan 6, 2024
2 parents 8c241c3 + ddbb1bb commit a0ee898
Show file tree
Hide file tree
Showing 14 changed files with 127 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Changes
-------

v1.11.3 (??.12.2023)
* Add video assists to fixtures
* Add option for sort order in match table view

v1.11.2 (09.12.2023)
* Fix statistics view
* Fix rendering of empty profile lists
Expand Down
5 changes: 5 additions & 0 deletions Classes/Filter/MatchFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Sys25\RnBase\Frontend\Marker\Templates;
use Sys25\RnBase\Frontend\Request\RequestInterface;
use Sys25\RnBase\Utility\Misc;
use Sys25\RnBase\Utility\Strings;
use System25\T3sports\Model\Profile;
use System25\T3sports\Utility\MatchTableBuilder;
use System25\T3sports\Utility\ScopeController;
Expand Down Expand Up @@ -59,6 +60,10 @@ protected function initFilter(&$fields, &$options, RequestInterface $request)
$teamId = $parameters->get('teamId');
}

if (!is_array($options['orderby'] ?? null) && $orderby = $options['orderby']) {
list($key, $value) = Strings::trimExplode('=', $orderby);
$options['orderby'] = [$key => $value];
}
$matchtable = new MatchTableBuilder();
$matchtable->setScope($scopeArr);
$matchtable->setTeams($teamId);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Frontend/Action/MatchTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/***************************************************************
* Copyright notice
*
* (c) 2007-2017 Rene Nitzsche (rene@system25.de)
* (c) 2007-2023 Rene Nitzsche (rene@system25.de)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
Expand Down
4 changes: 3 additions & 1 deletion Classes/Frontend/Marker/MatchMarker.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private function prepareFields($match, $formatter, $confId)
$match->setProperty('pictures', $match->getProperty('dam_images'));
$match->setProperty('firstpicture', $match->getProperty('dam_images'));

/* @var $report MatchReport */
/** @var MatchReport $report */
$report = $match->getMatchReport();
if (!is_object($report)) {
return;
Expand All @@ -258,6 +258,8 @@ private function prepareFields($match, $formatter, $confId)
$match->setProperty('coachnames_guest', $report->getCoachNameGuest('matchreport.coachnames.'));
$match->setProperty('refereenames', $report->getRefereeName('matchreport.refereenames.'));
$match->setProperty('assistsnames', $report->getAssistNames('matchreport.assistsnames.'));
$match->setProperty('videorefereename', $report->getVideoRefereeName('matchreport.videorefereename.'));
$match->setProperty('videoassistsnames', $report->getVideoAssistNames('matchreport.videoassistsnames.'));
}

/**
Expand Down
20 changes: 19 additions & 1 deletion Classes/Model/MatchReportModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace System25\T3sports\Model;

use Sys25\RnBase\Configuration\ConfigurationInterface;
use Sys25\RnBase\Domain\Model\DataInterface;
use Sys25\RnBase\Utility\Strings;
use Sys25\RnBase\Utility\T3General;
use System25\T3sports\Decorator\MatchNoteDecorator;
Expand Down Expand Up @@ -284,6 +285,23 @@ public function getAssistNames($confId = 'matchreport.assists.')
return $this->_getNames2($this->matchProfileProvider->getProfiles($this->match, $this->match->getAssists()), $confId);
}

/**
* Liefert den Namen des Schiedsrichters.
*/
public function getVideoRefereeName($confId = 'matchreport.videoreferee.')
{
// der Schiedsrichter wird schon als Instanz geliefert.
return $this->_getNames2($this->match->getVideoReferee(), $confId);
}

/**
* Liefert die Namen der Linienrichters.
*/
public function getVideoAssistNames($confId = 'matchreport.videoassists.')
{
return $this->_getNames2($this->matchProfileProvider->getVideoAssists($this->match), $confId);
}

/**
* Liefert den Namen des Heimtrainers.
*/
Expand Down Expand Up @@ -514,7 +532,7 @@ protected function _getNames2($profiles, $confIdAll)
protected function _wrapProfiles($profiles, $confId)
{
$ret = [];
if (!is_array($profiles)) {
if ($profiles instanceof DataInterface || !is_iterable($profiles)) {
if (!is_object($profiles)) {
return [];
}
Expand Down
4 changes: 4 additions & 0 deletions Classes/Table/Volleyball/Comparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
/***************************************************************
* Copyright notice
*
<<<<<<< HEAD
* (c) 2011-2024 Rene Nitzsche (rene@system25.de)
=======
* (c) 2011-2023 Rene Nitzsche (rene@system25.de)
>>>>>>> master
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
Expand Down
2 changes: 1 addition & 1 deletion Classes/Table/Volleyball/Comparator3Point.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/***************************************************************
* Copyright notice
*
* (c) 2013-2020 Rene Nitzsche (rene@system25.de)
* (c) 2013-2023 Rene Nitzsche (rene@system25.de)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
Expand Down
5 changes: 5 additions & 0 deletions Classes/Utility/MatchProfileProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public function __construct(ProfileRepository $profileRepo = null)
$this->profileRepo = $profileRepo ?: new ProfileRepository();
}

public function getVideoAssists(Fixture $match)
{
return $this->profileRepo->findByFixtureRelation($match->getUid(), 'videoassists');
}

/**
* Liefert die Spieler eines Spiels.
*
Expand Down
32 changes: 32 additions & 0 deletions Configuration/Flexform/plugin_competition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,38 @@
</config>
</TCEforms>
</matchtable.options.limit>
<matchtable.options.orderby>
<TCEforms>
<exclude>1</exclude>
<label>LLL:EXT:cfc_league_fe/Resources/Private/Language/locallang_db.xlf:plugin.competition.flexform.matchtable.orderby
</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:cfc_league_fe/Resources/Private/Language/locallang_db.xlf:plugin.competition.flexform.matchtable.orderby.typoscript</numIndex>
<numIndex index="1"></numIndex>
</numIndex>
<numIndex index="5" type="array">
<numIndex index="0">LLL:EXT:cfc_league_fe/Resources/Private/Language/locallang_db.xlf:plugin.competition.flexform.matchtable.orderby.date.desc</numIndex>
<numIndex index="1">MATCH.DATE=desc</numIndex>
</numIndex>
<numIndex index="6" type="array">
<numIndex index="0">LLL:EXT:cfc_league_fe/Resources/Private/Language/locallang_db.xlf:plugin.competition.flexform.matchtable.orderby.date.asc</numIndex>
<numIndex index="1">MATCH.DATE=asc</numIndex>
</numIndex>
<numIndex index="10" type="array">
<numIndex index="0">LLL:EXT:cfc_league_fe/Resources/Private/Language/locallang_db.xlf:plugin.competition.flexform.matchtable.orderby.number.asc</numIndex>
<numIndex index="1">MATCH.MATCH_NO=asc</numIndex>
</numIndex>
</items>
<multiple>0</multiple>
<maxitems>1</maxitems>
<size>1</size>
</config>
</TCEforms>
</matchtable.options.orderby>

<matchtable.timeRangePast>
<TCEforms>
Expand Down
20 changes: 20 additions & 0 deletions Resources/Private/Language/de.locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,26 @@
<source>Max matches to show</source>
<target>Max. Anzahl Spiele</target>
</trans-unit>
<trans-unit id="plugin.competition.flexform.matchtable.orderby" xml:space="preserve">
<source>Sort order of matches</source>
<target>Sortierung der Spiele</target>
</trans-unit>
<trans-unit id="plugin.competition.flexform.matchtable.orderby.typoscript" xml:space="preserve">
<source>As configured by typoscript</source>
<target>Per Typoscript konfiguriert</target>
</trans-unit>
<trans-unit id="plugin.competition.flexform.matchtable.orderby.date.asc" xml:space="preserve">
<source>Kickoff date ascending</source>
<target>Spielbeginn ansteigend</target>
</trans-unit>
<trans-unit id="plugin.competition.flexform.matchtable.orderby.date.desc" xml:space="preserve">
<source>Kickoff date descending</source>
<target>Spielbeginn absteigend</target>
</trans-unit>
<trans-unit id="plugin.competition.flexform.matchtable.orderby.number.desc" xml:space="preserve">
<source>Fixture number ascending</source>
<target>Spielnummer ansteigend</target>
</trans-unit>
<trans-unit id="plugin.competition.flexform.matchtable.report_page" xml:space="preserve">
<source>Page for report</source>
<target>Seite für Spielbericht</target>
Expand Down
15 changes: 15 additions & 0 deletions Resources/Private/Language/locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,21 @@
<trans-unit id="plugin.competition.flexform.matchtable.limit" xml:space="preserve">
<source>Max matches to show</source>
</trans-unit>
<trans-unit id="plugin.competition.flexform.matchtable.orderby" xml:space="preserve">
<source>Sort order of matches</source>
</trans-unit>
<trans-unit id="plugin.competition.flexform.matchtable.orderby.typoscript" xml:space="preserve">
<source>As configured by typoscript</source>
</trans-unit>
<trans-unit id="plugin.competition.flexform.matchtable.orderby.date.asc" xml:space="preserve">
<source>Kickoff date ascending</source>
</trans-unit>
<trans-unit id="plugin.competition.flexform.matchtable.orderby.date.desc" xml:space="preserve">
<source>Kickoff date descending</source>
</trans-unit>
<trans-unit id="plugin.competition.flexform.matchtable.orderby.number.desc" xml:space="preserve">
<source>Fixture number ascending</source>
</trans-unit>
<trans-unit id="plugin.competition.flexform.matchtable.report_page" xml:space="preserve">
<source>Page for report</source>
</trans-unit>
Expand Down
2 changes: 2 additions & 0 deletions Resources/Private/Templates/Html/matchreport.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ <h2>Der Spielbericht ###MATCH_COMPETITION_NAME### ###MATCH_ROUND_NAME###</h2>
Datum: <b>###MATCH_DATE###</b><br />
Schiedsrichter: <b>###MATCH_REFEREENAMES###</b><br />
SRA: <b>###MATCH_ASSISTSNAMES###</b><br />
VAR: <b>###MATCH_VIDEOREFEREENAME###</b><br />
VAR-Assists: <b>###MATCH_VIDEOASSISTSNAMES###</b><br />
Zuschauer: <b>###MATCH_VISITORS###</b><br />
</td>
<td class="cfcleague-report-teamname">###MATCH_GUEST_NAME###</td>
Expand Down
3 changes: 2 additions & 1 deletion Tests/Unit/PHP/Table/Volleyball/TableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* *************************************************************
* Copyright notice.
*
* (c) 2013-2022 Rene Nitzsche (rene@system25.de)
* (c) 2013-2023 Rene Nitzsche (rene@system25.de)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
Expand Down Expand Up @@ -50,6 +50,7 @@ public function testLeagueTableWithTwoPointSystem()
], 'cfc_league_fe');
$confId = '';

$confId = '';
$leagueTable = Builder::buildByCompetitionAndMatches($league, $matches, $config, $confId);
$leagueTable->getMatchProvider()->setTeams($league->getTeams(), false);

Expand Down
14 changes: 14 additions & 0 deletions static/setup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1776,10 +1776,24 @@ plugin.tx_cfcleaguefe_report {
}
}

videorefereename =< lib.t3sports.matchreport.profiles
videorefereename.profile {
# Heimatstadt des Schiedsrichters anzeigen
home_town {
s_weight = 10
wrap = &nbsp;(|)
required = 1
}
}

assistsnames =< lib.t3sports.matchreport.profiles
assistsnames{
seperator = | und |
}
videoassistsnames =< lib.t3sports.matchreport.profiles
videoassistsnames{
seperator = |, |
}
}

stadiumview {
Expand Down

0 comments on commit a0ee898

Please sign in to comment.