]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12444 Removed aggregationview preference from category edit form. Merged from...
authornicolasconnault <nicolasconnault>
Thu, 7 May 2009 07:57:04 +0000 (07:57 +0000)
committernicolasconnault <nicolasconnault>
Thu, 7 May 2009 07:57:04 +0000 (07:57 +0000)
grade/edit/tree/category.php
grade/edit/tree/category_form.php

index a9f9a79e80aa0b0969a657207d672853e009d424..a6fd5c673bfb734969092dbea45a5814b1c1f641 100644 (file)
@@ -53,8 +53,6 @@ if ($id) {
     }
     $grade_category->apply_forced_settings();
     $category = $grade_category->get_record_data();
-    // Get Category preferences
-    $category->pref_aggregationview = grade_report::get_pref('aggregationview', $id);
     // set parent
     $category->parentcategory = $grade_category->parent;
     $grade_item = $grade_category->load_grade_item();
@@ -177,13 +175,6 @@ if ($mform->is_cancelled()) {
 
     $grade_item->update(); // We don't need to insert it, it's already created when the category is created
 
-    // Handle user preferences
-    if (isset($data->pref_aggregationview)) {
-        if (!grade_report::set_pref('aggregationview', $data->pref_aggregationview, $grade_category->id)) {
-            print_error('cannotsetprefgrade', '', '', $value);
-        }
-    }
-
     // set parent if needed
     if (isset($data->parentcategory)) {
         $grade_category->set_parent($data->parentcategory, 'gradebook');
index 4d13c01eec68383e7a11cd32997abeaf7bb95d59..8e5038a4b93e6563b7528c55dc9bb909e078f6cc 100644 (file)
@@ -1,3 +1,4 @@
+<<<<<<< category_form.php
 <?php  //$Id$
 
 ///////////////////////////////////////////////////////////////////////////
@@ -224,19 +225,6 @@ class edit_category_form extends moodleform {
             $mform->addElement('static', 'currentparentaggregation', get_string('currentparentaggregation', 'grades'));
         }
 
-/// user preferences
-        $mform->addElement('header', 'headerpreferences', get_string('myreportpreferences', 'grades'));
-        $options = array(GRADE_REPORT_PREFERENCE_DEFAULT => get_string('default', 'grades'),
-                         GRADE_REPORT_AGGREGATION_VIEW_FULL => get_string('fullmode', 'grades'),
-                         GRADE_REPORT_AGGREGATION_VIEW_AGGREGATES_ONLY => get_string('aggregatesonly', 'grades'),
-                         GRADE_REPORT_AGGREGATION_VIEW_GRADES_ONLY => get_string('gradesonly', 'grades'));
-        $label = get_string('aggregationview', 'grades') . ' (' . get_string('default', 'grades')
-               . ': ' . $options[$CFG->grade_report_aggregationview] . ')';
-        $mform->addElement('select', 'pref_aggregationview', $label, $options);
-        $mform->setHelpButton('pref_aggregationview', array('aggregationview', get_string('aggregationview', 'grades'), 'grade'), true);
-        $mform->setDefault('pref_aggregationview', GRADE_REPORT_PREFERENCE_DEFAULT);
-        $mform->setAdvanced('pref_aggregationview');
-
         // hidden params
         $mform->addElement('hidden', 'id', 0);
         $mform->setType('id', PARAM_INT);