Merge branch 'wip-MDL-46576-master' of git://github.com/abgreeve/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 6 Oct 2014 17:06:13 +0000 (18:06 +0100)
committerDan Poltawski <dan@moodle.com>
Mon, 6 Oct 2014 17:06:13 +0000 (18:06 +0100)
Conflicts:
lib/upgrade.txt
    lib/db/upgrade.php
version.php

1  2 
lib/db/upgrade.php
lib/upgrade.txt
version.php

@@@ -3837,5 -3837,92 +3837,92 @@@ function xmldb_main_upgrade($oldversion
          upgrade_main_savepoint(true, 2014100100.00);
      }
  
 -    if ($oldversion < 2014100300.01) {
++    if ($oldversion < 2014100600.01) {
+         // Define field aggregationstatus to be added to grade_grades.
+         $table = new xmldb_table('grade_grades');
+         $field = new xmldb_field('aggregationstatus', XMLDB_TYPE_CHAR, '10', null, XMLDB_NOTNULL, null, 'unknown', 'timemodified');
+         // Conditionally launch add field aggregationstatus.
+         if (!$dbman->field_exists($table, $field)) {
+             $dbman->add_field($table, $field);
+         }
+         $field = new xmldb_field('aggregationweight', XMLDB_TYPE_NUMBER, '10, 5', null, null, null, null, 'aggregationstatus');
+         // Conditionally launch add field aggregationweight.
+         if (!$dbman->field_exists($table, $field)) {
+             $dbman->add_field($table, $field);
+         }
+         // Define field aggregationcoef2 to be added to grade_items.
+         $table = new xmldb_table('grade_items');
+         $field = new xmldb_field('aggregationcoef2', XMLDB_TYPE_NUMBER, '10, 5', null, XMLDB_NOTNULL, null, '0', 'aggregationcoef');
+         // Conditionally launch add field aggregationcoef2.
+         if (!$dbman->field_exists($table, $field)) {
+             $dbman->add_field($table, $field);
+         }
+         $field = new xmldb_field('weightoverride', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0', 'needsupdate');
+         // Conditionally launch add field weightoverride.
+         if (!$dbman->field_exists($table, $field)) {
+             $dbman->add_field($table, $field);
+         }
+         // Main savepoint reached.
 -        upgrade_main_savepoint(true, 2014100300.01);
++        upgrade_main_savepoint(true, 2014100600.01);
+     }
 -    if ($oldversion < 2014100300.02) {
++    if ($oldversion < 2014100600.02) {
+         // Define field aggregationcoef2 to be added to grade_items_history.
+         $table = new xmldb_table('grade_items_history');
+         $field = new xmldb_field('aggregationcoef2', XMLDB_TYPE_NUMBER, '10, 5', null, XMLDB_NOTNULL, null, '0', 'aggregationcoef');
+         // Conditionally launch add field aggregationcoef2.
+         if (!$dbman->field_exists($table, $field)) {
+             $dbman->add_field($table, $field);
+         }
+         // Main savepoint reached.
 -        upgrade_main_savepoint(true, 2014100300.02);
++        upgrade_main_savepoint(true, 2014100600.02);
+     }
 -    if ($oldversion < 2014100300.03) {
++    if ($oldversion < 2014100600.03) {
+         // Define field weightoverride to be added to grade_items_history.
+         $table = new xmldb_table('grade_items_history');
+         $field = new xmldb_field('weightoverride', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0', 'decimals');
+         // Conditionally launch add field weightoverride.
+         if (!$dbman->field_exists($table, $field)) {
+             $dbman->add_field($table, $field);
+         }
+         // Main savepoint reached.
 -        upgrade_main_savepoint(true, 2014100300.03);
++        upgrade_main_savepoint(true, 2014100600.03);
+     }
 -    if ($oldversion < 2014100300.04) {
++    if ($oldversion < 2014100600.04) {
+         // Set flags so we can display a notice on all courses that might
+         // be affected by the uprade to natural aggregation.
+         if (!get_config('grades_sumofgrades_upgrade_flagged', 'core')) {
+             // 13 == SUM_OF_GRADES.
+             $sql = 'SELECT DISTINCT courseid
+                       FROM {grade_categories}
+                      WHERE aggregation = ?';
+             $courses = $DB->get_records_sql($sql, array(13));
+             foreach ($courses as $course) {
+                 set_config('show_sumofgrades_upgrade_' . $course->courseid, 1);
+             }
+             set_config('grades_sumofgrades_upgrade_flagged', 1);
+         }
+         // Main savepoint reached.
 -        upgrade_main_savepoint(true, 2014100300.04);
++        upgrade_main_savepoint(true, 2014100600.04);
+     }
      return true;
  }
diff --cc lib/upgrade.txt
@@@ -13,9 -13,9 +13,12 @@@ information provided here is intended e
  * New function cm_info::create($cm) can be used when you need a cm_info
    object, but have a $cm which might only be a standard database record.
  * $CFG->enablegroupmembersonly no longer exists.
 +* Scheduled tasks have gained support for syntax to introduce variability when a
 +  task will run across installs. When a when hour or minute are defined as 'R'
 +  they will be installed with a random hour/minute value.
+ * Several classes grade_edit_tree_column_xxx were removed since grades setup page
+   has been significantly changed. These classes should not be used outside of
+   gradebook or developers can copy them into their plugins from 2.7 branch.
  
  DEPRECATIONS:
  * completion_info->get_incomplete_criteria() is deprecated and will be removed in Moodle 3.0.
diff --cc version.php
@@@ -29,7 -29,7 +29,7 @@@
  
  defined('MOODLE_INTERNAL') || die();
  
- $version  = 2014100200.01;              // YYYYMMDD      = weekly release date of this DEV branch.
 -$version  = 2014100300.04;              // YYYYMMDD      = weekly release date of this DEV branch.
++$version  = 2014100600.04;              // YYYYMMDD      = weekly release date of this DEV branch.
                                          //         RR    = release increments - 00 in DEV branches.
                                          //           .XX = incremental changes.