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:
Pontoporeia
2026-05-07 17:30:34 +02:00
parent 7793b6f86d
commit dce0e0b301
18 changed files with 280 additions and 38 deletions

View File

@@ -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;
}
}