-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
115 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
/.Build | ||
/composer.lock | ||
/var | ||
.php_cs.cache | ||
.php-cs-fixer.cache | ||
|
||
### eclipse files | ||
.settings | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,15 @@ | |
|
||
namespace System25\T3sports\Action; | ||
|
||
use Sys25\RnBase\Database\Connection; | ||
use Sys25\RnBase\Frontend\Controller\AbstractAction; | ||
use Sys25\RnBase\Frontend\Request\RequestInterface; | ||
use Sys25\RnBase\Utility\Strings; | ||
|
||
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2010-2017 Rene Nitzsche ([email protected]) | ||
* (c) 2010-2022 Rene Nitzsche ([email protected]) | ||
* All rights reserved | ||
* | ||
* This script is part of the TYPO3 project. The TYPO3 project is | ||
|
@@ -45,7 +47,7 @@ protected function handleRequest(RequestInterface $request) | |
$viewData = $request->getViewContext(); | ||
|
||
// Zuerst die Art der Statistik ermitteln | ||
$tables = \Tx_Rnbase_Utility_Strings::trimExplode(',', $configurations->get($this->getConfId().'tables'), 1); | ||
$tables = Strings::trimExplode(',', $configurations->get($this->getConfId().'tables'), 1); | ||
if (!count($tables)) { | ||
// Abbruch kein Typ angegeben | ||
throw new \Exception('No database table configured in: '.$this->getConfId().'tables'); | ||
|
@@ -69,7 +71,7 @@ private function findData($parameters, $configurations, $viewData, $table) | |
$options['debug'] = 1; | ||
} | ||
|
||
$res = \Tx_Rnbase_Database_Connection::getInstance()->doSelect('count(*) AS cnt', $table, $options); | ||
$res = Connection::getInstance()->doSelect('count(*) AS cnt', $table, $options); | ||
|
||
$items['size'] = $res[0]['cnt']; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,20 @@ | |
|
||
namespace System25\T3sports\Action; | ||
|
||
use Sys25\RnBase\Configuration\ConfigurationInterface; | ||
use Sys25\RnBase\Frontend\Controller\AbstractAction; | ||
use Sys25\RnBase\Frontend\Filter\BaseFilter; | ||
use Sys25\RnBase\Frontend\Request\RequestInterface; | ||
use Sys25\RnBase\Utility\Misc; | ||
use Sys25\RnBase\Utility\PageBrowser; | ||
use Sys25\RnBase\Utility\Strings; | ||
use System25\T3sports\Service\StatsServiceRegistry; | ||
use tx_rnbase; | ||
|
||
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2010-2018 Rene Nitzsche ([email protected]) | ||
* (c) 2010-2022 Rene Nitzsche ([email protected]) | ||
* All rights reserved | ||
* | ||
* This script is part of the TYPO3 project. The TYPO3 project is | ||
|
@@ -38,20 +44,19 @@ class PlayerStats extends AbstractAction | |
*/ | ||
protected function handleRequest(RequestInterface $request) | ||
{ | ||
$parameters = $request->getParameters(); | ||
$configurations = $request->getConfigurations(); | ||
$viewData = $request->getViewContext(); | ||
|
||
// Zuerst die Art der Statistik ermitteln | ||
$types = \Tx_Rnbase_Utility_Strings::trimExplode(',', $configurations->get($this->getConfId().'statisticTypes'), 1); | ||
$types = Strings::trimExplode(',', $configurations->get($this->getConfId().'statisticTypes'), 1); | ||
if (!count($types)) { | ||
// Abbruch kein Typ angegeben | ||
throw new \Exception('No statistics type configured in: '.$this->getConfId().'statisticTypes'); | ||
} | ||
|
||
$statsData = []; | ||
foreach ($types as $type) { | ||
$statsData[$type] = $this->findData($parameters, $configurations, $viewData, $type); | ||
$statsData[$type] = $this->findData($request, $viewData, $type); | ||
} | ||
$viewData->offsetSet('items', $statsData); | ||
$teamId = $configurations->get($this->getConfId().'highlightTeam'); | ||
|
@@ -65,23 +70,23 @@ protected function handleRequest(RequestInterface $request) | |
return null; | ||
} | ||
|
||
private function findData($parameters, $configurations, $viewData, $type) | ||
private function findData(RequestInterface $request, $viewData, $type) | ||
{ | ||
$srv = (new StatsServiceRegistry())->getStatisticService(); | ||
$confId = $this->getConfId().$type.'.'; | ||
$filter = \tx_rnbase_filter_BaseFilter::createFilter($parameters, $configurations, $viewData, $confId); | ||
$filter = BaseFilter::createFilter($request, $confId); | ||
|
||
$fields = []; | ||
$options = [ | ||
'enablefieldsoff' => 1, | ||
]; | ||
$filter->init($fields, $options); | ||
$debug = $configurations->get($this->getConfId().'options.debug'); | ||
$debug = $request->getConfigurations()->get($this->getConfId().'options.debug'); | ||
if ($debug) { | ||
$options['debug'] = 1; | ||
} | ||
|
||
self::handlePageBrowser($configurations, $confId.'data.pagebrowser', $viewData, $fields, $options, [ | ||
self::handlePageBrowser($request->getConfigurations(), $confId.'data.pagebrowser', $viewData, $fields, $options, [ | ||
'searchcallback' => [ | ||
$srv, | ||
'searchPlayerStats', | ||
|
@@ -90,13 +95,13 @@ private function findData($parameters, $configurations, $viewData, $type) | |
]); | ||
|
||
$items = $srv->searchPlayerStats($fields, $options); | ||
\tx_rnbase_util_Misc::callHook('t3sportstats', 'playerstats_finddata', [ | ||
Misc::callHook('t3sportstats', 'playerstats_finddata', [ | ||
'type' => $type, | ||
'items' => &$items, | ||
'confid' => $confId, | ||
'fields' => $fields, | ||
'options' => $options, | ||
'configurations' => $configurations, | ||
'configurations' => $request->getConfigurations(), | ||
], $this); | ||
|
||
return $items; | ||
|
@@ -113,7 +118,7 @@ private function findData($parameters, $configurations, $viewData, $type) | |
* @param array $fields | ||
* @param array $options | ||
*/ | ||
private static function handlePageBrowser(&$configurations, $confid, &$viewdata, &$fields, &$options, $cfg = []) | ||
private static function handlePageBrowser(ConfigurationInterface $configurations, $confid, $viewdata, &$fields, &$options, $cfg = []) | ||
{ | ||
$confid .= '.'; | ||
if (is_array($configurations->get($confid))) { | ||
|
@@ -135,7 +140,8 @@ private static function handlePageBrowser(&$configurations, $confid, &$viewdata, | |
} | ||
// PageBrowser initialisieren | ||
$pbId = $cfg['pbid'] ? $cfg['pbid'] : 'pb'; | ||
$pageBrowser = \tx_rnbase::makeInstance('tx_rnbase_util_PageBrowser', $pbId); | ||
|
||
$pageBrowser = tx_rnbase::makeInstance(PageBrowser::class, $pbId); | ||
$pageSize = $configurations->getInt($confid.'limit'); | ||
|
||
$pageBrowser->setState($configurations->getParameters(), $listSize, $pageSize); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,17 @@ | |
|
||
namespace System25\T3sports\Action; | ||
|
||
use Sys25\RnBase\Configuration\ConfigurationInterface; | ||
use Sys25\RnBase\Frontend\Controller\AbstractAction; | ||
use Sys25\RnBase\Frontend\Filter\BaseFilter; | ||
use Sys25\RnBase\Frontend\Request\RequestInterface; | ||
use Sys25\RnBase\Utility\Strings; | ||
use System25\T3sports\Service\StatsServiceRegistry; | ||
|
||
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2010-2020 Rene Nitzsche ([email protected]) | ||
* (c) 2010-2022 Rene Nitzsche ([email protected]) | ||
* All rights reserved | ||
* | ||
* This script is part of the TYPO3 project. The TYPO3 project is | ||
|
@@ -46,15 +49,15 @@ protected function handleRequest(RequestInterface $request) | |
$viewData = $request->getViewContext(); | ||
|
||
// Zuerst die Art der Statistik ermitteln | ||
$types = \Tx_Rnbase_Utility_Strings::trimExplode(',', $configurations->get($this->getConfId().'statisticTypes'), 1); | ||
$types = Strings::trimExplode(',', $configurations->get($this->getConfId().'statisticTypes'), 1); | ||
if (!count($types)) { | ||
// Abbruch kein Typ angegeben | ||
throw new \Exception('No statistics type configured in: '.$this->getConfId().'statisticTypes'); | ||
} | ||
|
||
$statsData = []; | ||
foreach ($types as $type) { | ||
$statsData[$type] = $this->findData($parameters, $configurations, $viewData, $type); | ||
$statsData[$type] = $this->findData($request, $viewData, $type); | ||
} | ||
$viewData->offsetSet('items', $statsData); | ||
$teamId = $configurations->get($this->getConfId().'highlightTeam'); | ||
|
@@ -68,23 +71,23 @@ protected function handleRequest(RequestInterface $request) | |
return null; | ||
} | ||
|
||
private function findData($parameters, $configurations, $viewData, $type) | ||
private function findData(RequestInterface $request, $viewData, $type) | ||
{ | ||
$srv = (new StatsServiceRegistry())->getStatisticService(); | ||
$confId = $this->getConfId().$type.'.'; | ||
$filter = \tx_rnbase_filter_BaseFilter::createFilter($parameters, $configurations, $viewData, $confId); | ||
$filter = BaseFilter::createFilter($request, $confId); | ||
|
||
$fields = []; | ||
$options = [ | ||
'enablefieldsoff' => 1, | ||
]; | ||
$filter->init($fields, $options); | ||
$debug = $configurations->get($this->getConfId().'options.debug'); | ||
$debug = $request->getConfigurations()->get($this->getConfId().'options.debug'); | ||
if ($debug) { | ||
$options['debug'] = 1; | ||
} | ||
|
||
self::handlePageBrowser($configurations, $confId.'data.pagebrowser', $viewData, $fields, $options, [ | ||
self::handlePageBrowser($request->getConfigurations(), $confId.'data.pagebrowser', $viewData, $fields, $options, [ | ||
'searchcallback' => [ | ||
$srv, | ||
'searchRefereeStats', | ||
|
@@ -108,7 +111,7 @@ private function findData($parameters, $configurations, $viewData, $type) | |
* @param array $fields | ||
* @param array $options | ||
*/ | ||
private static function handlePageBrowser(&$configurations, $confid, &$viewdata, &$fields, &$options, $cfg = []) | ||
private static function handlePageBrowser(ConfigurationInterface $configurations, $confid, $viewdata, &$fields, &$options, $cfg = []) | ||
{ | ||
$confid .= '.'; | ||
if (is_array($configurations->get($confid))) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,15 @@ | |
|
||
namespace System25\T3sports\Filter; | ||
|
||
use Sys25\RnBase\Frontend\Filter\BaseFilter; | ||
use Sys25\RnBase\Utility\Strings; | ||
use System25\T3sports\Search\StatsSearchBuilder; | ||
use System25\T3sports\Utility\ScopeController; | ||
|
||
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2010-2020 Rene Nitzsche | ||
* (c) 2010-2022 Rene Nitzsche | ||
* Contact: [email protected] | ||
* All rights reserved | ||
* | ||
|
@@ -31,7 +34,7 @@ | |
* | ||
* @author Rene Nitzsche | ||
*/ | ||
class CoachStatsFilter extends \tx_rnbase_filter_BaseFilter | ||
class CoachStatsFilter extends BaseFilter | ||
{ | ||
/** | ||
* Abgeleitete Filter können diese Methode überschreiben und zusätzliche Filter setzen. | ||
|
@@ -42,11 +45,15 @@ class CoachStatsFilter extends \tx_rnbase_filter_BaseFilter | |
* @param \tx_rnbase_configurations $configurations | ||
* @param string $confId | ||
*/ | ||
protected function initFilter(&$fields, &$options, &$parameters, &$configurations, $confId) | ||
protected function initFilter(&$fields, &$options) | ||
{ | ||
$parameters = $this->getParameters(); | ||
$configurations = $this->getConfigurations(); | ||
$confId = $this->getConfId(); | ||
|
||
// $options['distinct'] = 1; | ||
// Wir benötigen zuerst die Spalten für WHAT | ||
$cols = \Tx_Rnbase_Utility_Strings::trimExplode(',', $configurations->get($confId.'columns')); | ||
$cols = Strings::trimExplode(',', $configurations->get($confId.'columns')); | ||
$columns = []; | ||
foreach ($cols as $col) { | ||
if ($col) { | ||
|
@@ -56,7 +63,7 @@ protected function initFilter(&$fields, &$options, &$parameters, &$configuration | |
if (count($columns)) { | ||
$options['what'] .= ','.implode(', ', $columns); | ||
} | ||
$scopeArr = \tx_cfcleaguefe_util_ScopeController::handleCurrentScope($parameters, $configurations); | ||
$scopeArr = ScopeController::handleCurrentScope($parameters, $configurations); | ||
StatsSearchBuilder::buildCoachStatsByScope($fields, $scopeArr); | ||
} | ||
} |
Oops, something went wrong.