rename thanks.php to recapitulatif.php in admin and partage

This commit is contained in:
Pontoporeia
2026-04-27 20:40:34 +02:00
parent 4d88bd8cc5
commit aca7e7eef8
9 changed files with 18 additions and 13 deletions

View File

@@ -1,5 +1,10 @@
# TFE Access Restriction Feature # TFE Access Restriction Feature
## Renaming
- [x] Rename `thanks.php``recapitulatif.php` in admin and partage (public + templates)
- [x] Update all internal references (routes, includes, header.php, README, controller comment)
## Admin Edit Form — File Management ## Admin Edit Form — File Management
- [x] Add cover image upload/preview/remove to edit.php - [x] Add cover image upload/preview/remove to edit.php
- [x] Add existing thesis files listing with per-file delete checkboxes - [x] Add existing thesis files listing with per-file delete checkboxes

View File

@@ -10,7 +10,7 @@ public/admin/
├── add.php # Add new thesis form ├── add.php # Add new thesis form
├── edit.php # Edit existing thesis form ├── edit.php # Edit existing thesis form
├── import.php # CSV import form ├── import.php # CSV import form
├── thanks.php # Thank you page after submission ├── recapitulatif.php # Recap page after submission
├── actions/ # Backend processing scripts (no HTML output) ├── actions/ # Backend processing scripts (no HTML output)
│ ├── formulaire.php # Process thesis submission from add.php │ ├── formulaire.php # Process thesis submission from add.php
│ └── publish.php # Toggle publish/unpublish status │ └── publish.php # Toggle publish/unpublish status
@@ -30,7 +30,7 @@ Files that display HTML to users:
- **add.php** - Form to add a new thesis - **add.php** - Form to add a new thesis
- **edit.php** - Form to edit an existing thesis - **edit.php** - Form to edit an existing thesis
- **import.php** - CSV import interface - **import.php** - CSV import interface
- **thanks.php** - Success confirmation page - **recapitulatif.php** - Success confirmation page
### Backend Scripts (actions/) ### Backend Scripts (actions/)
Files that process forms and redirect (no HTML output): Files that process forms and redirect (no HTML output):
@@ -47,7 +47,7 @@ Reusable HTML components:
### Adding a Thesis ### Adding a Thesis
1. User visits `add.php` (displays form) 1. User visits `add.php` (displays form)
2. User submits form to `actions/formulaire.php` (processes data) 2. User submits form to `actions/formulaire.php` (processes data)
3. On success, redirects to `thanks.php?id=123` 3. On success, redirects to `recapitulatif.php?id=123`
4. On error, redirects back to `add.php` with error message 4. On error, redirects back to `add.php` with error message
### Publishing/Unpublishing ### Publishing/Unpublishing
@@ -85,7 +85,7 @@ Usage:
- `/admin/add.php` - Add new thesis - `/admin/add.php` - Add new thesis
- `/admin/edit.php?id=123` - Edit thesis #123 - `/admin/edit.php?id=123` - Edit thesis #123
- `/admin/import.php` - Import CSV - `/admin/import.php` - Import CSV
- `/admin/thanks.php?id=123` - Thank you page - `/admin/recapitulatif.php?id=123` - Recap page
Backend actions (not directly accessed): Backend actions (not directly accessed):
- `/admin/actions/formulaire.php` - Form processor - `/admin/actions/formulaire.php` - Form processor

View File

@@ -62,5 +62,5 @@ require_once APP_ROOT . '/templates/head.php';
if (!$studentMode) { if (!$studentMode) {
include APP_ROOT . '/templates/header.php'; include APP_ROOT . '/templates/header.php';
} }
include APP_ROOT . '/templates/admin/thanks.php'; include APP_ROOT . '/templates/admin/recapitulatif.php';
require_once APP_ROOT . '/templates/admin/footer.php'; require_once APP_ROOT . '/templates/admin/footer.php';

View File

