mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Improve recap page + fix CSV import for jury roles
recapitulatif.php (partage): - Center .thanks-success and add bottom margin/padding - Display ALL fields: identifier, synopsis, languages, formats, jury (all roles), baiu link, license, access type - Add validation notice asking user to verify info, with xamxam@erg.be contact link (email obfuscated) StudentEmail: - Add 'Note contextuelle' and license_custom to email recap - Rename 'Promoteur·ice(s)' to 'Promoteur·ice(s) interne' - Change email message to ask student to verify info + contact for errors CSV export/import: - Add 3 new CSV columns: Lecteur·ice(s) interne, Lecteur·ice(s) externe, Promoteur·ice(s) ULB - Export splits supervisors by role/is_external/is_ulb into separate columns - Import inserts supervisors with correct role, is_external, and is_ulb flags (was: all treated as generic supervisors) - Add header matching for short distinguishers (ulb, externe) via str_contains fallback
This commit is contained in:
@@ -188,7 +188,10 @@ class ExportController
|
||||
'Sous-titre',
|
||||
'Auteur·ice(s)',
|
||||
'Contact',
|
||||
'Promoteur·ice(s)',
|
||||
'Promoteur·ice(s) interne',
|
||||
'Lecteur·ice(s) interne',
|
||||
'Lecteur·ice(s) externe',
|
||||
'Promoteur·ice(s) ULB',
|
||||
'Format(s)',
|
||||
'Année',
|
||||
'AP',
|
||||
@@ -252,10 +255,28 @@ class ExportController
|
||||
}
|
||||
}
|
||||
|
||||
// Supervisors
|
||||
$supList = [];
|
||||
// Supervisors — split by role
|
||||
$promoteursInternes = [];
|
||||
$lecteursInternes = [];
|
||||
$lecteursExternes = [];
|
||||
$promoteursUlb = [];
|
||||
foreach (($supervisors[$tid] ?? []) as $s) {
|
||||
$supList[] = $s['name'];
|
||||
$role = $s['role'] ?? '';
|
||||
$isExternal = (int)($s['is_external'] ?? 0);
|
||||
$isUlb = (int)($s['is_ulb'] ?? 0);
|
||||
$name = $s['name'];
|
||||
if ($role === 'promoteur' && $isUlb) {
|
||||
$promoteursUlb[] = $name;
|
||||
} elseif ($role === 'promoteur') {
|
||||
$promoteursInternes[] = $name;
|
||||
} elseif ($role === 'lecteur' && $isExternal) {
|
||||
$lecteursExternes[] = $name;
|
||||
} elseif ($role === 'lecteur') {
|
||||
$lecteursInternes[] = $name;
|
||||
} else {
|
||||
// Legacy rows with no role: treat as promoteur interne
|
||||
$promoteursInternes[] = $name;
|
||||
}
|
||||
}
|
||||
|
||||
// Tags
|
||||
@@ -282,7 +303,10 @@ class ExportController
|
||||
$t['subtitle'] ?? '',
|
||||
implode(', ', $authorList),
|
||||
$contact,
|
||||
implode(', ', $supList),
|
||||
implode(', ', $promoteursInternes),
|
||||
implode(', ', $lecteursInternes),
|
||||
implode(', ', $lecteursExternes),
|
||||
implode(', ', $promoteursUlb),
|
||||
implode(', ', $fmtList),
|
||||
$t['year'] ?? '',
|
||||
$t['ap_program'] ?? '',
|
||||
|
||||
@@ -2340,7 +2340,7 @@ class Database
|
||||
public function getAllThesisSupervisorsForExport(): array
|
||||
{
|
||||
return $this->pdo->query('
|
||||
SELECT ts.thesis_id, s.name
|
||||
SELECT ts.thesis_id, s.name, ts.role, ts.is_external, ts.is_ulb
|
||||
FROM thesis_supervisors ts
|
||||
JOIN supervisors s ON s.id = ts.supervisor_id
|
||||
ORDER BY ts.thesis_id, ts.supervisor_order
|
||||
|
||||
@@ -28,17 +28,18 @@ class StudentEmail
|
||||
'Atelier pluridisciplinaire' => $thesis['ap_program'] ?? '',
|
||||
'Finalité' => $thesis['finality_type'] ?? '',
|
||||
'Synopsis' => $thesis['synopsis'] ?? '',
|
||||
'Note contextuelle' => $thesis['context_note'] ?? '',
|
||||
'Langue(s)' => $thesis['languages'] ?? '',
|
||||
'Format(s)' => $thesis['formats'] ?? '',
|
||||
'Mots-clés' => $thesis['keywords'] ?? '',
|
||||
'Promoteur·ice(s)' => $thesis['jury_promoteurs'] ?? '',
|
||||
'Promoteur·ice(s) interne' => $thesis['jury_promoteurs'] ?? '',
|
||||
'Promoteur·ice(s) ULB' => $thesis['jury_promoteurs_ulb'] ?? '',
|
||||
'Président·e du jury' => $thesis['jury_president'] ?? '',
|
||||
'Lecteurs·rices (interne)' => $thesis['jury_lecteurs_internes'] ?? '',
|
||||
'Lecteurs·rices (externe)' => $thesis['jury_lecteurs_externes'] ?? '',
|
||||
'Lien' => $thesis['baiu_link'] ?? '',
|
||||
'Type d\'accès' => $thesis['access_type'] ?? '',
|
||||
'Licence' => $thesis['license_type'] ?? '',
|
||||
'Licence' => trim(($thesis['license_type'] ?? '') . (!empty($thesis['license_custom']) ? ' — ' . $thesis['license_custom'] : '')),
|
||||
];
|
||||
|
||||
foreach ($fields as $label => $value) {
|
||||
@@ -52,7 +53,8 @@ class StudentEmail
|
||||
<div style="font-family:system-ui,sans-serif;max-width:600px;margin:0 auto;color:#333">
|
||||
<h1 style="font-size:1.4rem;color:#222">Merci, ton TFE a bien été enregistré.</h1>
|
||||
<p style="color:#555;font-size:0.95rem">
|
||||
Voici un récapitulatif de ta soumission. Tu n'as pas besoin de répondre à cet e-mail.
|
||||
Voici un récapitulatif de ta soumission. Vérifie bien toutes les informations ci-dessous.
|
||||
Si tu constates une erreur, écris à <a href="mailto:xamxam@erg.be">xamxam@erg.be</a>.
|
||||
</p>
|
||||
<table style="width:100%;border-collapse:collapse;margin-top:1.5rem">
|
||||
{$rows}
|
||||
|
||||
Reference in New Issue
Block a user