mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
Merge branch 'MDL-47869-master' of git://github.com/lameze/moodle
This commit is contained in:
commit
293f1b4d85
3 changed files with 6 additions and 5 deletions
|
@ -214,9 +214,9 @@ class rules extends \table_sql implements \renderable {
|
||||||
if ($numcourses > COURSE_MAX_COURSES_PER_DROPDOWN) {
|
if ($numcourses > COURSE_MAX_COURSES_PER_DROPDOWN) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
$orderby = 'visible DESC, sortorder ASC';
|
||||||
$options = array(0 => get_string('site'));
|
$options = array(0 => get_string('site'));
|
||||||
if ($courses = get_user_capability_course('tool/monitor:subscribe', null, true, 'fullname')) {
|
if ($courses = get_user_capability_course('tool/monitor:subscribe', null, true, 'fullname', $orderby)) {
|
||||||
foreach ($courses as $course) {
|
foreach ($courses as $course) {
|
||||||
$options[$course->id] = format_string($course->fullname, true,
|
$options[$course->id] = format_string($course->fullname, true,
|
||||||
array('context' => \context_course::instance($course->id)));
|
array('context' => \context_course::instance($course->id)));
|
||||||
|
|
|
@ -222,8 +222,9 @@ class rule_manager {
|
||||||
public static function get_rules_by_courseid($courseid, $limitfrom = 0, $limitto = 0) {
|
public static function get_rules_by_courseid($courseid, $limitfrom = 0, $limitto = 0) {
|
||||||
global $DB;
|
global $DB;
|
||||||
$select = "courseid = ? OR courseid = ?";
|
$select = "courseid = ? OR courseid = ?";
|
||||||
return self::get_instances($DB->get_records_select('tool_monitor_rules', $select, array(0, $courseid), null, '*',
|
$orderby = "courseid DESC, name ASC";
|
||||||
$limitfrom, $limitto));
|
return self::get_instances($DB->get_records_select('tool_monitor_rules', $select, array(0, $courseid), $orderby,
|
||||||
|
'*', $limitfrom, $limitto));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -280,7 +280,7 @@ class subscription_manager {
|
||||||
* @return array list of subscriptions
|
* @return array list of subscriptions
|
||||||
*/
|
*/
|
||||||
public static function get_user_subscriptions($limitfrom = 0, $limitto = 0, $userid = 0,
|
public static function get_user_subscriptions($limitfrom = 0, $limitto = 0, $userid = 0,
|
||||||
$order = 's.timecreated DESC' ) {
|
$order = 's.courseid ASC, r.name' ) {
|
||||||
global $DB, $USER;
|
global $DB, $USER;
|
||||||
if ($userid == 0) {
|
if ($userid == 0) {
|
||||||
$userid = $USER->id;
|
$userid = $USER->id;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue