Merge branch 'MDL-54800-master' of git://github.com/jleyva/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2016-07-05 21:10:28 +02:00
2 changed files with 22 additions and 7 deletions
+18 -7
View File
@@ -300,7 +300,7 @@ class core_enrol_external extends external_api {
$params = self::validate_parameters(self::get_users_courses_parameters(), array('userid'=>$userid));
$courses = enrol_get_users_courses($params['userid'], true, 'id, shortname, fullname, idnumber, visible,
summary, summaryformat, format, showgrades, lang, enablecompletion');
summary, summaryformat, format, showgrades, lang, enablecompletion, category');
$result = array();
foreach ($courses as $course) {
@@ -324,11 +324,21 @@ class core_enrol_external extends external_api {
list($course->summary, $course->summaryformat) =
external_format_text($course->summary, $course->summaryformat, $context->id, 'course', 'summary', null);
$result[] = array('id' => $course->id, 'shortname' => $course->shortname, 'fullname' => $course->fullname,
'idnumber' => $course->idnumber, 'visible' => $course->visible, 'enrolledusercount' => $enrolledusercount,
'summary' => $course->summary, 'summaryformat' => $course->summaryformat, 'format' => $course->format,
'showgrades' => $course->showgrades, 'lang' => $course->lang, 'enablecompletion' => $course->enablecompletion
);
$result[] = array(
'id' => $course->id,
'shortname' => $course->shortname,
'fullname' => $course->fullname,
'idnumber' => $course->idnumber,
'visible' => $course->visible,
'enrolledusercount' => $enrolledusercount,
'summary' => $course->summary,
'summaryformat' => $course->summaryformat,
'format' => $course->format,
'showgrades' => $course->showgrades,
'lang' => $course->lang,
'enablecompletion' => $course->enablecompletion,
'category' => $course->category
);
}
return $result;
@@ -355,7 +365,8 @@ class core_enrol_external extends external_api {
'showgrades' => new external_value(PARAM_BOOL, 'true if grades are shown, otherwise false', VALUE_OPTIONAL),
'lang' => new external_value(PARAM_LANG, 'forced course language', VALUE_OPTIONAL),
'enablecompletion' => new external_value(PARAM_BOOL, 'true if completion is enabled, otherwise false',
VALUE_OPTIONAL)
VALUE_OPTIONAL),
'category' => new external_value(PARAM_INT, 'course category id', VALUE_OPTIONAL),
)
)
);
+4
View File
@@ -1,6 +1,10 @@
This files describes API changes in /enrol/* - plugins,
information provided here is intended especially for developers.
=== 3.2 ===
* External function core_enrol_external::get_users_courses now return the category id as an additional optional field.
=== 3.1 ===
* core_enrol_external::get_enrolled_users now supports two additional parameters for ordering: sortby and sortdirection.