Skip to content

Commit

Permalink
Merge branch 'MDL-47869-master' of git://github.com/lameze/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Nov 7, 2014
2 parents 2f1d0ea + 7c2a2e1 commit 293f1b4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions admin/tool/monitor/classes/output/managesubs/rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ public function get_user_courses_select() {
if ($numcourses > COURSE_MAX_COURSES_PER_DROPDOWN) {
return false;
}

$orderby = 'visible DESC, sortorder ASC';
$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) {
$options[$course->id] = format_string($course->fullname, true,
array('context' => \context_course::instance($course->id)));
Expand Down
5 changes: 3 additions & 2 deletions admin/tool/monitor/classes/rule_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ public static function update_rule($ruledata) {
public static function get_rules_by_courseid($courseid, $limitfrom = 0, $limitto = 0) {
global $DB;
$select = "courseid = ? OR courseid = ?";
return self::get_instances($DB->get_records_select('tool_monitor_rules', $select, array(0, $courseid), null, '*',
$limitfrom, $limitto));
$orderby = "courseid DESC, name ASC";
return self::get_instances($DB->get_records_select('tool_monitor_rules', $select, array(0, $courseid), $orderby,
'*', $limitfrom, $limitto));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/monitor/classes/subscription_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public static function count_user_subscriptions_for_course($courseid, $userid =
* @return array list of subscriptions
*/
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;
if ($userid == 0) {
$userid = $USER->id;
Expand Down

0 comments on commit 293f1b4

Please sign in to comment.