Editable policy name, one-page signup with adult birth year, group classes in upcoming lessons, and booking cleanup on user delete #161
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -114,6 +114,8 @@ $renderLessons = static function (array $rows, bool $withActions = false): void
|
||||
<div class="notice notice-error is-dismissible"><p><?php echo esc_html($error); ?></p></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $detailUrl = static fn(int $id): string => add_query_arg(['page' => $pageSlug, 'student_id' => $id], admin_url('admin.php')); ?>
|
||||
|
||||
<h2><?php esc_html_e('Account', 'unsupervised-schedular'); ?></h2>
|
||||
<form method="post">
|
||||
<?php wp_nonce_field('usc_student_actions'); ?>
|
||||
@@ -131,24 +133,32 @@ $renderLessons = static function (array $rows, bool $withActions = false): void
|
||||
<th><?php esc_html_e('Registered', 'unsupervised-schedular'); ?></th>
|
||||
<td><?php echo esc_html($student->user_registered); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
/*
|
||||
* Always rendered, both ways round. "Books for themselves" is a fact
|
||||
* worth stating outright: an empty row would be indistinguishable
|
||||
* from a guardian the page failed to look up.
|
||||
*/
|
||||
?>
|
||||
<tr>
|
||||
<th><?php esc_html_e('Booked by', 'unsupervised-schedular'); ?></th>
|
||||
<td>
|
||||
<?php if ($guardian !== null) : ?>
|
||||
<?php // The name alone. Their address is one click away on their own page, and repeating it here only makes the row harder to scan. ?>
|
||||
<a href="<?php echo esc_url($detailUrl($guardian['id'])); ?>"><?php echo esc_html($guardian['name']); ?></a>
|
||||
<?php else : ?>
|
||||
<span class="description"><?php esc_html_e('Nobody — this student books and pays for themselves.', 'unsupervised-schedular'); ?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php submit_button(esc_html__('Save account details', 'unsupervised-schedular'), 'secondary', 'submit', false); ?>
|
||||
</form>
|
||||
|
||||
<?php if ($guardian !== null || ! empty($children)) : ?>
|
||||
<h2><?php esc_html_e('Profile', 'unsupervised-schedular'); ?></h2>
|
||||
<?php $detailUrl = static fn(int $id): string => add_query_arg(['page' => $pageSlug, 'student_id' => $id], admin_url('admin.php')); ?>
|
||||
<?php if ($guardian !== null) : ?>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: linked name of the parent/guardian, 2: their email address. */
|
||||
esc_html__('Books and pays through %1$s (%2$s).', 'unsupervised-schedular'),
|
||||
'<a href="' . esc_url($detailUrl($guardian['id'])) . '">' . esc_html($guardian['name']) . '</a>',
|
||||
esc_html($guardian['email'])
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<?php // Who they book through is up in Account; this explains the placeholder email. ?>
|
||||
<p class="description"><?php esc_html_e('This is a managed student account: it has no login of its own, and its email address is a placeholder that cannot receive mail.', 'unsupervised-schedular'); ?></p>
|
||||
<?php endif; ?>
|
||||
<?php if (! empty($children)) : ?>
|
||||
|
||||
Reference in New Issue
Block a user