Merge branch 'MDL-66549-master' of git://github.com/ilyatregubov/moodle

This commit is contained in:
Ilya Tregubov 2021-09-22 19:22:59 +02:00
commit 3de9a4db4c
2 changed files with 4 additions and 16 deletions

View File

@ -369,19 +369,11 @@ class grade_report_grader extends grade_report {
if ($this->sortitemid) {
if (!isset($SESSION->gradeuserreport->sort)) {
if ($this->sortitemid == 'firstname' || $this->sortitemid == 'lastname') {
$this->sortorder = $SESSION->gradeuserreport->sort = 'ASC';
} else {
$this->sortorder = $SESSION->gradeuserreport->sort = 'DESC';
}
$this->sortorder = $SESSION->gradeuserreport->sort = 'ASC';
} else {
// this is the first sort, i.e. by last name
if (!isset($SESSION->gradeuserreport->sortitemid)) {
if ($this->sortitemid == 'firstname' || $this->sortitemid == 'lastname') {
$this->sortorder = $SESSION->gradeuserreport->sort = 'ASC';
} else {
$this->sortorder = $SESSION->gradeuserreport->sort = 'DESC';
}
$this->sortorder = $SESSION->gradeuserreport->sort = 'ASC';
} else if ($SESSION->gradeuserreport->sortitemid == $this->sortitemid) {
// same as last sort
if ($SESSION->gradeuserreport->sort == 'ASC') {
@ -390,11 +382,7 @@ class grade_report_grader extends grade_report {
$this->sortorder = $SESSION->gradeuserreport->sort = 'ASC';
}
} else {
if ($this->sortitemid == 'firstname' || $this->sortitemid == 'lastname') {
$this->sortorder = $SESSION->gradeuserreport->sort = 'ASC';
} else {
$this->sortorder = $SESSION->gradeuserreport->sort = 'DESC';
}
$this->sortorder = $SESSION->gradeuserreport->sort = 'ASC';
}
}
$SESSION->gradeuserreport->sortitemid = $this->sortitemid;

View File

@ -417,7 +417,7 @@ abstract class grade_report {
protected function get_sort_arrow($direction='move', $sortlink=null) {
global $OUTPUT;
$pix = array('up' => 't/sort_desc', 'down' => 't/sort_asc', 'move' => 't/sort');
$matrix = array('up' => 'desc', 'down' => 'asc', 'move' => 'desc');
$matrix = array('up' => 'desc', 'down' => 'asc', 'move' => 'asc');
$strsort = $this->get_lang_string('sort' . $matrix[$direction]);
$arrow = $OUTPUT->pix_icon($pix[$direction], '', '', ['class' => 'sorticon']);