mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-08-10 15:21:22 +02:00
partage: lock Année field to link's locked_year when present
When a student-access share link specifies a locked_year, the Année field in the student-facing form is now pre-filled with that year and rendered as disabled+readonly, with a hidden input ensuring the value is submitted. - renderShareLinkForm() exposes from ['locked_year'] - fieldset-academic.php checks for : if set, outputs a hidden input plus the visible field locked to that value; otherwise falls back to the normal editable field
This commit is contained in:
@@ -317,6 +317,10 @@ function renderShareLinkForm(string $slug, array $link): void
|
||||
$oldFn = $shareOldFn;
|
||||
$withAutofocusFn = $shareWithAutofocusFn;
|
||||
|
||||
// Locked academic year: if the link specifies a locked year, pre-fill
|
||||
// and lock the Année field so students cannot change it.
|
||||
$lockedYear = $link['locked_year'] ?? null;
|
||||
|
||||
// Synopsis extra: inject fieldset_synopsis help block
|
||||
ob_start();
|
||||
$helpContent = $helpFn('fieldset_synopsis');
|
||||
|
||||
Reference in New Issue
Block a user