From b9508423b40cfd01c2bbb0afc0247c0ff50d95d4 Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Tue, 6 Nov 2018 11:30:14 +0100 Subject: [PATCH] MDL-63740 webservice: Add new dashboard functions to mobile service - core_course_get_enrolled_courses_by_timeline_classification - core_course_get_recent_courses - core_course_set_favourite_courses - block_starredcourses_get_starred_courses --- blocks/starredcourses/db/services.php | 1 + lib/db/services.php | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/blocks/starredcourses/db/services.php b/blocks/starredcourses/db/services.php index fc3ebb9ab05..cd5edb4b461 100644 --- a/blocks/starredcourses/db/services.php +++ b/blocks/starredcourses/db/services.php @@ -33,6 +33,7 @@ $functions = array( 'description' => 'Get users starred courses.', 'type' => 'read', 'ajax' => true, + 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE), ), ); diff --git a/lib/db/services.php b/lib/db/services.php index 53cc5eb4b15..43f6fc23c40 100644 --- a/lib/db/services.php +++ b/lib/db/services.php @@ -542,7 +542,8 @@ $functions = array( 'classpath' => 'course/externallib.php', 'description' => 'List of enrolled courses for the given timeline classification (past, inprogress, or future).', 'type' => 'read', - 'ajax' => true + 'ajax' => true, + 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE), ), 'core_course_get_recent_courses' => array( 'classname' => 'core_course_external', @@ -550,7 +551,17 @@ $functions = array( 'classpath' => 'course/externallib.php', 'description' => 'List of courses a user has accessed most recently.', 'type' => 'read', - 'ajax' => true + 'ajax' => true, + 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE), + ), + 'core_course_set_favourite_courses' => array( + 'classname' => 'core_course_external', + 'methodname' => 'set_favourite_courses', + 'classpath' => 'course/externallib.php', + 'description' => 'Add a list of courses to the list of favourite courses.', + 'type' => 'read', + 'ajax' => true, + 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE), ), 'core_enrol_get_course_enrolment_methods' => array( 'classname' => 'core_enrol_external', @@ -2319,14 +2330,6 @@ $functions = array( 'type' => 'read', 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE), ), - 'core_course_set_favourite_courses' => array( - 'classname' => 'core_course_external', - 'methodname' => 'set_favourite_courses', - 'classpath' => 'course/externallib.php', - 'description' => 'Add a list of courses to the list of favourite courses.', - 'type' => 'read', - 'ajax' => true - ) ); $services = array(