Files
xamxam/TODO.md
Pontoporeia e21a4d81a2 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).
2026-04-20 15:47:55 +02:00

4.6 KiB

TODO

  • Replace inline alert CSS in admin.css with floating bottom-center toast styles (fixed, z-index, animation)

  • Update flash-messages.php partial to output .toast markup in hidden container for footer JS

  • Add toast container HTML + JS to admin footer.php (centralised, 4s auto-dismiss with fade-out)

  • Remove redundant flash-messages.php includes from all admin pages (8 files)

  • Convert hardcoded alerts in login.php, thanks.php, index.php import to .toast class

  • Update admin.css dialog rule from [role=alert/status] to .toast

  • Commit with jj

  • Move DB export from admin/index.php to admin/parametres.php (maintenance section)

  • Reorganize src/ - move 7 controllers to src/Controllers/

    • Create Controllers directory
    • Move controller files (Home, Tfe, Search, ThesisCreate, ThesisEdit, Export, System)
    • Update all require_once paths across codebase
  • Move stray test.db from root to storage/

  • Store admin password hash in DB (site_settings) instead of config file

    • Create migration 013
    • Update AdminAuth to read hash from DB
    • Update bootstrap.php — remove credential file loading
    • Update parametres.php — status check from DB
    • Update actions/account.php — write hash to DB
    • Update login.php — dev-mode check
    • Update header.php — dev check
    • Delete config/admin_credentials.example.php

Now: Single Entry Point Routing

Phase 1: Dispatcher refinement

  • MediaController: extract media.php logic into MediaController class
    • Create src/Controllers/MediaController.php
    • Move path validation + storage jail + MIME check + streaming
    • Wire into Dispatcher for /media route
    • Delete app/public/media.php
  • Update Dispatcher to handle all routes directly (no require APP_ROOT/public/*.php)

Phase 2: Single entry point

  • Create app/public/index.php as front controller

    • Move bootstrap logic into entry point (bootstrap.php stays for admin)
    • Load and invoke Dispatcher
  • Move old public/*.php views into templates/public/

    • search.php → templates/public/search.php
    • tfe.php → templates/public/tfe.php
    • apropos.php → templates/public/about.php
    • repertoire.php → templates/public/repertoire.php
  • Delete old direct-access public/*.php files

    • Delete public/index.php (replaced by front controller)
    • Delete public/search.php
    • Delete public/tfe.php
    • Delete public/apropos.php
    • Delete public/licence.php
    • Delete public/repertoire.php
  • Update Dispatcher.render to use templates/public/ views

  • Update Dispatcher to render full pages (head + header + view + footer) instead of requiring bootstrap

  • Ensure admin/index.php bootstraps its own path (not affected by front controller)

  • Fix config/config.php path mess — inline getDatabasePath() into Database.php, delete config/config.php

Phase 3: Server config

  • Update router.php — route all PHP requests to Dispatcher
  • Update nginx config — point all public routes to index.php via try_files
    • Replace per-file location ~ \.php$ with front-controller pattern
  • Clean URL updates
    • Remove .php from all internal links (header, views, controllers)
    • Add clean routes to Dispatcher (/search, /tfe, /media)
    • Update og:url tags in controllers to use clean URLs
    • Update TfeController redirect to /
    • Update header.php action URLs
  • Commit current state
  • Test all routes (/, /search, /tfe, /repertoire, /apropos, /licence, /media, /live-reload)

Now: Confirmation email on student form submission

  • Create src/StudentEmail.php — builds HTML recap email, extracts email from contact field, uses SmtpRelay to send

  • Wire StudentEmail::sendConfirmation() into partage/index.php handleShareLinkSubmission() after successful thesis creation

  • Pass email-sent flag via session to /partage/thanks.php

  • Update partage/thanks.php — show "email sent" notice with styled green badge when confirmation was sent

  • Add "Visiter" (👁 Visit) button to student link action row in acces-etudiante.php

    • Add link (target _blank) to /partage/
    • Add .admin-btn-visit / .admin-btn-visit:hover CSS in admin.css
  • Add required confirmation_email field to both student forms (partage/index.php + admin/add.php)

    • New fieldset at end of form with type="email", required
    • ThesisCreateController validates confirmation_email is present and valid
    • StudentEmail uses confirmation_email directly (no more extractEmail hack)
    • Autofocus mapping added for confirmation_email validation errors