Skip to content

Commit

Permalink
Merge branch 'MDL-66549-master' of git://github.com/ilyatregubov/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyatregubov committed Sep 22, 2021
2 parents ed0d7ef + a5ab9e4 commit 3de9a4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
18 changes: 3 additions & 15 deletions grade/report/grader/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,19 +369,11 @@ private function setup_sortitemid() {

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') {
Expand All @@ -390,11 +382,7 @@ private function setup_sortitemid() {
$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;
Expand Down
2 changes: 1 addition & 1 deletion grade/report/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ public function setup_users() {
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']);
Expand Down

0 comments on commit 3de9a4d

Please sign in to comment.