show_view(intval($_GET['id'])); return; } elseif ($_GET['action'] === 'edit' && isset($_GET['id'])) { $this->show_capacity(intval($_GET['id'])); return; } // Deletion is intentionally not handled here: a state-changing GET is // CSRF-prone. Timetables are deleted via the nonce-authenticated REST // DELETE /timetable/{id} (see the "Trash" action in the list grid). } $this->show_list(); } private function show_list(): void { ?>
Timetable not found.
| Name | = esc_html($timetable->name) ?> |
|---|---|
| Block size | = esc_html($timetable->block_size) ?> minutes |
| Maintainer email | = esc_html($timetable->maintainer_email) ?> |
Not connected to Google Calendar. Connect in settings →
'; } else { return 'Sync reservations to this calendar.
'; } }) ->submit('Save Settings', 'button-primary', 'submit') ->output(); ?>Define capacities for timetable.
create_capacity_form($id); ?> date('date', 'First Date', 'Od kterého datumu platí tato kapacita.', true, new DateTime()->format('Y-m-d')); $form->group('Availability Range', fn($g) => $g ->time('start_time', 'Start') ->time('end_time', 'End') ); $form->number('capacity', 'Capacity', 'How many reservations can overlap on the same time.', true, 1, 1); $form->number('min_lead_time_minutes', 'Minimum lead time (minutes)', 'How many minutes in advance must be the reservation created. This is useful if it takes some time to prepare the reservation.', true); $form->checkbox('requires_confirmation', 'Requires Confirmation?', 'If checked, all the reservations that overlap this capacity will require confirmation from maintainer. The maintainer will receive an email asking for the confirmation.', true); $form->custom('Is Repeating Event', function() { return 'If the capacity is available repeatingly. For example: repeat each monday every week.
'; }); $form->number('repeat_period_in_days', 'Repeat Period (days)', 'How many days between each repetition.', true); $form->custom('Apply to Days', function() { return '| Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday |