Merge branch 'MDL-47746-master' of git://github.com/zbdd/moodle
authorDan Poltawski <dan@moodle.com>
Thu, 30 Oct 2014 15:39:46 +0000 (15:39 +0000)
committerDan Poltawski <dan@moodle.com>
Thu, 30 Oct 2014 15:39:46 +0000 (15:39 +0000)
1  2 
grade/report/singleview/classes/local/screen/user.php
grade/report/singleview/classes/local/ui/finalgrade.php

@@@ -191,38 -192,20 +191,44 @@@ class user extends tablelike implement
          $gradetreeitem['object'] = $item;
          $gradetreeitem['userid'] = $this->item->id;
  
 -        $itemlabel = $this->structure->get_element_header($gradetreeitem, true, false);
 +        $itemlabel = $this->structure->get_element_header($gradetreeitem, true, false, false, false, true);
          $grade->label = $item->get_name();
  
+         $itemlabel = $item->get_name();
+         if (!empty($realmodid)) {
+             $url = new moodle_url('/mod/' . $item->itemmodule . '/view.php', array('id' => $realmodid));
+             $itemlabel = html_writer::link($url, $item->get_name());
+         }
          $line = array(
              $OUTPUT->action_icon($this->format_link('grade', $item->id), new pix_icon('t/editstring', $iconstring)),
 -            $this->format_icon($item) . $lockicon, $itemlabel, $this->category($item), (new range($item))
 +            $this->format_icon($item) . $lockicon . $itemlabel,
 +            $this->category($item),
 +            new range($item)
          );
 -        return $this->format_definition($line, $grade);
 +        $lineclasses = array(
 +            "action",
 +            "gradeitem",
 +            "category",
 +            "range"
 +        );
 +
 +        $outputline = array();
 +        $i = 0;
 +        foreach ($line as $key => $value) {
 +            $cell = new \html_table_cell($value);
 +            if ($isheader = $i == 1) {
 +                $cell->header = $isheader;
 +                $cell->scope = "row";
 +            }
 +            if (array_key_exists($key, $lineclasses)) {
 +                $cell->attributes['class'] = $lineclasses[$key];
 +            }
 +            $outputline[] = $cell;
 +            $i++;
 +        }
 +
 +        return $this->format_definition($outputline, $grade);
      }
  
      /**