Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marxjohnson/3225744 to your computer and use it in GitHub Desktop.
Save marxjohnson/3225744 to your computer and use it in GitHub Desktop.
Patch for Moodle 2 to modify the mentees block to sort users alphabetically. Copyright Richard Taunton Sixth Form College, UK. Licenced under GNU GPL.
From a0198387d484d0fe083ed1a32c0fe5f9f6806d6b Mon Sep 17 00:00:00 2001
From: Mark Johnson <mark.johnson@tauntons.ac.uk>
Date: Mon, 29 Nov 2010 15:01:08 +0000
Subject: [PATCH 06/78] Modified mentees block to sort users alphabetically
---
blocks/mentees/block_mentees.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/blocks/mentees/block_mentees.php b/blocks/mentees/block_mentees.php
index aa340af..a3f4222 100644
--- a/blocks/mentees/block_mentees.php
+++ b/blocks/mentees/block_mentees.php
@@ -33,7 +33,8 @@ class block_mentees extends block_base {
WHERE ra.userid = ?
AND ra.contextid = c.id
AND c.instanceid = u.id
- AND c.contextlevel = ".CONTEXT_USER, array($USER->id))) {
+ AND c.contextlevel = ?
+ ORDER BY u.lastname", array($USER->id, CONTEXT_USER))) {
$this->content->text = '<ul>';
foreach ($usercontexts as $usercontext) {
--
1.7.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment