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
@@ -217,6 +217,16 @@ class ThesisEditController
'cc2r' => !empty($post['cc2r']),
'license_custom' => trim($post['license_custom'] ?? ''),
];
// Regenerate identifier if year changed
$oldThesis = $this->db->getThesis($thesisId);
$oldYear = (int)($oldThesis['year'] ?? 0);
$newYear = $meta['year'];
if ($newYear !== $oldYear && $newYear >= 2000) {
$newIdentifier = $this->db->generateThesisIdentifier($newYear);
$meta['identifier'] = $newIdentifier;
error_log('[ThesisEdit] Year changed ' . $oldYear . ' → ' . $newYear . ', new identifier: ' . $newIdentifier);
}
$this->db->updateThesis($thesisId, $meta);
error_log('[ThesisEdit] Step 1 OK — thesis_id=' . $thesisId);