refine: required confirmation_email field on both student forms, StudentEmail uses it directly

- Add dedicated 'confirmation_email' (type=email, required) field
  to student form at end of submission (partage + admin).
- ThesisCreateController now validates it is present and a valid
  email; form is rejected if missing/invalid.
- Autofocus mapping for confirmation_email errors.
- StudentEmail uses confirmation_email directly (removed extractEmail
  hack that mined email from free-form contact field).
This commit is contained in:
Pontoporeia
2026-04-20 15:02:28 +02:00
parent fa75ca4a65
commit e21a4d81a2
9 changed files with 189 additions and 1 deletions

16
TODO.md
View File

@@ -71,3 +71,19 @@
- [x] Update header.php action URLs
- [x] Commit current state
- [ ] Test all routes (/, /search, /tfe, /repertoire, /apropos, /licence, /media, /live-reload)
# Now: Confirmation email on student form submission
- [x] Create src/StudentEmail.php — builds HTML recap email, extracts email from contact field, uses SmtpRelay to send
- [x] Wire StudentEmail::sendConfirmation() into partage/index.php handleShareLinkSubmission() after successful thesis creation
- [x] Pass email-sent flag via session to /partage/thanks.php
- [x] Update partage/thanks.php — show "email sent" notice with styled green badge when confirmation was sent
- [x] Add "Visiter" (👁 Visit) button to student link action row in acces-etudiante.php
- [x] Add link (target _blank) to /partage/<slug>
- [x] Add .admin-btn-visit / .admin-btn-visit:hover CSS in admin.css
- [x] Add required confirmation_email field to both student forms (partage/index.php + admin/add.php)
- [x] New fieldset at end of form with type="email", required
- [x] ThesisCreateController validates confirmation_email is present and valid
- [x] StudentEmail uses confirmation_email directly (no more extractEmail hack)
- [x] Autofocus mapping added for confirmation_email validation errors