Permalink
Browse files

Merge branch 'MDL-31633-m23' of git://github.com/ankitagarwal/moodle …

…into MOODLE_23_STABLE
  • Loading branch information...
2 parents 4212285 + 9fc95b6 commit 48ee721e2f9978c39c11c365104bf36164ae61ea @nebgor nebgor committed Aug 27, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 grade/lib.php
View
@@ -2574,16 +2574,23 @@ public static function get_info_edit_structure($courseid) {
* @return array
*/
public static function get_info_letters($courseid) {
+ global $SITE;
if (self::$letterinfo !== null) {
return self::$letterinfo;
}
$context = get_context_instance(CONTEXT_COURSE, $courseid);
$canmanage = has_capability('moodle/grade:manage', $context);
$canmanageletters = has_capability('moodle/grade:manageletters', $context);
if ($canmanage || $canmanageletters) {
+ // Redirect to system context when report is accessed from admin settings MDL-31633
+ if ($context->instanceid == $SITE->id) {
+ $param = array('edit' => 1);
+ } else {
+ $param = array('edit' => 1,'id' => $context->id);
+ }
self::$letterinfo = array(
'view' => new grade_plugin_info('view', new moodle_url('/grade/edit/letter/index.php', array('id'=>$context->id)), get_string('view')),
- 'edit' => new grade_plugin_info('edit', new moodle_url('/grade/edit/letter/index.php', array('edit'=>1,'id'=>$context->id)), get_string('edit'))
+ 'edit' => new grade_plugin_info('edit', new moodle_url('/grade/edit/letter/index.php', $param), get_string('edit'))
);
} else {
self::$letterinfo = false;

0 comments on commit 48ee721

Please sign in to comment.