MDL-12444 Removed aggregationview preference from category edit form. Merged from MOODLE_19_STABLE

This commit is contained in:
nicolasconnault 2009-05-07 07:57:04 +00:00
parent d69ef28b77
commit 28087eb710
2 changed files with 1 additions and 22 deletions

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)) {
print_error('cannotsetprefgrade', '', '', $value);
}
}
// set parent if needed
if (isset($data->parentcategory)) {
$grade_category->set_parent($data->parentcategory, 'gradebook');

View 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);