MDL-12444 Removed aggregationview preference from category edit form

This commit is contained in:
nicolasconnault
2009-05-07 07:52:10 +00:00
parent 2a200a31d0
commit 0074ab9cef
2 changed files with 0 additions and 22 deletions
-9
View 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)) {
error("Could not set preference aggregationview to $value for this grade category");
}
}
// set parent if needed
if (isset($data->parentcategory)) {
$grade_category->set_parent($data->parentcategory, 'gradebook');
-13
View File
@@ -224,19 +224,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);