mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-27 00:59:18 +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:
@@ -1405,7 +1405,7 @@ class Database
|
||||
public function getThesisJury(int $thesisId): array
|
||||
{
|
||||
$stmt = $this->pdo->prepare('
|
||||
SELECT s.id, s.name, ts.role, ts.is_external, ts.supervisor_order
|
||||
SELECT s.id, s.name, ts.role, ts.is_external, ts.is_ulb, ts.supervisor_order
|
||||
FROM thesis_supervisors ts
|
||||
JOIN supervisors s ON s.id = ts.supervisor_id
|
||||
WHERE ts.thesis_id = ?
|
||||
@@ -1428,8 +1428,8 @@ class Database
|
||||
try {
|
||||
$this->pdo->prepare('DELETE FROM thesis_supervisors WHERE thesis_id = ?')->execute([$thesisId]);
|
||||
$stmt = $this->pdo->prepare('
|
||||
INSERT INTO thesis_supervisors (thesis_id, supervisor_id, role, is_external, supervisor_order)
|
||||
VALUES (?, ?, ?, ?, ?)
|
||||
INSERT INTO thesis_supervisors (thesis_id, supervisor_id, role, is_external, is_ulb, supervisor_order)
|
||||
VALUES (?, ?, ?, ?, ?, ?)
|
||||
');
|
||||
foreach ($juryMembers as $order => $member) {
|
||||
$name = trim($member['name'] ?? '');
|
||||
@@ -1440,7 +1440,8 @@ class Database
|
||||
$role = in_array($member['role'], ['president', 'promoteur', 'lecteur'])
|
||||
? $member['role'] : 'promoteur';
|
||||
$isExternal = isset($member['is_external']) ? (int)$member['is_external'] : 0;
|
||||
$stmt->execute([$thesisId, $supervisorId, $role, $isExternal, (int)$order + 1]);
|
||||
$isUlb = isset($member['is_ulb']) ? (int)$member['is_ulb'] : 0;
|
||||
$stmt->execute([$thesisId, $supervisorId, $role, $isExternal, $isUlb, (int)$order + 1]);
|
||||
}
|
||||
if (!$alreadyInTransaction) {
|
||||
$this->pdo->commit();
|
||||
@@ -1650,7 +1651,7 @@ class Database
|
||||
public function getThesisRawFields(int $thesisId): ?array
|
||||
{
|
||||
$stmt = $this->pdo->prepare(
|
||||
'SELECT license_id, access_type_id, context_note FROM theses WHERE id = ? LIMIT 1'
|
||||
'SELECT license_id, access_type_id, context_note, remarks, jury_points, exemplaire_baiu, exemplaire_erg, cc4r FROM theses WHERE id = ? LIMIT 1'
|
||||
);
|
||||
$stmt->execute([$thesisId]);
|
||||
$row = $stmt->fetch();
|
||||
@@ -1784,6 +1785,11 @@ class Database
|
||||
license_id = ?,
|
||||
access_type_id = ?,
|
||||
is_published = ?,
|
||||
remarks = ?,
|
||||
jury_points = ?,
|
||||
exemplaire_baiu = ?,
|
||||
exemplaire_erg = ?,
|
||||
cc4r = ?,
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
WHERE id = ?
|
||||
');
|
||||
@@ -1801,6 +1807,11 @@ class Database
|
||||
$data['license_id'] ?? null,
|
||||
$data['access_type_id'] ?? null,
|
||||
$data['is_published'] ? 1 : 0,
|
||||
!empty($data['remarks']) ? $data['remarks'] : null,
|
||||
isset($data['jury_points']) && $data['jury_points'] !== '' ? (float)$data['jury_points'] : null,
|
||||
!empty($data['exemplaire_baiu']) ? 1 : 0,
|
||||
!empty($data['exemplaire_erg']) ? 1 : 0,
|
||||
!empty($data['cc4r']) ? 1 : 0,
|
||||
$thesisId,
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user