mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-08-10 23:31:21 +02:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user