Permalink
Browse files

Merge branch 'MDL-28015-workshop-sql_20_STABLE' of git://github.com/m…

…udrd8mz/moodle into MOODLE_20_STABLE
  • Loading branch information...
2 parents 9948122 + 308e53f commit 6761018805b76c28ae09fd3713f9f91ecbfda1bc @stronk7 stronk7 committed Jul 7, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 mod/workshop/locallib.php
@@ -1331,7 +1331,12 @@ public function prepare_grading_report_data($userid, $groups, $page, $perpage, $
list($participantids, $params) = $DB->get_in_or_equal(array_keys($participants), SQL_PARAMS_NAMED);
$params['workshopid1'] = $this->id;
$params['workshopid2'] = $this->id;
- $sqlsort = $sortby . ' ' . $sorthow . ',u.lastname,u.firstname,u.id';
+ $sqlsort = array();
+ $sqlsortfields = array($sortby => $sorthow) + array('lastname' => 'ASC', 'firstname' => 'ASC', 'u.id' => 'ASC');
+ foreach ($sqlsortfields as $sqlsortfieldname => $sqlsortfieldhow) {
+ $sqlsort[] = $sqlsortfieldname . ' ' . $sqlsortfieldhow;
+ }
+ $sqlsort = implode(',', $sqlsort);
$sql = "SELECT u.id AS userid,u.firstname,u.lastname,u.picture,u.imagealt,u.email,
s.title AS submissiontitle, s.grade AS submissiongrade, ag.gradinggrade
FROM {user} u

0 comments on commit 6761018

Please sign in to comment.