Demo follow-ups: editable policy name, one-page signup, group classes in upcoming lessons, deletion cleanup
CI / Tests (PHP 8.1) (pull_request) Successful in 1m0s
CI / Tests (PHP 8.2) (pull_request) Successful in 1m0s
CI / No Debug Code (pull_request) Successful in 3s
CI / Coding Standards (pull_request) Successful in 3m8s
CI / Build Plugin Zip (pull_request) Skipped
CI / PHPStan (pull_request) Successful in 2m49s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m44s
CI / Tests (PHP 8.1) (pull_request) Successful in 1m0s
CI / Tests (PHP 8.2) (pull_request) Successful in 1m0s
CI / No Debug Code (pull_request) Successful in 3s
CI / Coding Standards (pull_request) Successful in 3m8s
CI / Build Plugin Zip (pull_request) Skipped
CI / PHPStan (pull_request) Successful in 2m49s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m44s
Five items from the latest demo pass: - A policy's title can be edited from the Policies screen. Only the title moves; the slug is what the gates resolve policies by, so a rename can never detach a policy from acceptances already recorded against it. - Signup is one page again. The studio's registration questions move from a second step behind "Next" onto the main form, in an "About you" panel above the students being added, and that panel also asks an adult student for their birth year (the same us_birth_year meta a child's uses). register.js disables and hides the whole panel for a pure guardian, since the questions describe a student. - The password is re-scored on submit, not only as it is typed. zxcvbn's dictionary arrives after page load, so a password typed straight away was never scored at all and the first the student heard of it was the server rejecting the whole form. - Group-class sessions appear alongside lessons wherever upcoming lessons are listed: the [us_scheduler] panel (students and instructors) and the admin student detail page. GroupClass\SessionSchedule derives them from Offering::sessionWindows(), the same derivation the billing scan uses. They carry kind = 'group_class' and no Cancel action - a session is one date in a term, not a booked slot. - Deleting a user releases what the account was holding: each upcoming lesson is cancelled, its slot freed for rebooking, its pending payment voided, and active class enrolments cancelled. Past lessons and paid history are left alone. Tests: composer test (851), composer lint, composer cs all pass. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
@@ -70,6 +70,22 @@ if (! defined('ABSPATH')) {
|
||||
<?php if (null !== $selectedPolicy) : ?>
|
||||
<h2><?php echo esc_html(sprintf(/* translators: %s: policy title */ __('Versions of "%s"', 'unsupervised-schedular'), $selectedPolicy->title)); ?></h2>
|
||||
|
||||
<h3><?php esc_html_e('Rename', 'unsupervised-schedular'); ?></h3>
|
||||
<p class="description">
|
||||
<?php
|
||||
/* translators: %s: the policy's slug. */
|
||||
echo esc_html(sprintf(__('The title is what students see above the policy text. Its slug (%s) does not change, so every version already accepted stays attached to this policy.', 'unsupervised-schedular'), $selectedPolicy->slug));
|
||||
?>
|
||||
</p>
|
||||
<form method="post">
|
||||
<?php wp_nonce_field('usc_policy_action'); ?>
|
||||
<input type="hidden" name="usc_action" value="rename_policy">
|
||||
<input type="hidden" name="policy_id" value="<?php echo esc_attr((string) $selectedPolicy->id); ?>">
|
||||
<label class="screen-reader-text" for="usc-policy-title"><?php esc_html_e('Title', 'unsupervised-schedular'); ?></label>
|
||||
<input type="text" name="title" id="usc-policy-title" class="regular-text" maxlength="<?php echo esc_attr((string) Policy::MAX_TITLE_LENGTH); ?>" value="<?php echo esc_attr($selectedPolicy->title); ?>" required>
|
||||
<?php submit_button(esc_html__('Save Title', 'unsupervised-schedular'), 'secondary', 'submit', false); ?>
|
||||
</form>
|
||||
|
||||
<h3><?php esc_html_e('Add Draft Version', 'unsupervised-schedular'); ?></h3>
|
||||
<form method="post">
|
||||
<?php wp_nonce_field('usc_policy_action'); ?>
|
||||
|
||||
@@ -41,7 +41,7 @@ if (! defined('ABSPATH')) {
|
||||
<?php else : ?>
|
||||
<?php if ($accountScope) : ?>
|
||||
<h2><?php esc_html_e('Account signup questions', 'unsupervised-schedular'); ?></h2>
|
||||
<p><?php esc_html_e('Every new student answers these required-if-marked questions as a second step after choosing their name and password.', 'unsupervised-schedular'); ?></p>
|
||||
<p><?php esc_html_e('Every new student answers these required-if-marked questions when they register — the account holder on the signup form itself, and once per student they are registering on behalf of.', 'unsupervised-schedular'); ?></p>
|
||||
<?php else : ?>
|
||||
<h2><?php echo esc_html(sprintf(/* translators: %s: offering title */ __('Questions for "%s"', 'unsupervised-schedular'), $selectedOffering->title)); ?></h2>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -5,10 +5,12 @@ if (! defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use Unsupervised\Schedular\GroupClass\SessionSchedule;
|
||||
|
||||
/**
|
||||
* @var \WP_User $student
|
||||
* @var list<array{id: int, start_dt: string, end_dt: string, offering: string, instructor: string, status: string}> $upcoming
|
||||
* @var list<array{id: int, start_dt: string, end_dt: string, offering: string, instructor: string, status: string}> $past
|
||||
* @var list<array{id: int, kind: string, start_dt: string, end_dt: string, offering: string, instructor: string, status: string}> $upcoming Booked lessons and upcoming group-class sessions, soonest first.
|
||||
* @var list<array{id: int, kind: string, start_dt: string, end_dt: string, offering: string, instructor: string, status: string}> $past
|
||||
* @var list<array{id: int, offering: string, status: string}> $enrolments
|
||||
* @var list<array{policy: string, version: string, context: string, accepted_at: string}> $acceptances
|
||||
* @var list<array{question: string, answer: string, required: bool}> $registrationInfo
|
||||
@@ -49,14 +51,27 @@ $renderLessons = static function (array $rows, bool $withActions = false): void
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($rows as $row) : ?>
|
||||
<?php $isGroupSession = ($row['kind'] ?? 'lesson') === SessionSchedule::KIND; ?>
|
||||
<tr>
|
||||
<td><?php echo esc_html($row['start_dt'] !== '' ? (string) mysql2date('M j, Y g:i A', $row['start_dt']) : '—'); ?></td>
|
||||
<td><?php echo esc_html($row['offering']); ?></td>
|
||||
<td>
|
||||
<?php echo esc_html($row['offering']); ?>
|
||||
<?php if ($isGroupSession) : ?>
|
||||
<span class="description">— <?php esc_html_e('group class', 'unsupervised-schedular'); ?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?php echo esc_html($row['instructor']); ?></td>
|
||||
<td><?php echo esc_html($row['status']); ?></td>
|
||||
<?php if ($withActions) : ?>
|
||||
<td>
|
||||
<?php if ($row['status'] !== 'cancelled') : ?>
|
||||
<?php
|
||||
/*
|
||||
* A group-class session is one date in a term, not a booked
|
||||
* slot: there is nothing to cancel session by session. The
|
||||
* whole enrolment is withdrawn from the table below.
|
||||
*/
|
||||
?>
|
||||
<?php if (! $isGroupSession && $row['status'] !== 'cancelled') : ?>
|
||||
<form method="post" style="display:inline">
|
||||
<?php wp_nonce_field('usc_student_actions'); ?>
|
||||
<input type="hidden" name="usc_action" value="cancel_lesson">
|
||||
|
||||
Reference in New Issue
Block a user