1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-25 01:00:28 +02:00

Suppression de contenu inutile pour les correspondances

This commit is contained in:
galaxyoyo
2019-09-11 18:41:45 +02:00
parent 07e7b94f5c
commit 340be7faf5
34 changed files with 86 additions and 1985 deletions

View File

@ -35,8 +35,8 @@ class JoinTeam
ensure($this->team != null, "Ce code d'accès est invalide.");
ensure($this->team->getValidationStatus() == ValidationStatus::NOT_READY, "Cette équipe est déjà validée ou en cours de validation, vous ne pouvez pas la rejoindre.");
for ($i = 1; $i <= $_SESSION["role"] == Role::PARTICIPANT ? 6 : 2; ++$i) {
if (($_SESSION["role"] == Role::PARTICIPANT ? $this->team->getParticipants()[$i - 1] : $this->team->getEncadrants()[$i - 1]) == NULL)
for ($i = 1; $i <= $_SESSION["role"] == Role::PARTICIPANT ? 6 : 1; ++$i) {
if (($_SESSION["role"] == Role::PARTICIPANT ? $this->team->getParticipants()[$i - 1] : $this->team->getEncadrantId()) == NULL)
break;
}
@ -52,14 +52,13 @@ class JoinTeam
$user->setTeamId($this->team->getId());
if ($_SESSION["role"] == Role::ENCADRANT)
$this->team->setEncadrant($this->min_null_index, $user->getId());
$this->team->setEncadrant($user->getId());
else
$this->team->setParticipant($this->min_null_index, $user->getId());
$_SESSION["team"] = $this->team;
$tournament = $_SESSION["tournament"] = Tournament::fromId($this->team->getTournamentId());
Mailer::sendJoinTeamMail($user, $this->team, $tournament);
Mailer::sendJoinTeamMail($user, $this->team);
}
}