Browse files

Fixes #8: quick edit adheres to override cat setting

  • Loading branch information...
1 parent ed9197a commit 1fffe2b837041fe692cc4e5fac379aa59673990b @philcali philcali committed Mar 29, 2012
View
2 grade/report/quick_edit/lang/en/gradereport_quick_edit.php
@@ -26,6 +26,8 @@
$string['pluginname'] = 'Quick edit';
$string['quick_edit:view'] = 'View the '.$string['pluginname'].' report';
+$string['not_allowed'] = 'Not allowed to edit category or course item';
+
$string['exclude'] = 'Exclude';
$string['override'] = 'Override';
$string['assessmentname'] = 'Assessment Name';
View
12 grade/report/quick_edit/screens/grade/lib.php
@@ -47,6 +47,18 @@ public function init($self_item_is_empty = false) {
$this->item = grade_item::fetch($params);
+
+ $not_allowed = (
+ !get_config('moodle', 'grade_overridecat') and (
+ $this->item->is_course_item() or
+ $this->item->is_category_item()
+ )
+ );
+
+ if ($not_allowed) {
+ print_error('not_allowed', 'gradereport_quick_edit');
+ }
+
$this->requires_extra = !$this->item->is_manual_item();
$this->structure = new grade_structure();

0 comments on commit 1fffe2b

Please sign in to comment.