From 122f7a0f53c07c0c293761cb3d44cb78f57703bb Mon Sep 17 00:00:00 2001 From: James Griffin Date: Thu, 30 Jul 2026 12:18:42 -0300 Subject: [PATCH] Show "Booked by" in the Account section of a student's detail page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The parent/guardian was only named further down under Profile, where it reads as background rather than as an account fact, and only when there was one — so a page with no such line was ambiguous between "books for themselves" and "the lookup found nothing". It now sits in the Account table beside display name and email, as the guardian's name linked to their own detail page, and always renders: a student who books for themselves says so outright. No email address — theirs is one click away on their own page, and repeating it here only makes the row harder to scan. The Profile section keeps only the note explaining the placeholder email, which is a different point. Tests: composer test (863), composer lint, composer cs all pass. Co-Authored-By: Claude Opus 5 --- CHANGELOG.md | 1 + docs/features/student-administration.md | 6 ++++- templates/admin/student-detail.php | 32 ++++++++++++++++--------- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5577b8..e967d1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ each change under the current top section as you work. ### Added - **Group classes now appear in "Your upcoming lessons".** A class is stored as a term rather than as bookable slots, so nothing that listed lessons could ever show one — a student whose whole term was a group class saw an empty schedule, and an instructor teaching one saw nothing on their My Lessons page. Each remaining session of a class you are enrolled in now sorts in among your lessons by date, labelled **group class**; instructors see every session of the classes they teach, one row per session however many students are in it. A session has no Cancel button, because there is no such thing as cancelling one date of a term — withdrawing from the class is still done from the class page. - A class you are enrolled in shows up **whether or not its schedule is pinned to a clock**. Class time and duration are both optional on the offering form, and the schedule note is there so a studio can simply write "Tuesdays 4:00pm" — so a class with a time but no duration lists its dates and says when each session starts rather than guessing when it ends, and a class with no time at all gets a single row carrying its schedule note (or its term dates) where the time would go. Only a class whose last day has passed drops off the list. +- A student's admin detail page now shows **Booked by** in the Account section — the name of the parent or guardian who books and pays for them, linked to their own page. It was only stated further down under Profile, and only when there was one; the row is now always there, saying in words when a student books for themselves. - The same group-class sessions now appear in **Upcoming lessons** on a student's admin detail page, so one table answers "what are they booked into next week?". Only upcoming ones — the **Group-class enrolments** table below already holds the history. - **A policy can be renamed.** The title was fixed at creation, so a typo or a change of wording meant creating a second policy and re-collecting everyone's acceptance. Renaming changes only what students read above the policy text: the slug stays put, so every version already accepted stays attached. diff --git a/docs/features/student-administration.md b/docs/features/student-administration.md index f2b2bf1..f378203 100644 --- a/docs/features/student-administration.md +++ b/docs/features/student-administration.md @@ -24,7 +24,11 @@ No new tables. The views are composed from existing data: quick counts (upcoming lessons, active group enrolments). Each row links to the detail view. - **Detail** (`?student_id=`): - - **Account** — display name, email, registered date. + - **Account** — display name, email, registered date, and **Booked by**: the + name of the parent/guardian who books and pays for this student, linked to + their own detail page. Always rendered — a student who books for themselves + says so in words, so an empty row can never be mistaken for a lookup that + failed. - **Upcoming lessons** and **Past lessons** — split by the linked availability slot's `start_dt`; each shows date/time, offering, instructor, and status. **Upcoming lessons** also lists the student's upcoming group-class sessions diff --git a/templates/admin/student-detail.php b/templates/admin/student-detail.php index 24a21df..cfac62b 100644 --- a/templates/admin/student-detail.php +++ b/templates/admin/student-detail.php @@ -114,6 +114,8 @@ $renderLessons = static function (array $rows, bool $withActions = false): void

+ add_query_arg(['page' => $pageSlug, 'student_id' => $id], admin_url('admin.php')); ?> +

@@ -131,24 +133,32 @@ $renderLessons = static function (array $rows, bool $withActions = false): void user_registered); ?> + + + + + + + + + + + +

- add_query_arg(['page' => $pageSlug, 'student_id' => $id], admin_url('admin.php')); ?> -

- ' . esc_html($guardian['name']) . '', - esc_html($guardian['email']) - ); - ?> -

+