From d29f593575481e7cd0b07b07a552e5974b5ef47d Mon Sep 17 00:00:00 2001 From: Philip Cali Date: Wed, 21 Mar 2012 13:33:14 -0500 Subject: Fixes #21: Hides calculations from edit views --- grade/edit/tree/lib.php | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/grade/edit/tree/lib.php b/grade/edit/tree/lib.php index 49af487..73008ef 100644 --- a/grade/edit/tree/lib.php +++ b/grade/edit/tree/lib.php @@ -48,6 +48,8 @@ class grade_edit_tree { public function __construct($gtree, $moving=false, $gpr) { global $USER, $OUTPUT, $COURSE; + $this->show_calculations = (bool)get_config('moodle', 'grade_report_showcalculations'); + $this->gtree = $gtree; $this->moving = $moving; $this->gpr = $gpr; @@ -131,7 +133,9 @@ class grade_edit_tree { $actions .= $this->gtree->get_edit_icon($element, $this->gpr); } - $actions .= $this->gtree->get_calculation_icon($element, $this->gpr); + if ($this->show_calculations) { + $actions .= $this->gtree->get_calculation_icon($element, $this->gpr); + } if ($element['type'] == 'item' or ($element['type'] == 'category' and $element['depth'] > 1)) { if ($this->element_deletable($element)) { -- 1.7.1 From 56b8d3fcca650fe013bd39c53bf354fdd1549e49 Mon Sep 17 00:00:00 2001 From: Philip Cali Date: Wed, 21 Mar 2012 13:40:59 -0500 Subject: User pref overrides system --- grade/edit/tree/lib.php | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/grade/edit/tree/lib.php b/grade/edit/tree/lib.php index 73008ef..f1353bf 100644 --- a/grade/edit/tree/lib.php +++ b/grade/edit/tree/lib.php @@ -48,7 +48,8 @@ class grade_edit_tree { public function __construct($gtree, $moving=false, $gpr) { global $USER, $OUTPUT, $COURSE; - $this->show_calculations = (bool)get_config('moodle', 'grade_report_showcalculations'); + $system_default = get_config('moodle', 'grade_report_showcalculations'); + $this->show_calculations = get_user_preferences('grade_report_showcalculations', $system_default); $this->gtree = $gtree; $this->moving = $moving; -- 1.7.1