From 371605d265235e32289c7f7ffba6c63f362b0e71 Mon Sep 17 00:00:00 2001 From: galaxyoyo Date: Wed, 25 Sep 2019 00:57:41 +0200 Subject: [PATCH] =?UTF-8?q?Design=20pages=20"Rejoindre=20une=20=C3=A9quipe?= =?UTF-8?q?"=20et=20"Informations"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server_files/controllers/informations.php | 2 +- server_files/model.php | 6 +-- server_files/views/informations.php | 23 +++++++++--- server_files/views/mon_equipe.php | 17 +++++++-- server_files/views/rejoindre_equipe.php | 45 +++++++++++------------ 5 files changed, 56 insertions(+), 37 deletions(-) diff --git a/server_files/controllers/informations.php b/server_files/controllers/informations.php index d18589d..2325109 100644 --- a/server_files/controllers/informations.php +++ b/server_files/controllers/informations.php @@ -7,7 +7,7 @@ $id = $_GET["id"]; $user = User::fromId($id); if ($_SESSION["role"] != Role::ADMIN) { - if ($user->getId() != $_SESSION["user_id"] && ($user->getTeamId() == null || $user->getTeamId() != $_SESSION["user"]->getTeamId())) + if ($user->getId() != $_SESSION["user_id"]) require_once "server_files/403.php"; } diff --git a/server_files/model.php b/server_files/model.php index b3889c7..444e85f 100644 --- a/server_files/model.php +++ b/server_files/model.php @@ -115,8 +115,7 @@ function canValidate(Team $team) function printDocuments($documents) { - global $URL_BASE; - + echo "
\n"; foreach ($documents as $document) { $file_id = $document->getFileId(); $user = User::fromId($document->getUserId()); @@ -124,8 +123,9 @@ function printDocuments($documents) $first_name = $user->getFirstName(); $name = DocumentType::getTranslatedName($document->getType()); $version = $document->getVersion(); - echo "$name de $first_name $surname (version $version) : Télécharger
"; + echo "$name de $first_name $surname (version $version) : Télécharger
\n"; } + echo "
\n"; } function getZipFile($problem, $team_id = -1) diff --git a/server_files/views/informations.php b/server_files/views/informations.php index 1848c59..5a516db 100644 --- a/server_files/views/informations.php +++ b/server_files/views/informations.php @@ -1,22 +1,33 @@ -

getFirstName() . " " . $user->getSurname() ?>

+
+

getFirstName() . " " . $user->getSurname() ?>

+
getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?> - Équipe : getTrigram() . "\">" . $team->getName() . " (" . $team->getTrigram() . ")" ?>
+
+ Équipe : getTrigram() . "\">" + . $team->getName() . " (" . $team->getTrigram() . ")" ?> +
getRole() == Role::PARTICIPANT) { ?> - Lycée : getSchool() ?>
- Classe : getClass()) ?>
+
+ Lycée : getSchool() ?>
+ Classe : getClass()) ?> +
getDescription() != "") { ?> - Description : getDescription() ?>
+
+ Description : getDescription() ?> +
"; if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?> -

Autorisations

+
+

Autorisation de droit à l'image :

+
getEncadrantId() !== null) { $encadrant = User::fromId($team->getEncadrantId()); $id = $encadrant->getId(); - echo "Encadrant : getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "
"; + if ($_SESSION["role"] == Role::ADMIN) + echo "Encadrant : getFirstName() + . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "
"; + else + echo "Encadrant : " . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "
"; } for ($i = 1; $i <= 5; ++$i) { if ($team->getParticipants()[$i - 1] == NULL) continue; $participant = User::fromId($team->getParticipants()[$i - 1]); $id = $participant->getId(); - echo "Participant $i : getFirstName() . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "
"; + if ($_SESSION["role"] == Role::ADMIN) + echo "Participant $i : getFirstName() + . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "
"; + else + echo "Participant $i : " . $participant->getFirstName() . " " . $participant->getSurname() . "
"; } ?> @@ -93,8 +101,9 @@ require_once "header.php"; -
-

Autorisation de droit à l'image

+
+

Autorisation de droit à l'image

+
-if (isset($join_team) && !$has_error) { ?> - Vous avez bien rejoint l'équipe getName() ?> ! +
+

Rejoindre une équipe

+
+ + +
+ Vous avez bien rejoint l'équipe getName() ?> ! +
= $CONFIG->getInscriptionDate()) { ?> -

La date limite d'inscription est dépassée.

+
+ La date limite d'inscription est dépassée. +
- Erreur : " . $error_message . ""; ?> -
- - - - - - - - - - -
- - - -
- -
+
+
+ + +
+
+ +
+ +