formulaire: correctifs identifiant/année, contact, fichiers optionnels

- Identifiant: mise à jour automatique quand l'année change en back-office (updateThesis + ThesisEditController)
- Contact: hint enrichi (1 seul contact, formatage Instagram/Mastodon)
- Fichiers: TFE rendu optionnel pour Site web/Performance/Installation (note d'intention reste obligatoire)
This commit is contained in:
Pontoporeia
2026-06-10 00:17:00 +02:00
parent c4664ec2e9
commit 3d524226a1
11 changed files with 107 additions and 44 deletions
+12 -3
View File
@@ -2122,8 +2122,16 @@ class Database
$this->fetchRow('theses', $thesisId)
);
$stmt = $this->pdo->prepare('
$identifierCol = '';
$params = [];
if (array_key_exists('identifier', $data)) {
$identifierCol = 'identifier = ?,';
$params[] = $data['identifier'];
}
$stmt = $this->pdo->prepare("
UPDATE theses SET
$identifierCol
title = ?,
subtitle = ?,
year = ?,
@@ -2144,7 +2152,7 @@ class Database
cc2r = ?,
updated_at = CURRENT_TIMESTAMP
WHERE id = ?
');
");
$orientation = ($data['orientation_id'] ?? null) ? (int)$data['orientation_id'] : null;
$ap = ($data['ap_program_id'] ?? null) ? (int)$data['ap_program_id'] : null;
$finality = ($data['finality_id'] ?? null) ? (int)$data['finality_id'] : null;
@@ -2153,7 +2161,7 @@ class Database
error_log("[DB:updateThesis] thesis_id=$thesisId orientation=$orientation ap=$ap finality=$finality license=$license access=$access");
$stmt->execute([
$params = array_merge($params, [
$data['title'],
!empty($data['subtitle']) ? $data['subtitle'] : null,
(int)$data['year'],
@@ -2174,6 +2182,7 @@ class Database
!empty($data['cc2r']) ? 1 : 0,
$thesisId,
]);
$stmt->execute($params);
}
/**