mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-01-07 14:22:22 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8fa1183f9f
@ -70,10 +70,10 @@ class Team
|
||||
return $team;
|
||||
}
|
||||
|
||||
public static function getAllTeams($problem)
|
||||
public static function getAllTeams($problem, $only_validated = false)
|
||||
{
|
||||
global $DB, $YEAR;
|
||||
$req = $DB->prepare("SELECT * FROM `teams` WHERE " . ($problem < 0 ? "" : "`problem` = ? AND ") . "`year` = $YEAR;");
|
||||
$req = $DB->prepare("SELECT * FROM `teams` WHERE " . ($problem < 0 ? "" : "`problem` = ? AND ") . ($only_validated ? "`validation_status` = 'VALIDATED' AND " : "") . "`year` = $YEAR;");
|
||||
$req->execute([htmlspecialchars($problem)]);
|
||||
|
||||
$teams = [];
|
||||
|
@ -102,7 +102,7 @@ class UpdateVideoTeams
|
||||
}
|
||||
}
|
||||
|
||||
$other_teams = Team::getAllTeams($team->getProblem());
|
||||
$other_teams = Team::getAllTeams($team->getProblem(), true);
|
||||
$documents = Document::getAllDocuments($team->getProblem(), $team->getId());
|
||||
|
||||
require_once "server_files/views/equipe.php";
|
||||
|
@ -155,7 +155,9 @@ function getZipFile($problem, $team_id = -1)
|
||||
foreach ($data as $file) {
|
||||
$file_id = $file->getFileId();
|
||||
$user = User::fromId($file->getUserId());
|
||||
$name = "Autorisation de droit à l'image de " . $user->getFirstName() . " " . $user->getSurname() . ".pdf";
|
||||
$mime_type = finfo_file(finfo_open(FILEINFO_MIME_TYPE), "$LOCAL_PATH/files/$file_id");
|
||||
$ext = $mime_type == "application/pdf" ? "pdf" : ($mime_type == "image/png" ? "png" : "jpg");
|
||||
$name = "Autorisation de droit à l'image de " . $user->getFirstName() . " " . $user->getSurname() . "." . $ext;
|
||||
|
||||
$zip->addFile("$LOCAL_PATH/files/$file_id", $name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user