Skip to content

Commit

Permalink
MDL-12444 Removed aggregationview preference from category edit form
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasconnault committed May 7, 2009
1 parent 2a200a3 commit 0074ab9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
9 changes: 0 additions & 9 deletions grade/edit/tree/category.php
Expand Up @@ -53,8 +53,6 @@
}
$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();
Expand Down Expand Up @@ -177,13 +175,6 @@

$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');
Expand Down
13 changes: 0 additions & 13 deletions grade/edit/tree/category_form.php
Expand Up @@ -224,19 +224,6 @@ function definition() {
$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);
Expand Down

0 comments on commit 0074ab9

Please sign in to comment.