MDL-46818 core_grades: added YUI form change validation
authorMark Nelson <markn@moodle.com>
Tue, 2 Sep 2014 04:46:43 +0000 (21:46 -0700)
committerMark Nelson <markn@moodle.com>
Tue, 2 Sep 2014 06:02:13 +0000 (23:02 -0700)
grade/edit/tree/index.php
grade/edit/tree/lib.php

index e48643d..81dfe81 100644 (file)
@@ -368,6 +368,14 @@ if ($moving) {
 
 echo $OUTPUT->container_end();
 
+$PAGE->requires->yui_module('moodle-core-formchangechecker',
+    'M.core_formchangechecker.init',
+    array(array(
+        'formid' => 'gradetreeform'
+    ))
+);
+$PAGE->requires->string_for_js('changesmadereallygoaway', 'moodle');
+
 echo $OUTPUT->footer();
 
 // Restore original show/hide preference if moving
index c05eb92..ba65d9d 100644 (file)
@@ -671,6 +671,7 @@ class grade_edit_tree_column_aggregation extends grade_edit_tree_column_category
         } else {
             $attributes = array();
             $attributes['id'] = 'aggregation_'.$category->id;
+            $attributes['class'] = 'ignoredirty';
             $aggregation = html_writer::label(get_string('aggregation', 'grades'), 'aggregation_'.$category->id, false, array('class' => 'accesshide'));
             $aggregation .= html_writer::select($options, 'aggregation_'.$category->id, $category->aggregation, null, $attributes);
             $action = new component_action('change', 'update_category_aggregation', array('courseid' => $params['id'], 'category' => $category->id, 'sesskey' => sesskey()));