}
$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();
$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');
+<<<<<<< category_form.php
<?php //$Id$
///////////////////////////////////////////////////////////////////////////
$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);