@@ -5,7 +5,7 @@
* Routes: * Routes:
* /partage/<slug> — Render the share-link form (or password gate) * /partage/<slug> — Render the share-link form (or password gate)
* /partage/<slug>/submit — POST endpoint for form submissions via share link * /partage/<slug>/submit — POST endpoint for form submissions via share link
* /partage/thanks.php?id=N — Post-submission confirmation page * /partage/recapitulatif.php?id=N — Post-submission confirmation page
*/ */
require_once __DIR__ . '/../../bootstrap.php'; require_once __DIR__ . '/../../bootstrap.php';
@@ -21,10 +21,10 @@ $parts = explode('/', $path);
$slug = $parts[0] ?? ''; $slug = $parts[0] ?? '';
$action = $parts[1] ?? ''; $action = $parts[1] ?? '';
// Special route: /partage/thanks?id=N // Special route: /partage/recapitulatif?id=N
if ($slug === 'thanks' || $slug === 'thanks.php') { if ($slug === 'recapitulatif' || $slug === 'recapitulatif.php') {
App::boot(); App::boot();
require_once __DIR__ . '/thanks.php'; require_once __DIR__ . '/recapitulatif.php';
exit; exit;
} }
@@ -527,7 +527,7 @@ function handleShareLinkSubmission(string $slug): void
$_SESSION['share_email_sent'] = $emailSent; $_SESSION['share_email_sent'] = $emailSent;
// Redirect to thanks page // Redirect to thanks page
header('Location: /partage/thanks?id=' . urlencode((string)$thesisId)); header('Location: /partage/recapitulatif?id=' . urlencode((string)$thesisId));
exit(); exit();
} catch (Exception $e) { } catch (Exception $e) {
$logger->logError('partage', $e->getMessage(), [ $logger->logError('partage', $e->getMessage(), [

View File

@@ -96,7 +96,7 @@ class ThesisCreateController
* Validate and persist a new-thesis POST submission. * Validate and persist a new-thesis POST submission.
* *
* On success, returns the new thesis ID so the caller can redirect to * On success, returns the new thesis ID so the caller can redirect to
* thanks.php?id=<n>. On validation or DB failure, throws an Exception * recapitulatif.php?id=<n>. On validation or DB failure, throws an Exception
* (caller must flash the message and redirect back to the form). * (caller must flash the message and redirect back to the form).
* *
* Execution order: * Execution order:

View File

@@ -195,7 +195,7 @@ document.addEventListener('DOMContentLoaded', () => {
</td> </td>
<td> <td>
<div class="admin-actions"> <div class="admin-actions">
<a href="/admin/thanks.php?id=<?= $thesis['id'] ?>" class="admin-btn-sm admin-btn-view">Voir</a> <a href="/admin/recapitulatif.php?id=<?= $thesis['id'] ?>" class="admin-btn-sm admin-btn-view">Voir</a>
<a href="/admin/edit.php?id=<?= $thesis['id'] ?>" class="admin-btn-sm admin-btn-edit">Éditer</a> <a href="/admin/edit.php?id=<?= $thesis['id'] ?>" class="admin-btn-sm admin-btn-edit">Éditer</a>
<form method="post" action="actions/publish.php" class="publish-form"> <form method="post" action="actions/publish.php" class="publish-form">
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>"> <input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">

View File

@@ -28,7 +28,7 @@ $_thesisId = $_GET['id'] ?? null;
<li><a href="/admin/system.php" <?= in_array($_currentPage, ['system.php', 'status.php', 'logs.php']) ? 'aria-current="page"' : '' ?>>Système</a></li> <li><a href="/admin/system.php" <?= in_array($_currentPage, ['system.php', 'status.php', 'logs.php']) ? 'aria-current="page"' : '' ?>>Système</a></li>
<li><a href="/admin/acces-etudiante.php" <?= $_currentPage === 'acces-etudiante.php' ? 'aria-current="page"' : '' ?>>Accès étudiant·e</a></li> <li><a href="/admin/acces-etudiante.php" <?= $_currentPage === 'acces-etudiante.php' ? 'aria-current="page"' : '' ?>>Accès étudiant·e</a></li>
<li><a href="/admin/parametres.php" <?= $_currentPage === 'parametres.php' ? 'aria-current="page"' : '' ?>>Paramètres</a></li> <li><a href="/admin/parametres.php" <?= $_currentPage === 'parametres.php' ? 'aria-current="page"' : '' ?>>Paramètres</a></li>
<?php if ($_thesisId && in_array($_currentPage, ['edit.php', 'thanks.php'])): ?> <?php if ($_thesisId && in_array($_currentPage, ['edit.php', 'recapitulatif.php'])): ?>
<li><a href="/admin/edit.php?id=<?= intval($_thesisId) ?>" <?= $_currentPage === 'edit.php' ? 'aria-current="page"' : '' ?>>Modifier</a></li> <li><a href="/admin/edit.php?id=<?= intval($_thesisId) ?>" <?= $_currentPage === 'edit.php' ? 'aria-current="page"' : '' ?>>Modifier</a></li>
<?php endif; ?> <?php endif; ?>
<?php if ($_isAdmin && AdminAuth::hasPassword()): ?> <?php if ($_isAdmin && AdminAuth::hasPassword()): ?>