From 978e15178ec04eac6d264a2b30dc3661561c5a7a Mon Sep 17 00:00:00 2001 From: Riedler Date: Fri, 10 Oct 2025 20:12:35 +0200 Subject: [PATCH 1/4] fix: API function descriptions --- lbplanner/db/services.php | 74 +++++++++---------- lbplanner/services/config/get_version.php | 4 +- .../services/courses/get_all_courses.php | 4 +- lbplanner/services/courses/get_my_courses.php | 4 +- lbplanner/services/courses/update_course.php | 4 +- lbplanner/services/kanban/get_board.php | 2 +- .../modules/get_all_course_modules.php | 4 +- .../services/modules/get_all_modules.php | 2 +- lbplanner/services/modules/get_module.php | 2 +- .../notifications/get_all_notifications.php | 4 +- lbplanner/services/plan/accept_invite.php | 4 +- lbplanner/services/plan/clear_plan.php | 4 +- lbplanner/services/plan/decline_invite.php | 2 +- lbplanner/services/plan/delete_deadline.php | 4 +- lbplanner/services/plan/get_invites.php | 4 +- lbplanner/services/plan/get_plan.php | 2 +- lbplanner/services/plan/leave_plan.php | 8 +- lbplanner/services/slots/book_reservation.php | 4 +- lbplanner/services/slots/delete_slot.php | 2 +- lbplanner/services/slots/get_all_slots.php | 1 - .../services/slots/get_my_reservations.php | 3 +- lbplanner/services/slots/get_my_slots.php | 5 +- .../services/slots/get_student_slots.php | 5 +- .../services/slots/get_supervisor_slots.php | 4 +- .../services/slots/unbook_reservation.php | 4 +- lbplanner/services/user/delete_user.php | 2 - lbplanner/services/user/get_all_users.php | 4 +- lbplanner/services/user/get_user.php | 6 +- lbplanner/services/user/update_user.php | 4 +- 29 files changed, 85 insertions(+), 91 deletions(-) diff --git a/lbplanner/db/services.php b/lbplanner/db/services.php index 6e8d8460..3a5bc590 100644 --- a/lbplanner/db/services.php +++ b/lbplanner/db/services.php @@ -30,7 +30,7 @@ 'classname' => 'local_lbplanner_services\user_get_user', 'methodname' => 'get_user', 'classpath' => 'local/lbplanner/services/user/get_user.php', - 'description' => 'Get the data for a user', + 'description' => 'Returns current userdata', 'type' => 'read', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -39,7 +39,7 @@ 'classname' => 'local_lbplanner_services\user_get_all_users', 'methodname' => 'get_all_users', 'classpath' => 'local/lbplanner/services/user/get_all_users.php', - 'description' => 'Gets all users registered by the lbplanner app', + 'description' => 'Returns all users, optionally filtered by vintage', 'type' => 'read', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -48,7 +48,7 @@ 'classname' => 'local_lbplanner_services\user_update_user', 'methodname' => 'update_user', 'classpath' => 'local/lbplanner/services/user/update_user.php', - 'description' => 'Update the data for a user. null values or unset parameters are left unmodified', + 'description' => 'Update current user settings. null values or unset parameters are left unmodified', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -57,7 +57,7 @@ 'classname' => 'local_lbplanner_services\courses_get_all_courses', 'methodname' => 'get_all_courses', 'classpath' => 'local/lbplanner/services/courses/get_all_courses.php', - 'description' => 'Get all courses', + 'description' => 'Returns ALL courses', 'type' => 'read', 'capabilities' => 'local/lb_planner:slotmaster', 'ajax' => true, @@ -66,7 +66,7 @@ 'classname' => 'local_lbplanner_services\courses_get_my_courses', 'methodname' => 'get_my_courses', 'classpath' => 'local/lbplanner/services/courses/get_my_courses.php', - 'description' => 'Get courses that belong to the user', + 'description' => 'Returns courses visible to this user', 'type' => 'read', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -75,7 +75,7 @@ 'classname' => 'local_lbplanner_services\courses_update_course', 'methodname' => 'update_course', 'classpath' => 'local/lbplanner/services/courses/update_course.php', - 'description' => 'Update the data for a course', + 'description' => 'Update the user-specific data for a course', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -84,7 +84,7 @@ 'classname' => 'local_lbplanner_services\modules_get_module', 'methodname' => 'get_module', 'classpath' => 'local/lbplanner/services/modules/get_module.php', - 'description' => 'Get the data for a module', + 'description' => 'Returns the data for a module', 'type' => 'read', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -93,7 +93,7 @@ 'classname' => 'local_lbplanner_services\modules_get_all_modules', 'methodname' => 'get_all_modules', 'classpath' => 'local/lbplanner/services/modules/get_all_modules.php', - 'description' => 'Get all the modules of the current year', + 'description' => 'Returns all the modules for a user', 'type' => 'read', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -102,7 +102,7 @@ 'classname' => 'local_lbplanner_services\modules_get_all_course_modules', 'methodname' => 'get_all_course_modules', 'classpath' => 'local/lbplanner/services/modules/get_all_course_modules.php', - 'description' => 'Get all the modules of the given course', + 'description' => 'Returns all modules belonging to a course', 'type' => 'read', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -111,7 +111,7 @@ 'classname' => 'local_lbplanner_services\plan_clear_plan', 'methodname' => 'clear_plan', 'classpath' => 'local/lbplanner/services/plan/clear_plan.php', - 'description' => 'Clear the plan for the given user', + 'description' => 'Clears your current plan', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -120,7 +120,7 @@ 'classname' => 'local_lbplanner_services\plan_get_plan', 'methodname' => 'get_plan', 'classpath' => 'local/lbplanner/services/plan/get_plan.php', - 'description' => 'Get the plan of the given user', + 'description' => 'Returns the plan of the current user', 'type' => 'read', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -129,7 +129,7 @@ 'classname' => 'local_lbplanner_services\plan_invite_user', 'methodname' => 'invite_user', 'classpath' => 'local/lbplanner/services/plan/invite_user.php', - 'description' => 'Invite a user to the plan', + 'description' => 'Invite a user to the current user\'s plan', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -138,7 +138,7 @@ 'classname' => 'local_lbplanner_services\plan_remove_user', 'methodname' => 'remove_user', 'classpath' => 'local/lbplanner/services/plan/remove_user.php', - 'description' => 'Remove a user from the plan', + 'description' => 'Remove a user from your plan', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -147,7 +147,7 @@ 'classname' => 'local_lbplanner_services\plan_update_plan', 'methodname' => 'update_plan', 'classpath' => 'local/lbplanner/services/plan/update_plan.php', - 'description' => 'Update the plan of the given user', + 'description' => 'Update the plan details', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -156,7 +156,7 @@ 'classname' => 'local_lbplanner_services\plan_leave_plan', 'methodname' => 'leave_plan', 'classpath' => 'local/lbplanner/services/plan/leave_plan.php', - 'description' => 'Leave the plan of the given user', + 'description' => 'Leave current plan. If no other user exists in the plan, the user can\'t leave', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -165,7 +165,7 @@ 'classname' => 'local_lbplanner_services\plan_delete_deadline', 'methodname' => 'delete_deadline', 'classpath' => 'local/lbplanner/services/plan/delete_deadline.php', - 'description' => 'Delete a deadline from the plan', + 'description' => 'Deletes a deadline from your plan', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -183,7 +183,7 @@ 'classname' => 'local_lbplanner_services\plan_set_deadline', 'methodname' => 'set_deadline', 'classpath' => 'local/lbplanner/services/plan/set_deadline.php', - 'description' => 'Set a deadline from the plan', + 'description' => 'Set the deadline for a module', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -201,7 +201,7 @@ 'classname' => 'local_lbplanner_services\plan_get_invites', 'methodname' => 'get_invites', 'classpath' => 'local/lbplanner/services/plan/get_invites.php', - 'description' => 'Get all the invites of the given user', + 'description' => 'Returns all invites for this user', 'type' => 'read', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -210,7 +210,7 @@ 'classname' => 'local_lbplanner_services\notifications_get_all_notifications', 'methodname' => 'get_all_notifications', 'classpath' => 'local/lbplanner/services/notifications/get_all_notifications.php', - 'description' => 'Get all the notifications of the given user', + 'description' => 'Returns all notifications for this user', 'type' => 'read', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -219,7 +219,7 @@ 'classname' => 'local_lbplanner_services\notifications_update_notification', 'methodname' => 'update_notification', 'classpath' => 'local/lbplanner/services/notifications/update_notification.php', - 'description' => 'Update the notification status of the given user and id', + 'description' => 'Update the notification status', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -228,7 +228,7 @@ 'classname' => 'local_lbplanner_services\plan_accept_invite', 'methodname' => 'accept_invite', 'classpath' => 'local/lbplanner/services/plan/accept_invite.php', - 'description' => 'Accept the invite of the given id', + 'description' => 'Accept an invite', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -237,7 +237,7 @@ 'classname' => 'local_lbplanner_services\plan_decline_invite', 'methodname' => 'decline_invite', 'classpath' => 'local/lbplanner/services/plan/decline_invite.php', - 'description' => 'Decline the invite of the given id', + 'description' => 'Decline an invite', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -246,7 +246,7 @@ 'classname' => 'local_lbplanner_services\config_get_version', 'methodname' => 'get_version', 'classpath' => 'local/lbplanner/services/config/get_version.php', - 'description' => 'Get the version of the plugin', + 'description' => 'Returns the version of the plugin', 'type' => 'read', 'capabilities' => '', 'ajax' => true, @@ -255,7 +255,7 @@ 'classname' => 'local_lbplanner_services\slots_get_my_slots', 'methodname' => 'get_my_slots', 'classpath' => 'local/lbplanner/services/slots/get_my_slots.php', - 'description' => 'Get all slots the user can theoretically reserve.', + 'description' => 'Returns all slots the user can reserve, not including already-reserved ones', 'type' => 'read', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -264,7 +264,7 @@ 'classname' => 'local_lbplanner_services\slots_get_student_slots', 'methodname' => 'get_student_slots', 'classpath' => 'local/lbplanner/services/slots/get_student_slots.php', - 'description' => 'Get all slots a supervisor can theoretically reserve for a student.', + 'description' => 'Returns all slots a supervisor can reserve for a user, not including already-reserved ones', 'type' => 'read', 'capabilities' => 'local/lb_planner:teacher', 'ajax' => true, @@ -273,7 +273,7 @@ 'classname' => 'local_lbplanner_services\slots_get_supervisor_slots', 'methodname' => 'get_supervisor_slots', 'classpath' => 'local/lbplanner/services/slots/get_supervisor_slots.php', - 'description' => 'Get all slots belonging to the supervisor.', + 'description' => 'Returns all slots belonging to the supervisor', 'type' => 'read', 'capabilities' => 'local/lb_planner:teacher', 'ajax' => true, @@ -282,7 +282,7 @@ 'classname' => 'local_lbplanner_services\slots_get_all_slots', 'methodname' => 'get_all_slots', 'classpath' => 'local/lbplanner/services/slots/get_all_slots.php', - 'description' => 'Get all slots.', + 'description' => 'Returns all slots', 'type' => 'read', 'capabilities' => 'local/lb_planner:slotmaster', 'ajax' => true, @@ -291,7 +291,7 @@ 'classname' => 'local_lbplanner_services\slots_book_reservation', 'methodname' => 'book_reservation', 'classpath' => 'local/lbplanner/services/slots/book_reservation.php', - 'description' => 'Book a reservation', + 'description' => 'Books a reservation for the user. Will unbook any overlapping reservations the user may already have', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -300,7 +300,7 @@ 'classname' => 'local_lbplanner_services\slots_unbook_reservation', 'methodname' => 'unbook_reservation', 'classpath' => 'local/lbplanner/services/slots/unbook_reservation.php', - 'description' => 'Unbook a reservation', + 'description' => 'Tries to request unbooking a reservation', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -309,7 +309,7 @@ 'classname' => 'local_lbplanner_services\slots_get_slot_reservations', 'methodname' => 'get_slot_reservations', 'classpath' => 'local/lbplanner/services/slots/get_slot_reservations.php', - 'description' => 'Get reservations for a slot', + 'description' => 'Returns all reservations for a slot', 'type' => 'write', 'capabilities' => 'local/lb_planner:teacher', 'ajax' => true, @@ -318,7 +318,7 @@ 'classname' => 'local_lbplanner_services\slots_get_my_reservations', 'methodname' => 'get_my_reservations', 'classpath' => 'local/lbplanner/services/slots/get_my_reservations.php', - 'description' => 'Get reservations for this user', + 'description' => 'Returns all reservations for this user', 'type' => 'write', 'capabilities' => 'local/lb_planner:student', 'ajax' => true, @@ -345,7 +345,7 @@ 'classname' => 'local_lbplanner_services\slots_delete_slot', 'methodname' => 'delete_slot', 'classpath' => 'local/lbplanner/services/slots/delete_slot.php', - 'description' => 'Delete a slot', + 'description' => 'Deletes slot', 'type' => 'write', 'capabilities' => 'local/lb_planner:slotmaster', 'ajax' => true, @@ -354,7 +354,7 @@ 'classname' => 'local_lbplanner_services\slots_add_slot_supervisor', 'methodname' => 'add_slot_supervisor', 'classpath' => 'local/lbplanner/services/slots/add_slot_supervisor.php', - 'description' => 'Add supervisor to a slot', + 'description' => 'Adds a supervisor to a slot', 'type' => 'write', 'capabilities' => 'local/lb_planner:slotmaster', 'ajax' => true, @@ -363,7 +363,7 @@ 'classname' => 'local_lbplanner_services\slots_remove_slot_supervisor', 'methodname' => 'remove_slot_supervisor', 'classpath' => 'local/lbplanner/services/slots/remove_slot_supervisor.php', - 'description' => 'Removes supervisor from a slot', + 'description' => 'Removes a supervisor from a slot', 'type' => 'write', 'capabilities' => 'local/lb_planner:slotmaster', 'ajax' => true, @@ -372,7 +372,7 @@ 'classname' => 'local_lbplanner_services\slots_add_slot_filter', 'methodname' => 'add_slot_filter', 'classpath' => 'local/lbplanner/services/slots/add_slot_filter.php', - 'description' => 'Add a slot filter', + 'description' => 'Creates a new filter and adds it to a slot', 'type' => 'write', 'capabilities' => 'local/lb_planner:slotmaster', 'ajax' => true, @@ -381,7 +381,7 @@ 'classname' => 'local_lbplanner_services\slots_delete_slot_filter', 'methodname' => 'delete_slot_filter', 'classpath' => 'local/lbplanner/services/slots/delete_slot_filter.php', - 'description' => 'Delete a slot filter', + 'description' => 'Delete a filter from a slot', 'type' => 'write', 'capabilities' => 'local/lb_planner:slotmaster', 'ajax' => true, @@ -390,7 +390,7 @@ 'classname' => 'local_lbplanner_services\slots_get_slot_filters', 'methodname' => 'get_slot_filters', 'classpath' => 'local/lbplanner/services/slots/get_slot_filters.php', - 'description' => 'Returns all filters associated with a slot', + 'description' => 'List all filters that apply to a slot', 'type' => 'read', 'capabilities' => 'local/lb_planner:slotmaster', 'ajax' => true, diff --git a/lbplanner/services/config/get_version.php b/lbplanner/services/config/get_version.php index 10c426ac..72740eca 100644 --- a/lbplanner/services/config/get_version.php +++ b/lbplanner/services/config/get_version.php @@ -19,7 +19,7 @@ use core_external\{external_api, external_function_parameters, external_single_structure, external_value}; /** - * Get version service. + * Returns the version of the plugin. * * @package local_lbplanner * @subpackage services_config @@ -38,7 +38,7 @@ public static function get_version_parameters(): external_function_parameters { } /** - * Returns the version. + * Returns the version of the plugin. * * @return array containing the version */ diff --git a/lbplanner/services/courses/get_all_courses.php b/lbplanner/services/courses/get_all_courses.php index 4f71caea..b74e01cb 100644 --- a/lbplanner/services/courses/get_all_courses.php +++ b/lbplanner/services/courses/get_all_courses.php @@ -23,7 +23,7 @@ use local_lbplanner\model\user; /** - * Get ALL courses. Slotmaster only. + * Returns ALL courses. * * @package local_lbplanner * @subpackage services_courses @@ -41,7 +41,7 @@ public static function get_all_courses_parameters(): external_function_parameter } /** - * Get ALL courses. + * Returns ALL courses. */ public static function get_all_courses(): array { global $USER; diff --git a/lbplanner/services/courses/get_my_courses.php b/lbplanner/services/courses/get_my_courses.php index 8263c7dd..148067f3 100644 --- a/lbplanner/services/courses/get_my_courses.php +++ b/lbplanner/services/courses/get_my_courses.php @@ -22,7 +22,7 @@ use local_lbplanner\model\course; /** - * Get all the courses of the current year. + * Returns courses visible to this user. * * @package local_lbplanner * @subpackage services_courses @@ -40,7 +40,7 @@ public static function get_my_courses_parameters(): external_function_parameters } /** - * Get all the courses of the current year. + * Returns courses visible to this user. */ public static function get_my_courses(): array { $courses = course_helper::get_eduplanner_courses(true); diff --git a/lbplanner/services/courses/update_course.php b/lbplanner/services/courses/update_course.php index 0463fa6a..32ccd10f 100644 --- a/lbplanner/services/courses/update_course.php +++ b/lbplanner/services/courses/update_course.php @@ -21,7 +21,7 @@ use moodle_exception; /** - * Update the data for a course. + * Update the user-specific data for a course. * * @package local_lbplanner * @subpackage services_courses @@ -48,7 +48,7 @@ public static function update_course_parameters(): external_function_parameters } /** - * Update the User-data for a course. + * Update the user-specific data for a course. * @param int $courseid The id of the course * @param string $color The color of the course * @param string $shortname The shortname of the course diff --git a/lbplanner/services/kanban/get_board.php b/lbplanner/services/kanban/get_board.php index ae275e82..337eacb1 100644 --- a/lbplanner/services/kanban/get_board.php +++ b/lbplanner/services/kanban/get_board.php @@ -45,7 +45,7 @@ public static function get_board_parameters(): external_function_parameters { } /** - * Gets all the entries on this user's board. + * Returns all entries in the kanban board for the current user. */ public static function get_board(): array { global $USER; diff --git a/lbplanner/services/modules/get_all_course_modules.php b/lbplanner/services/modules/get_all_course_modules.php index 95196423..8fbc0ec4 100644 --- a/lbplanner/services/modules/get_all_course_modules.php +++ b/lbplanner/services/modules/get_all_course_modules.php @@ -22,7 +22,7 @@ use local_lbplanner\model\module; /** - * Get all the modules of the given course. + * Returns all modules belonging to a course. * * @package local_lbplanner * @subpackage services_modules @@ -48,7 +48,7 @@ public static function get_all_course_modules_parameters(): external_function_pa } /** - * Returns all the modules inside a course. + * Returns all modules belonging to a course. * * @param int $courseid The ID of the course * @param bool $ekenabled whether or not to include ek modules diff --git a/lbplanner/services/modules/get_all_modules.php b/lbplanner/services/modules/get_all_modules.php index 08055ea2..87ae537f 100644 --- a/lbplanner/services/modules/get_all_modules.php +++ b/lbplanner/services/modules/get_all_modules.php @@ -21,7 +21,7 @@ use local_lbplanner\model\module; /** - * Get all the modules of the current year. + * Returns all the modules for a user. * * @package local_lbplanner * @subpackage services_modules diff --git a/lbplanner/services/modules/get_module.php b/lbplanner/services/modules/get_module.php index 1383d6ff..9fde0d01 100644 --- a/lbplanner/services/modules/get_module.php +++ b/lbplanner/services/modules/get_module.php @@ -20,7 +20,7 @@ use local_lbplanner\model\module; /** - * Get the data for a module. + * Returns the data for a module. * * @package local_lbplanner * @subpackage services_modules diff --git a/lbplanner/services/notifications/get_all_notifications.php b/lbplanner/services/notifications/get_all_notifications.php index 0426cd2f..b1ebe094 100644 --- a/lbplanner/services/notifications/get_all_notifications.php +++ b/lbplanner/services/notifications/get_all_notifications.php @@ -20,7 +20,7 @@ use local_lbplanner\helpers\notifications_helper; /** - * Get all the notifications of the user. + * Returns all notifications for this user. * * @package local_lbplanner * @subpackage services_notifications @@ -37,7 +37,7 @@ public static function get_all_notifications_parameters(): external_function_par } /** - * Returns all the notifications of the user + * Returns all notifications for this user. * * @return array */ diff --git a/lbplanner/services/plan/accept_invite.php b/lbplanner/services/plan/accept_invite.php index 2e28c200..9fb6b554 100644 --- a/lbplanner/services/plan/accept_invite.php +++ b/lbplanner/services/plan/accept_invite.php @@ -23,7 +23,7 @@ use local_lbplanner\helpers\invite_helper; /** - * Accept an invite to the plan. + * Accept an invite. * * @package local_lbplanner * @subpackage services_plan @@ -42,7 +42,7 @@ public static function accept_invite_parameters(): external_function_parameters } /** - * Accepts an invite + * Accept an invite. * * @param int $inviteid the ID of the invite to be accepted * @return void diff --git a/lbplanner/services/plan/clear_plan.php b/lbplanner/services/plan/clear_plan.php index f311b7c8..b35daf8e 100644 --- a/lbplanner/services/plan/clear_plan.php +++ b/lbplanner/services/plan/clear_plan.php @@ -20,7 +20,7 @@ use local_lbplanner\helpers\plan_helper; /** - * Clear the plan for the given user. + * Clears your current plan. * * @package local_lbplanner * @subpackage services_plan @@ -37,7 +37,7 @@ public static function clear_plan_parameters(): external_function_parameters { } /** - * Clear the plan. + * Clears your current plan. * * @return void * @throws Exception when access denied diff --git a/lbplanner/services/plan/decline_invite.php b/lbplanner/services/plan/decline_invite.php index 608b0b8b..3281548a 100644 --- a/lbplanner/services/plan/decline_invite.php +++ b/lbplanner/services/plan/decline_invite.php @@ -21,7 +21,7 @@ use local_lbplanner\enums\{NOTIF_TRIGGER, PLAN_INVITE_STATE}; /** - * Decline an invite from the plan. + * Decline an invite. * * @package local_lbplanner * @subpackage services_plan diff --git a/lbplanner/services/plan/delete_deadline.php b/lbplanner/services/plan/delete_deadline.php index 83d5263a..d56fb7a3 100644 --- a/lbplanner/services/plan/delete_deadline.php +++ b/lbplanner/services/plan/delete_deadline.php @@ -20,7 +20,7 @@ use local_lbplanner\helpers\plan_helper; /** - * Delete a deadline from your plan + * Deletes a deadline from your plan. * * @package local_lbplanner * @subpackage services_plan @@ -45,7 +45,7 @@ public static function delete_deadline_parameters(): external_function_parameter } /** - * Delete a deadline. + * Deletes a deadline from your plan. * * @param int $moduleid ID of the Module * @return void diff --git a/lbplanner/services/plan/get_invites.php b/lbplanner/services/plan/get_invites.php index fa0cbe7d..82a78892 100644 --- a/lbplanner/services/plan/get_invites.php +++ b/lbplanner/services/plan/get_invites.php @@ -21,7 +21,7 @@ use local_lbplanner\helpers\plan_helper; /** - * Get all the invites of the current user. + * Returns all invites for this user. * * @package local_lbplanner * @subpackage services_plan @@ -38,7 +38,7 @@ public static function get_invites_parameters(): external_function_parameters { } /** - * Returns all invites of the current user. + * Returns all invites for this user. * * @return array */ diff --git a/lbplanner/services/plan/get_plan.php b/lbplanner/services/plan/get_plan.php index 3ad725af..0a6972d4 100644 --- a/lbplanner/services/plan/get_plan.php +++ b/lbplanner/services/plan/get_plan.php @@ -20,7 +20,7 @@ use local_lbplanner\helpers\plan_helper; /** - * Get the plan of the given user. + * Returns the plan of the current user. * * @package local_lbplanner * @subpackage services_plan diff --git a/lbplanner/services/plan/leave_plan.php b/lbplanner/services/plan/leave_plan.php index 2a77868f..b7637088 100644 --- a/lbplanner/services/plan/leave_plan.php +++ b/lbplanner/services/plan/leave_plan.php @@ -22,9 +22,8 @@ use local_lbplanner\enums\{NOTIF_TRIGGER, PLAN_ACCESS_TYPE, PLAN_INVITE_STATE}; /** - * Leave your plan - * - * if no other user exists in the plan, the user can't leave + * Leave current plan. + * If no other user exists in the plan, the user can't leave. * * @package local_lbplanner * @subpackage services_plan @@ -41,7 +40,8 @@ public static function leave_plan_parameters(): external_function_parameters { } /** - * Leave your plan + * Leave current plan. + * If no other user exists in the plan, the user can't leave. * * @return void * @throws \moodle_exception when user is only member left in plan diff --git a/lbplanner/services/slots/book_reservation.php b/lbplanner/services/slots/book_reservation.php index 9fb08199..82734606 100644 --- a/lbplanner/services/slots/book_reservation.php +++ b/lbplanner/services/slots/book_reservation.php @@ -69,7 +69,9 @@ public static function book_reservation_parameters(): external_function_paramete } /** - * Books a reservation + * Books a reservation for the user. + * Will unbook any overlapping reservations the user may already have. + * * @param int $slotid the slot to book a reservation for * @param string $date the day this reservation should take place * @param int $userid the user to reserve for diff --git a/lbplanner/services/slots/delete_slot.php b/lbplanner/services/slots/delete_slot.php index f9dbee45..30fecb8e 100644 --- a/lbplanner/services/slots/delete_slot.php +++ b/lbplanner/services/slots/delete_slot.php @@ -46,7 +46,7 @@ public static function delete_slot_parameters(): external_function_parameters { } /** - * Tries to request unbooking + * Deletes slot * @param int $id which slot to delete */ public static function delete_slot(int $id): void { diff --git a/lbplanner/services/slots/get_all_slots.php b/lbplanner/services/slots/get_all_slots.php index a92626b0..2a04c14b 100644 --- a/lbplanner/services/slots/get_all_slots.php +++ b/lbplanner/services/slots/get_all_slots.php @@ -24,7 +24,6 @@ /** * Returns all slots. - * Throws exception if the current user is not a slotmaster. * * @package local_lbplanner * @subpackage services_slots diff --git a/lbplanner/services/slots/get_my_reservations.php b/lbplanner/services/slots/get_my_reservations.php index 9242b399..9d826a64 100644 --- a/lbplanner/services/slots/get_my_reservations.php +++ b/lbplanner/services/slots/get_my_reservations.php @@ -21,8 +21,7 @@ use local_lbplanner\model\reservation; /** - * Returns all slots a supervisor can theoretically reserve for a user. - * This does not include times the user has already reserved a slot for. + * Returns all reservations for this user. * * @package local_lbplanner * @subpackage services_slots diff --git a/lbplanner/services/slots/get_my_slots.php b/lbplanner/services/slots/get_my_slots.php index fb564848..85862bf2 100644 --- a/lbplanner/services/slots/get_my_slots.php +++ b/lbplanner/services/slots/get_my_slots.php @@ -21,8 +21,7 @@ use local_lbplanner\model\slot; /** - * Returns all slots the user can theoretically reserve. - * This does not include times the user has already reserved a slot for. + * Returns all slots the user can reserve, not including already-reserved ones. * * @package local_lbplanner * @subpackage services_slots @@ -39,7 +38,7 @@ public static function get_my_slots_parameters(): external_function_parameters { } /** - * Returns slots the current user is supposed to see + * Returns all slots the user can reserve, not including already-reserved ones. */ public static function get_my_slots(): array { global $USER; diff --git a/lbplanner/services/slots/get_student_slots.php b/lbplanner/services/slots/get_student_slots.php index 1d5c55b9..5f741b96 100644 --- a/lbplanner/services/slots/get_student_slots.php +++ b/lbplanner/services/slots/get_student_slots.php @@ -23,8 +23,7 @@ use local_lbplanner\model\slot; /** - * Returns all slots a supervisor can theoretically reserve for a user. - * This does not include times the user has already reserved a slot for. + * Returns all slots a supervisor can reserve for a user, not including already-reserved ones. * * @package local_lbplanner * @subpackage services_slots @@ -43,7 +42,7 @@ public static function get_student_slots_parameters(): external_function_paramet } /** - * Returns slots of a user the supervisor can see. + * Returns all slots a supervisor can reserve for a user, not including already-reserved ones. * @param int $userid ID of the user in question (NOT the supervisor) */ public static function get_student_slots(int $userid): array { diff --git a/lbplanner/services/slots/get_supervisor_slots.php b/lbplanner/services/slots/get_supervisor_slots.php index da7d49d9..3c4aeff8 100644 --- a/lbplanner/services/slots/get_supervisor_slots.php +++ b/lbplanner/services/slots/get_supervisor_slots.php @@ -21,7 +21,7 @@ use local_lbplanner\model\slot; /** - * Returns all slots a supervisor can see. + * Returns all slots belonging to the supervisor. * * @package local_lbplanner * @subpackage services_slots @@ -38,7 +38,7 @@ public static function get_supervisor_slots_parameters(): external_function_para } /** - * Returns all slots a supervisor controls. + * Returns all slots belonging to the supervisor. */ public static function get_supervisor_slots(): array { global $USER; diff --git a/lbplanner/services/slots/unbook_reservation.php b/lbplanner/services/slots/unbook_reservation.php index 0184a0d8..27e988ca 100644 --- a/lbplanner/services/slots/unbook_reservation.php +++ b/lbplanner/services/slots/unbook_reservation.php @@ -25,7 +25,7 @@ use local_lbplanner\enums\NOTIF_TRIGGER; /** - * Unbooks reservation + * Tries to request unbooking a reservation. * * @package local_lbplanner * @subpackage services_slots @@ -57,7 +57,7 @@ public static function unbook_reservation_parameters(): external_function_parame } /** - * Tries to request unbooking + * Tries to request unbooking a reservation. * @param int $reservationid which reservation to unbook * @param bool $nice whether to ask the student to unbook themself, or force-unbook */ diff --git a/lbplanner/services/user/delete_user.php b/lbplanner/services/user/delete_user.php index a1c5108d..6cd8c065 100644 --- a/lbplanner/services/user/delete_user.php +++ b/lbplanner/services/user/delete_user.php @@ -25,8 +25,6 @@ /** * Removes all user data stored by the lbplanner app. * - * Admins can pass a userid to delete the user with the given id - * * @package local_lbplanner * @subpackage services_user * @copyright 2024 necodeIT diff --git a/lbplanner/services/user/get_all_users.php b/lbplanner/services/user/get_all_users.php index 863eecdb..2e51024c 100644 --- a/lbplanner/services/user/get_all_users.php +++ b/lbplanner/services/user/get_all_users.php @@ -27,7 +27,7 @@ use local_lbplanner\model\user; /** - * Gets all users with one or several LBP capabilities. + * Returns all users, optionally filtered by vintage. * * @package local_lbplanner * @subpackage services_user @@ -46,7 +46,7 @@ public static function get_all_users_parameters(): external_function_parameters } /** - * Gives back all users. + * Returns all users, optionally filtered by vintage. * @param ?string $vintage (optional) gives back all users with the given vintage * @throws moodle_exception * @throws dml_exception diff --git a/lbplanner/services/user/get_user.php b/lbplanner/services/user/get_user.php index d7cc827b..caf9c8b8 100644 --- a/lbplanner/services/user/get_user.php +++ b/lbplanner/services/user/get_user.php @@ -25,9 +25,7 @@ use local_lbplanner\model\user; /** - * Get the data for a user. - * - * Get the data for a user. param userid (optional) gives back the user data with the given ID + * Returns current userdata. * * @package local_lbplanner * @subpackage services_user @@ -44,7 +42,7 @@ public static function get_user_parameters(): external_function_parameters { } /** - * Gives back the data of the user calling the function. + * Returns current userdata. * @throws coding_exception * @throws dml_exception * @throws moodle_exception diff --git a/lbplanner/services/user/update_user.php b/lbplanner/services/user/update_user.php index 89eb5750..dfa98283 100644 --- a/lbplanner/services/user/update_user.php +++ b/lbplanner/services/user/update_user.php @@ -26,7 +26,7 @@ use local_lbplanner\enums\KANBANCOL_TYPE_ORNONE; /** - * Update the data for a user. null values or unset parameters are left unmodified. + * Update current user settings. null values or unset parameters are left unmodified. * * @package local_lbplanner * @subpackage services_user @@ -80,7 +80,7 @@ public static function update_user_parameters(): external_function_parameters { } /** - * Updates the given user in the eduplanner DB + * Update current user settings. null values or unset parameters are left unmodified. * @param ?string $theme The theme the user has selected * @param ?string $colorblindness The colorblindness the user has selected * @param ?bool $displaytaskcount The displaytaskcount the user has selected From 5aebbba33f80f37c7c49e53e71e346eb5622e049 Mon Sep 17 00:00:00 2001 From: Riedler Date: Sun, 12 Oct 2025 17:43:57 +0200 Subject: [PATCH 2/4] chore: updated copyright years --- lbplanner/services/config/get_version.php | 2 +- lbplanner/services/courses/update_course.php | 2 +- lbplanner/services/modules/get_all_course_modules.php | 2 +- lbplanner/services/modules/get_all_modules.php | 2 +- lbplanner/services/modules/get_module.php | 2 +- lbplanner/services/notifications/get_all_notifications.php | 2 +- lbplanner/services/notifications/update_notification.php | 2 +- lbplanner/services/plan/accept_invite.php | 2 +- lbplanner/services/plan/clear_plan.php | 2 +- lbplanner/services/plan/decline_invite.php | 2 +- lbplanner/services/plan/delete_deadline.php | 2 +- lbplanner/services/plan/get_invites.php | 2 +- lbplanner/services/plan/get_plan.php | 2 +- lbplanner/services/plan/invite_user.php | 2 +- lbplanner/services/plan/leave_plan.php | 2 +- lbplanner/services/plan/remove_user.php | 2 +- lbplanner/services/plan/set_deadline.php | 2 +- lbplanner/services/plan/update_access.php | 2 +- lbplanner/services/plan/update_plan.php | 2 +- lbplanner/services/slots/add_slot_filter.php | 2 +- lbplanner/services/slots/add_slot_supervisor.php | 2 +- lbplanner/services/slots/book_reservation.php | 2 +- lbplanner/services/slots/create_slot.php | 2 +- lbplanner/services/slots/delete_slot.php | 2 +- lbplanner/services/slots/delete_slot_filter.php | 2 +- lbplanner/services/slots/get_my_reservations.php | 2 +- lbplanner/services/slots/get_my_slots.php | 2 +- lbplanner/services/slots/get_slot_filters.php | 2 +- lbplanner/services/slots/get_slot_reservations.php | 2 +- lbplanner/services/slots/get_student_slots.php | 2 +- lbplanner/services/slots/unbook_reservation.php | 2 +- lbplanner/services/slots/update_slot.php | 2 +- lbplanner/services/user/delete_user.php | 2 +- lbplanner/services/user/get_all_users.php | 2 +- lbplanner/services/user/get_user.php | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) diff --git a/lbplanner/services/config/get_version.php b/lbplanner/services/config/get_version.php index 72740eca..b8bbada6 100644 --- a/lbplanner/services/config/get_version.php +++ b/lbplanner/services/config/get_version.php @@ -23,7 +23,7 @@ * * @package local_lbplanner * @subpackage services_config - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class config_get_version extends external_api { diff --git a/lbplanner/services/courses/update_course.php b/lbplanner/services/courses/update_course.php index 32ccd10f..c22f22aa 100644 --- a/lbplanner/services/courses/update_course.php +++ b/lbplanner/services/courses/update_course.php @@ -25,7 +25,7 @@ * * @package local_lbplanner * @subpackage services_courses - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class courses_update_course extends external_api { diff --git a/lbplanner/services/modules/get_all_course_modules.php b/lbplanner/services/modules/get_all_course_modules.php index 8fbc0ec4..cc2010b0 100644 --- a/lbplanner/services/modules/get_all_course_modules.php +++ b/lbplanner/services/modules/get_all_course_modules.php @@ -26,7 +26,7 @@ * * @package local_lbplanner * @subpackage services_modules - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class modules_get_all_course_modules extends external_api { diff --git a/lbplanner/services/modules/get_all_modules.php b/lbplanner/services/modules/get_all_modules.php index 87ae537f..9aaf19ab 100644 --- a/lbplanner/services/modules/get_all_modules.php +++ b/lbplanner/services/modules/get_all_modules.php @@ -25,7 +25,7 @@ * * @package local_lbplanner * @subpackage services_modules - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class modules_get_all_modules extends external_api { diff --git a/lbplanner/services/modules/get_module.php b/lbplanner/services/modules/get_module.php index 9fde0d01..234cc73b 100644 --- a/lbplanner/services/modules/get_module.php +++ b/lbplanner/services/modules/get_module.php @@ -24,7 +24,7 @@ * * @package local_lbplanner * @subpackage services_modules - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class modules_get_module extends external_api { diff --git a/lbplanner/services/notifications/get_all_notifications.php b/lbplanner/services/notifications/get_all_notifications.php index b1ebe094..a65370d8 100644 --- a/lbplanner/services/notifications/get_all_notifications.php +++ b/lbplanner/services/notifications/get_all_notifications.php @@ -24,7 +24,7 @@ * * @package local_lbplanner * @subpackage services_notifications - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class notifications_get_all_notifications extends external_api { diff --git a/lbplanner/services/notifications/update_notification.php b/lbplanner/services/notifications/update_notification.php index 9e8944a0..f1e3fe4d 100644 --- a/lbplanner/services/notifications/update_notification.php +++ b/lbplanner/services/notifications/update_notification.php @@ -25,7 +25,7 @@ * * @package local_lbplanner * @subpackage services_notifications - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class notifications_update_notification extends external_api { diff --git a/lbplanner/services/plan/accept_invite.php b/lbplanner/services/plan/accept_invite.php index 73fd4cd7..9f8b064c 100644 --- a/lbplanner/services/plan/accept_invite.php +++ b/lbplanner/services/plan/accept_invite.php @@ -27,7 +27,7 @@ * * @package local_lbplanner * @subpackage services_plan - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class plan_accept_invite extends external_api { diff --git a/lbplanner/services/plan/clear_plan.php b/lbplanner/services/plan/clear_plan.php index b35daf8e..1d352e50 100644 --- a/lbplanner/services/plan/clear_plan.php +++ b/lbplanner/services/plan/clear_plan.php @@ -24,7 +24,7 @@ * * @package local_lbplanner * @subpackage services_plan - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class plan_clear_plan extends external_api { diff --git a/lbplanner/services/plan/decline_invite.php b/lbplanner/services/plan/decline_invite.php index 3281548a..28a60ac8 100644 --- a/lbplanner/services/plan/decline_invite.php +++ b/lbplanner/services/plan/decline_invite.php @@ -25,7 +25,7 @@ * * @package local_lbplanner * @subpackage services_plan - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class plan_decline_invite extends external_api { diff --git a/lbplanner/services/plan/delete_deadline.php b/lbplanner/services/plan/delete_deadline.php index d56fb7a3..e755935f 100644 --- a/lbplanner/services/plan/delete_deadline.php +++ b/lbplanner/services/plan/delete_deadline.php @@ -24,7 +24,7 @@ * * @package local_lbplanner * @subpackage services_plan - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class plan_delete_deadline extends external_api { diff --git a/lbplanner/services/plan/get_invites.php b/lbplanner/services/plan/get_invites.php index 82a78892..5831398f 100644 --- a/lbplanner/services/plan/get_invites.php +++ b/lbplanner/services/plan/get_invites.php @@ -25,7 +25,7 @@ * * @package local_lbplanner * @subpackage services_plan - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class plan_get_invites extends external_api { diff --git a/lbplanner/services/plan/get_plan.php b/lbplanner/services/plan/get_plan.php index 0a6972d4..2896ecd2 100644 --- a/lbplanner/services/plan/get_plan.php +++ b/lbplanner/services/plan/get_plan.php @@ -24,7 +24,7 @@ * * @package local_lbplanner * @subpackage services_plan - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class plan_get_plan extends \core_external\external_api { diff --git a/lbplanner/services/plan/invite_user.php b/lbplanner/services/plan/invite_user.php index 26d977e4..0f81225a 100644 --- a/lbplanner/services/plan/invite_user.php +++ b/lbplanner/services/plan/invite_user.php @@ -27,7 +27,7 @@ * * @package local_lbplanner * @subpackage services_plan - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class plan_invite_user extends external_api { diff --git a/lbplanner/services/plan/leave_plan.php b/lbplanner/services/plan/leave_plan.php index da67380b..f449da8a 100644 --- a/lbplanner/services/plan/leave_plan.php +++ b/lbplanner/services/plan/leave_plan.php @@ -27,7 +27,7 @@ * * @package local_lbplanner * @subpackage services_plan - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class plan_leave_plan extends external_api { diff --git a/lbplanner/services/plan/remove_user.php b/lbplanner/services/plan/remove_user.php index 37e29222..171194da 100644 --- a/lbplanner/services/plan/remove_user.php +++ b/lbplanner/services/plan/remove_user.php @@ -24,7 +24,7 @@ * * @package local_lbplanner * @subpackage services_plan - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class plan_remove_user extends external_api { diff --git a/lbplanner/services/plan/set_deadline.php b/lbplanner/services/plan/set_deadline.php index 225ade8f..d84b3102 100644 --- a/lbplanner/services/plan/set_deadline.php +++ b/lbplanner/services/plan/set_deadline.php @@ -24,7 +24,7 @@ * * @package local_lbplanner * @subpackage services_plan - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class plan_set_deadline extends external_api { diff --git a/lbplanner/services/plan/update_access.php b/lbplanner/services/plan/update_access.php index 4ac83084..e147d293 100644 --- a/lbplanner/services/plan/update_access.php +++ b/lbplanner/services/plan/update_access.php @@ -25,7 +25,7 @@ * * @package local_lbplanner * @subpackage services_plan - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class plan_update_access extends external_api { diff --git a/lbplanner/services/plan/update_plan.php b/lbplanner/services/plan/update_plan.php index bc269827..f8d8952a 100644 --- a/lbplanner/services/plan/update_plan.php +++ b/lbplanner/services/plan/update_plan.php @@ -24,7 +24,7 @@ * * @package local_lbplanner * @subpackage services_plan - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class plan_update_plan extends external_api { diff --git a/lbplanner/services/slots/add_slot_filter.php b/lbplanner/services/slots/add_slot_filter.php index d89828f1..7b56aac2 100644 --- a/lbplanner/services/slots/add_slot_filter.php +++ b/lbplanner/services/slots/add_slot_filter.php @@ -25,7 +25,7 @@ * * @package local_lbplanner * @subpackage services_slots - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class slots_add_slot_filter extends external_api { diff --git a/lbplanner/services/slots/add_slot_supervisor.php b/lbplanner/services/slots/add_slot_supervisor.php index 7b147f5c..5247caf2 100644 --- a/lbplanner/services/slots/add_slot_supervisor.php +++ b/lbplanner/services/slots/add_slot_supervisor.php @@ -25,7 +25,7 @@ * * @package local_lbplanner * @subpackage services_slots - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class slots_add_slot_supervisor extends external_api { diff --git a/lbplanner/services/slots/book_reservation.php b/lbplanner/services/slots/book_reservation.php index 5f1a07c1..a1fef236 100644 --- a/lbplanner/services/slots/book_reservation.php +++ b/lbplanner/services/slots/book_reservation.php @@ -30,7 +30,7 @@ * * @package local_lbplanner * @subpackage services_slots - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class slots_book_reservation extends external_api { diff --git a/lbplanner/services/slots/create_slot.php b/lbplanner/services/slots/create_slot.php index b295c102..cd8ab06c 100644 --- a/lbplanner/services/slots/create_slot.php +++ b/lbplanner/services/slots/create_slot.php @@ -27,7 +27,7 @@ * * @package local_lbplanner * @subpackage services_slots - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class slots_create_slot extends external_api { diff --git a/lbplanner/services/slots/delete_slot.php b/lbplanner/services/slots/delete_slot.php index b922c1ce..48333ea2 100644 --- a/lbplanner/services/slots/delete_slot.php +++ b/lbplanner/services/slots/delete_slot.php @@ -24,7 +24,7 @@ * * @package local_lbplanner * @subpackage services_slots - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class slots_delete_slot extends external_api { diff --git a/lbplanner/services/slots/delete_slot_filter.php b/lbplanner/services/slots/delete_slot_filter.php index d959ac5c..697d6efa 100644 --- a/lbplanner/services/slots/delete_slot_filter.php +++ b/lbplanner/services/slots/delete_slot_filter.php @@ -27,7 +27,7 @@ * * @package local_lbplanner * @subpackage services_slots - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class slots_delete_slot_filter extends external_api { diff --git a/lbplanner/services/slots/get_my_reservations.php b/lbplanner/services/slots/get_my_reservations.php index 9d826a64..6e3226d3 100644 --- a/lbplanner/services/slots/get_my_reservations.php +++ b/lbplanner/services/slots/get_my_reservations.php @@ -25,7 +25,7 @@ * * @package local_lbplanner * @subpackage services_slots - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class slots_get_my_reservations extends external_api { diff --git a/lbplanner/services/slots/get_my_slots.php b/lbplanner/services/slots/get_my_slots.php index 85862bf2..469a6cbc 100644 --- a/lbplanner/services/slots/get_my_slots.php +++ b/lbplanner/services/slots/get_my_slots.php @@ -25,7 +25,7 @@ * * @package local_lbplanner * @subpackage services_slots - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class slots_get_my_slots extends external_api { diff --git a/lbplanner/services/slots/get_slot_filters.php b/lbplanner/services/slots/get_slot_filters.php index 6f95b1f1..9b0a4f9b 100644 --- a/lbplanner/services/slots/get_slot_filters.php +++ b/lbplanner/services/slots/get_slot_filters.php @@ -25,7 +25,7 @@ * * @package local_lbplanner * @subpackage services_slots - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class slots_get_slot_filters extends external_api { diff --git a/lbplanner/services/slots/get_slot_reservations.php b/lbplanner/services/slots/get_slot_reservations.php index d18943d9..8834697e 100644 --- a/lbplanner/services/slots/get_slot_reservations.php +++ b/lbplanner/services/slots/get_slot_reservations.php @@ -25,7 +25,7 @@ * * @package local_lbplanner * @subpackage services_slots - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class slots_get_slot_reservations extends external_api { diff --git a/lbplanner/services/slots/get_student_slots.php b/lbplanner/services/slots/get_student_slots.php index df430d98..7774a336 100644 --- a/lbplanner/services/slots/get_student_slots.php +++ b/lbplanner/services/slots/get_student_slots.php @@ -25,7 +25,7 @@ * * @package local_lbplanner * @subpackage services_slots - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class slots_get_student_slots extends external_api { diff --git a/lbplanner/services/slots/unbook_reservation.php b/lbplanner/services/slots/unbook_reservation.php index 8591bbbe..a3a03fc1 100644 --- a/lbplanner/services/slots/unbook_reservation.php +++ b/lbplanner/services/slots/unbook_reservation.php @@ -26,7 +26,7 @@ * * @package local_lbplanner * @subpackage services_slots - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class slots_unbook_reservation extends external_api { diff --git a/lbplanner/services/slots/update_slot.php b/lbplanner/services/slots/update_slot.php index 7150dee9..4ff4142e 100644 --- a/lbplanner/services/slots/update_slot.php +++ b/lbplanner/services/slots/update_slot.php @@ -25,7 +25,7 @@ * * @package local_lbplanner * @subpackage services_TODO - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class slots_update_slot extends external_api { diff --git a/lbplanner/services/user/delete_user.php b/lbplanner/services/user/delete_user.php index af58f849..a4a9c9f9 100644 --- a/lbplanner/services/user/delete_user.php +++ b/lbplanner/services/user/delete_user.php @@ -27,7 +27,7 @@ * * @package local_lbplanner * @subpackage services_user - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class user_delete_user extends external_api { diff --git a/lbplanner/services/user/get_all_users.php b/lbplanner/services/user/get_all_users.php index ff2471eb..e9f48492 100644 --- a/lbplanner/services/user/get_all_users.php +++ b/lbplanner/services/user/get_all_users.php @@ -30,7 +30,7 @@ * * @package local_lbplanner * @subpackage services_user - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class user_get_all_users extends external_api { diff --git a/lbplanner/services/user/get_user.php b/lbplanner/services/user/get_user.php index 48f31b4e..42d7e3ac 100644 --- a/lbplanner/services/user/get_user.php +++ b/lbplanner/services/user/get_user.php @@ -28,7 +28,7 @@ * * @package local_lbplanner * @subpackage services_user - * @copyright 2024 necodeIT + * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ class user_get_user extends \core_external\external_api { From 058011eb4a2866fe4057a07f88b5bb51eecc74a2 Mon Sep 17 00:00:00 2001 From: Riedler Date: Sun, 12 Oct 2025 17:49:19 +0200 Subject: [PATCH 3/4] fix: Corrected subpackage doc --- lbplanner/services/slots/update_slot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbplanner/services/slots/update_slot.php b/lbplanner/services/slots/update_slot.php index 4ff4142e..1ee475e5 100644 --- a/lbplanner/services/slots/update_slot.php +++ b/lbplanner/services/slots/update_slot.php @@ -24,7 +24,7 @@ * Update a slot's values * * @package local_lbplanner - * @subpackage services_TODO + * @subpackage services_slots * @copyright 2025 necodeIT * @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC-BY-NC-SA 4.0 International or later */ From 42d6e59f0df0578ae4a2034d2b01ecb188013bea Mon Sep 17 00:00:00 2001 From: Riedler Date: Sun, 12 Oct 2025 19:34:46 +0200 Subject: [PATCH 4/4] fix: various mistakes in parameter lists --- lbplanner/services/courses/update_course.php | 6 ++--- lbplanner/services/slots/update_slot.php | 12 +++++----- lbplanner/services/user/update_user.php | 24 +++++++++++++------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/lbplanner/services/courses/update_course.php b/lbplanner/services/courses/update_course.php index c22f22aa..314b8374 100644 --- a/lbplanner/services/courses/update_course.php +++ b/lbplanner/services/courses/update_course.php @@ -52,11 +52,11 @@ public static function update_course_parameters(): external_function_parameters * @param int $courseid The id of the course * @param string $color The color of the course * @param string $shortname The shortname of the course - * @param int $enabled Whether the course is enabled or not (0 or 1) + * @param bool $enabled Whether the course is enabled or not * @return void * @throws moodle_exception */ - public static function update_course(int $courseid, string $color, string $shortname, int $enabled): void { + public static function update_course(int $courseid, string $color, string $shortname, bool $enabled): void { global $DB, $USER; self::validate_parameters( @@ -82,7 +82,7 @@ public static function update_course(int $courseid, string $color, string $short $course->set_shortname($shortname); } if ($enabled !== null) { - $course->set_enabled((bool) $enabled); + $course->set_enabled($enabled); } $DB->update_record(course_helper::EDUPLANNER_COURSE_TABLE, $course->prepare_for_db()); diff --git a/lbplanner/services/slots/update_slot.php b/lbplanner/services/slots/update_slot.php index 1ee475e5..7cba2242 100644 --- a/lbplanner/services/slots/update_slot.php +++ b/lbplanner/services/slots/update_slot.php @@ -85,13 +85,13 @@ public static function update_slot_parameters(): external_function_parameters { /** * Update a slot's values * @param int $id ID of the slot to update - * @param int $startunit the unit this slot starts in - * @param int $duration how long the unit lasts for - * @param int $weekday which day of the week this slot is on - * @param string $room which room this slot is for - * @param int $size how many pupils this slot can fit + * @param ?int $startunit the unit this slot starts in + * @param ?int $duration how long the unit lasts for + * @param ?int $weekday which day of the week this slot is on + * @param ?string $room which room this slot is for + * @param ?int $size how many pupils this slot can fit */ - public static function update_slot(int $id, int $startunit, int $duration, int $weekday, string $room, int $size): void { + public static function update_slot(int $id, ?int $startunit, ?int $duration, ?int $weekday, ?string $room, ?int $size): void { global $USER, $DB; self::validate_parameters( self::update_slot_parameters(), diff --git a/lbplanner/services/user/update_user.php b/lbplanner/services/user/update_user.php index b6100378..40a91b5e 100644 --- a/lbplanner/services/user/update_user.php +++ b/lbplanner/services/user/update_user.php @@ -43,49 +43,57 @@ public static function update_user_parameters(): external_function_parameters { PARAM_TEXT, 'The theme the user has selected', VALUE_DEFAULT, - null + null, + NULL_ALLOWED ), 'colorblindness' => new external_value( PARAM_TEXT, 'The colorblindness the user has selected', VALUE_DEFAULT, - null + null, + NULL_ALLOWED ), 'displaytaskcount' => new external_value( PARAM_BOOL, 'Whether the user has the taskcount enabled', VALUE_DEFAULT, - null + null, + NULL_ALLOWED ), 'ekenabled' => new external_value( PARAM_BOOL, 'Whether the user wants to see EK modules', VALUE_DEFAULT, - null + null, + NULL_ALLOWED ), 'showcolumncolors' => new external_value( PARAM_BOOL, 'Whether column colors should show in kanban board', VALUE_DEFAULT, - null + null, + NULL_ALLOWED ), 'automovecompletedtasks' => new external_value( PARAM_TEXT, 'The kanban column to move a task to if completed ' . KANBANCOL_TYPE_ORNONE::format(), VALUE_DEFAULT, - null + null, + NULL_ALLOWED ), 'automovesubmittedtasks' => new external_value( PARAM_TEXT, 'The kanban column to move a task to if submitted ' . KANBANCOL_TYPE_ORNONE::format(), VALUE_DEFAULT, - null + null, + NULL_ALLOWED ), 'automoveoverduetasks' => new external_value( PARAM_TEXT, 'The kanban column to move a task to if overdue ' . KANBANCOL_TYPE_ORNONE::format(), VALUE_DEFAULT, - null + null, + NULL_ALLOWED ), ]); }