mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-25 05:00:28 +02:00
Corrections mineures
This commit is contained in:
@ -6,7 +6,6 @@ class Document
|
||||
private $user_id;
|
||||
private $team_id;
|
||||
private $problem;
|
||||
private $type;
|
||||
private $uploaded_at;
|
||||
private $version;
|
||||
|
||||
@ -38,7 +37,6 @@ class Document
|
||||
$this->user_id = $data["user"];
|
||||
$this->team_id = $data["team"];
|
||||
$this->problem = $data["problem"];
|
||||
$this->type = DocumentType::fromName($data["type"]);
|
||||
$this->uploaded_at = $data["uploaded_at"];
|
||||
$this->version = isset($data["version"]) ? $data["version"] : 1;
|
||||
}
|
||||
@ -63,11 +61,6 @@ class Document
|
||||
return $this->problem;
|
||||
}
|
||||
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
public function getUploadedAt()
|
||||
{
|
||||
return $this->uploaded_at;
|
||||
@ -86,7 +79,7 @@ class Document
|
||||
$req = $DB->query("SELECT * FROM `documents` AS `t1` "
|
||||
. "INNER JOIN (SELECT `user`, `problem`, MAX(`uploaded_at`) AS `last_upload`, COUNT(`team`) AS `version` FROM `documents` GROUP BY `problem`, `user`) `t2` "
|
||||
. "ON `t1`.`user` = `t2`.`user` AND `t1`.`problem` = `t2`.`problem` "
|
||||
. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`problem` = $problem " . ($team_id >= 0 ? "AND `team` = $team_id" : "") . " ORDER BY `t1`.`type`;");
|
||||
. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`problem` = $problem " . ($team_id >= 0 ? "AND `team` = $team_id" : "") . ";");
|
||||
|
||||
$docs = [];
|
||||
|
||||
|
@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
class DocumentType
|
||||
{
|
||||
const PHOTO_CONSENT = 0;
|
||||
|
||||
public static function getTranslatedName($type) {
|
||||
switch ($type) {
|
||||
default:
|
||||
return "Autorisation de droit à l'image";
|
||||
}
|
||||
}
|
||||
|
||||
public static function getName($type) {
|
||||
switch ($type) {
|
||||
default:
|
||||
return "PHOTO_CONSENT";
|
||||
}
|
||||
}
|
||||
|
||||
public static function fromName($name) {
|
||||
switch ($name) {
|
||||
default:
|
||||
return self::PHOTO_CONSENT;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user