Skip to content

Feature: Add bulk booking option for students - #72

Open
Smartlearn-edu wants to merge 3 commits into
learnweb:masterfrom
Smartlearn-edu:master
Open

Feature: Add bulk booking option for students#72
Smartlearn-edu wants to merge 3 commits into
learnweb:masterfrom
Smartlearn-edu:master

Conversation

@Smartlearn-edu

Copy link
Copy Markdown

Summary

Add a per-activity setting that allows students to book all available slots at once with a single click, instead of booking them individually.

Changes

New activity setting

  • Added "Enable bulk booking" (Yes/No) option under the activity settings form
  • When enabled, the appointment mode (booking limit) settings are automatically disabled

Student interface

  • When bulk booking is enabled, a prominent "Book all available slots" button is displayed at the top of the available slots list
  • Individual "Book slot" buttons are hidden to guide students toward the bulk action
  • The slot table remains visible so students can review available slots before booking

Backend

  • New bulkbook field added to the scheduler database table
  • count_bookable_appointments() returns unlimited (-1) when bulk booking is active
  • New bookallslots controller action that iterates all available slots, creates appointments directly, triggers booking events, and sends teacher notifications
  • Proper validation: checks slot capacity, bookable period, and prevents duplicate bookings

Database

  • Schema updated in install.xml and upgrade.php (version 2026040300)

Language strings

  • bulkbook, bulkbook_help, bookallslots, bulkbook_message

Technical note

Avoided using PHP's empty() on model properties because the plugin's mvc_record_model class uses __get() magic without implementing __isset(), which causes empty() to always return true. Used direct property access with (bool) casting instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant