mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-08-11 07:41:17 +02:00
schema: validate against new TFE field spec
- add exemplaire_baiu, exemplaire_erg, cc4r, remarks; - add is_ulb to jury; - split jury_lecteurs into interne/externe in view; - refactor admin edit form with backoffice fields; - update public fiche to show promoteur ULB and split lecteurs
This commit is contained in:
@@ -112,10 +112,12 @@ class TfeController
|
||||
'accessTypeId' => $accessTypeId,
|
||||
'isInterdit' => $isInterdit,
|
||||
'captionFiles' => $captionFiles,
|
||||
'juryPresidents' => $juryByRole['presidents'],
|
||||
'promoteursInternes' => $juryByRole['internes'],
|
||||
'promoteursExternes' => $juryByRole['externes'],
|
||||
'juryLecteurs' => $juryByRole['lecteurs'],
|
||||
'juryPresidents' => $juryByRole['presidents'],
|
||||
'promoteursInternes' => $juryByRole['internes'],
|
||||
'promoteursExternes' => $juryByRole['externes'],
|
||||
'promoteursUlb' => $juryByRole['ulb'],
|
||||
'juryLecteursInternes' => $juryByRole['lecteurs_internes'],
|
||||
'juryLecteursExternes' => $juryByRole['lecteurs_externes'],
|
||||
|
||||
// Restricted files access
|
||||
'restrictedEnabled' => $restrictedEnabled,
|
||||
@@ -199,14 +201,14 @@ class TfeController
|
||||
}
|
||||
|
||||
/**
|
||||
* Split jury members by role and internal/external flag.
|
||||
* Split jury members by role and internal/external/ULB flags.
|
||||
*
|
||||
* @param array<int, array<string, mixed>> $jury
|
||||
* @return array{presidents: list<string>, internes: list<string>, externes: list<string>, lecteurs: list<string>}
|
||||
* @return array{presidents: list<string>, internes: list<string>, externes: list<string>, ulb: list<string>, lecteurs_internes: list<string>, lecteurs_externes: list<string>}
|
||||
*/
|
||||
private function splitJuryByRole(array $jury): array
|
||||
{
|
||||
$result = ['presidents' => [], 'internes' => [], 'externes' => [], 'lecteurs' => []];
|
||||
$result = ['presidents' => [], 'internes' => [], 'externes' => [], 'ulb' => [], 'lecteurs_internes' => [], 'lecteurs_externes' => []];
|
||||
|
||||
foreach ($jury as $member) {
|
||||
$name = $member['name'] ?? '';
|
||||
@@ -219,14 +221,20 @@ class TfeController
|
||||
$result['presidents'][] = $name;
|
||||
break;
|
||||
case 'promoteur':
|
||||
if ((int)$member['is_external'] === 1) {
|
||||
if ((int)($member['is_ulb'] ?? 0) === 1) {
|
||||
$result['ulb'][] = $name;
|
||||
} elseif ((int)$member['is_external'] === 1) {
|
||||
$result['externes'][] = $name;
|
||||
} else {
|
||||
$result['internes'][] = $name;
|
||||
}
|
||||
break;
|
||||
case 'lecteur':
|
||||
$result['lecteurs'][] = $name;
|
||||
if ((int)$member['is_external'] === 1) {
|
||||
$result['lecteurs_externes'][] = $name;
|
||||
} else {
|
||||
$result['lecteurs_internes'][] = $name;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,6 +322,7 @@ class ThesisCreateController
|
||||
'name' => trim($post['jury_promoteur']),
|
||||
'role' => 'promoteur',
|
||||
'is_external' => isset($post['jury_promoteur_ext']) ? 1 : 0,
|
||||
'is_ulb' => isset($post['jury_promoteur_ulb']) ? 1 : 0,
|
||||
];
|
||||
}
|
||||
foreach ($post['jury_lecteurs'] ?? [] as $i => $name) {
|
||||
|
||||
@@ -127,6 +127,7 @@ class ThesisEditController
|
||||
'currentContextNote' => $currentContextNote,
|
||||
'currentAuthorEmail' => $currentAuthorEmail,
|
||||
'currentAuthorShowContact' => $currentAuthorShowContact,
|
||||
'currentRaw' => $rawRow,
|
||||
'pageTitle' => 'Éditer TFE - ' . htmlspecialchars($thesis['title']),
|
||||
];
|
||||
}
|
||||
@@ -166,19 +167,24 @@ class ThesisEditController
|
||||
try {
|
||||
// ── 1. Thesis metadata ────────────────────────────────────────────
|
||||
$this->db->updateThesis($thesisId, [
|
||||
'title' => trim($post['titre'] ?? ''),
|
||||
'subtitle' => trim($post['subtitle'] ?? ''),
|
||||
'year' => intval($post['année'] ?? 0),
|
||||
'orientation_id' => intval($post['orientation'] ?? 0),
|
||||
'ap_program_id' => intval($post['ap'] ?? 0),
|
||||
'finality_id' => intval($post['finality'] ?? 0),
|
||||
'synopsis' => trim($post['synopsis'] ?? ''),
|
||||
'context_note' => trim($post['context_note'] ?? ''),
|
||||
'file_size_info' => trim($post['duration_info'] ?? ''),
|
||||
'baiu_link' => trim($post['lien'] ?? ''),
|
||||
'license_id' => filter_var($post['license_id'] ?? '', FILTER_VALIDATE_INT) ?: null,
|
||||
'access_type_id' => filter_var($post['access_type_id'] ?? '', FILTER_VALIDATE_INT) ?: null,
|
||||
'is_published' => isset($post['is_published']),
|
||||
'title' => trim($post['titre'] ?? ''),
|
||||
'subtitle' => trim($post['subtitle'] ?? ''),
|
||||
'year' => intval($post['année'] ?? 0),
|
||||
'orientation_id' => intval($post['orientation'] ?? 0),
|
||||
'ap_program_id' => intval($post['ap'] ?? 0),
|
||||
'finality_id' => intval($post['finality'] ?? 0),
|
||||
'synopsis' => trim($post['synopsis'] ?? ''),
|
||||
'context_note' => trim($post['context_note'] ?? ''),
|
||||
'file_size_info' => trim($post['duration_info'] ?? ''),
|
||||
'baiu_link' => trim($post['lien'] ?? ''),
|
||||
'license_id' => filter_var($post['license_id'] ?? '', FILTER_VALIDATE_INT) ?: null,
|
||||
'access_type_id' => filter_var($post['access_type_id'] ?? '', FILTER_VALIDATE_INT) ?: null,
|
||||
'is_published' => isset($post['is_published']),
|
||||
'remarks' => trim($post['remarks'] ?? ''),
|
||||
'jury_points' => $post['jury_points'] ?? null,
|
||||
'exemplaire_baiu' => !empty($post['exemplaire_baiu']),
|
||||
'exemplaire_erg' => !empty($post['exemplaire_erg']),
|
||||
'cc4r' => !empty($post['cc4r']),
|
||||
]);
|
||||
|
||||
// ── 2. Authors (alphabetically sorted) ─────────────────────────────
|
||||
@@ -552,6 +558,7 @@ class ThesisEditController
|
||||
'name' => trim($post['jury_promoteur']),
|
||||
'role' => 'promoteur',
|
||||
'is_external' => isset($post['jury_promoteur_ext']) ? 1 : 0,
|
||||
'is_ulb' => isset($post['jury_promoteur_ulb']) ? 1 : 0,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user