wip watten
This commit is contained in:
1 parent
8ace316cbf
commit
afc8a6e1f5
93 files changed
+14369
-1
No files matched your search
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Watten\Controller;
|
||||
|
||||
use HermannTelser\Watten\Domain\Repository\ErgebnisseRepository;
|
||||
use HermannTelser\Watten\Domain\Repository\AthletenRepository;
|
||||
use HermannTelser\Watten\Domain\Repository\SpieltageRepository;
|
||||
use HermannTelser\Watten\Domain\Repository\RanglisteRepository;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
class WattenController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
|
||||
{
|
||||
private $athletenRepository;
|
||||
|
||||
private $spieltageRepository;
|
||||
|
||||
private $ergebnisseRepository;
|
||||
|
||||
private $ranglisteRepository;
|
||||
|
||||
private $activeTournament;
|
||||
|
||||
private $event_id;
|
||||
|
||||
/**
|
||||
* Inject the Athleten repository
|
||||
*
|
||||
* @param \HermannTelser\Watten\Domain\Repository\AthletenRepository $athletenRepository
|
||||
* @param \HermannTelser\Watten\Domain\Repository\SpieltageRepository $spieltageRepository
|
||||
* @param \HermannTelser\Watten\Domain\Repository\ErgebnisseRepository $ergebnisseRepository
|
||||
* @param \HermannTelser\Watten\Domain\Repository\RanglisteRepository $ranglisteRepository
|
||||
*/
|
||||
|
||||
public function __construct(AthletenRepository $athletenRepository, SpieltageRepository $spieltageRepository, ErgebnisseRepository $ergebnisseRepository, RanglisteRepository $ranglisteRepository)
|
||||
{
|
||||
$this->athletenRepository = $athletenRepository;
|
||||
$this->ergebnisseRepository = $ergebnisseRepository;
|
||||
$this->spieltageRepository = $spieltageRepository;
|
||||
$this->ranglisteRepository = $ranglisteRepository;
|
||||
|
||||
$this->activeTournament = GeneralUtility::_GP('tournament') ?? $this->ergebnisseRepository->getActiveTournament();
|
||||
$this->event_id = GeneralUtility::_GP('event_id') ?? $this->ergebnisseRepository->getLastEventId();
|
||||
}
|
||||
|
||||
public function ergebnisseAction()
|
||||
{
|
||||
$tournaments = $this->ergebnisseRepository->findTournaments(false);
|
||||
$this->view->assign('tournaments', $tournaments);
|
||||
$this->view->assign('active_tournaments', $this->activeTournament);
|
||||
|
||||
$spieltage = $this->spieltageRepository->loadSpieltage();
|
||||
$this->view->assign('spieltage', $spieltage);
|
||||
$this->view->assign('active_event_id', $this->event_id);
|
||||
}
|
||||
|
||||
public function ranglisteAction()
|
||||
{
|
||||
$tournaments = $this->ergebnisseRepository->findTournaments(true);
|
||||
$this->view->assign('tournaments', $tournaments);
|
||||
$this->view->assign('active', $this->activeTournament);
|
||||
}
|
||||
|
||||
public function statistikAction()
|
||||
{
|
||||
$tournaments = $this->ergebnisseRepository->findTournaments(true);
|
||||
$this->view->assign('tournaments', $tournaments);
|
||||
$this->view->assign('active', $this->activeTournament);
|
||||
$teilnehmer = $this->athletenRepository->loadTournamentAthleten($this->activeTournament);
|
||||
$this->view->assign('teilnehmer', $teilnehmer);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user