Merge branch MDL-29189-master of git://github.com/samhemelryk/moodle
authorAparup Banerjee <aparup@moodle.com>
Tue, 13 Sep 2011 03:38:55 +0000 (11:38 +0800)
committerAparup Banerjee <aparup@moodle.com>
Tue, 13 Sep 2011 03:39:06 +0000 (11:39 +0800)
 - resolved conflicts.

1  2 
course/lib.php
grade/export/xml/grade_export_xml.php
lib/db/upgrade.php
lib/navigationlib.php
mod/assignment/lib.php
mod/feedback/analysis_to_excel.php
mod/survey/download.php
version.php

diff --cc course/lib.php
@@@ -3263,8 -3260,11 +3269,11 @@@ function make_editing_buttons(stdClass 
   */
  function course_format_name ($course,$max=100) {
  
-     $str = $course->shortname.': '. $course->fullname;
+     $context = get_context_instance(CONTEXT_COURSE, $course->id);
+     $shortname = format_string($course->shortname, true, array('context' => $context));
+     $str = $shortname.': '. $course->fullname;
 -    if (strlen($str) <= $max) {
 +    if (textlib::strlen($str) <= $max) {
          return $str;
      }
      else {
@@@ -38,10 -38,11 +38,11 @@@ class grade_export_xml extends grade_ex
          $strgrades = get_string('grades');
  
          /// Calculate file name
-         $downloadfilename = clean_filename("{$this->course->shortname} $strgrades.xml");
+         $shortname = format_string($this->course->shortname, true, array('context' => get_context_instance(CONTEXT_COURSE, $this->course->id)));
+         $downloadfilename = clean_filename("$shortname $strgrades.xml");
  
 -        make_upload_directory('temp/gradeexport');
 -        $tempfilename = $CFG->dataroot .'/temp/gradeexport/'. md5(sesskey().microtime().$downloadfilename);
 +        make_temp_directory('gradeexport');
 +        $tempfilename = $CFG->tempdir .'/gradeexport/'. md5(sesskey().microtime().$downloadfilename);
          if (!$handle = fopen($tempfilename, 'w+b')) {
              print_error('cannotcreatetempdir');
          }
          upgrade_main_savepoint(true, 2011083100.02);
      }
  
 -    if ($oldversion < 2011090800) {
 +    if ($oldversion < 2011090700.01) {
 +        // Changing the default of field secret on table registration_hubs to NULL
 +        $table = new xmldb_table('registration_hubs');
 +        $field = new xmldb_field('secret', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'confirmed');
 +
 +        // Launch change of default for field secret
 +        $dbman->change_field_default($table, $field);
 +
 +        // Main savepoint reached
 +        upgrade_main_savepoint(true, 2011090700.01);
 +    }
 +
 +    if ($oldversion < 2011091200.00) {
 +        //preference not required since 2.0
 +        $DB->delete_records('user_preferences', array('name'=>'message_showmessagewindow'));
 +
 +        //re-introducing emailstop. check that its turned off so people dont suddenly stop getting notifications
 +        $DB->set_field('user', 'emailstop', 0, array('emailstop' => 1));
 +
 +        upgrade_main_savepoint(true, 2011091200.00);
 +    }
 +
++    if ($oldversion < 2011091300.00) {
+         // Increase the length of the of the course shortname field as it is now going
+         // to be consistently filtered and 100 characters is practically useless for
+         // things like the multilang filter.
+         $table = new xmldb_table('course');
+         $field = new xmldb_field('shortname', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'fullname');
+         $index = new xmldb_index('shortname', XMLDB_INDEX_NOTUNIQUE, array('shortname'));
+         // First check the shortname field exists... pretty heavy mod if it doesnt!
+         if ($dbman->field_exists($table, $field)) {
+             // Conditionally launch drop index shortname, this is required to happen
+             // before we can edit the field.
+             if ($dbman->index_exists($table, $index)) {
+                 $dbman->drop_index($table, $index);
+             }
+             // Launch change of precision for field shortname
+             $dbman->change_field_precision($table, $field);
+             // Add the index back to the table now that we're finished our mods
+             $dbman->add_index($table, $index);
+         }
+         // Main savepoint reached
 -        upgrade_main_savepoint(true, 2011090800);
++        upgrade_main_savepoint(true, 2011091300.00);
+     }
      return true;
  }
  
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc version.php
@@@ -31,7 -31,7 +31,7 @@@ defined('MOODLE_INTERNAL') || die()
  
  
  
- $version  = 2011091200.00;              // YYYYMMDD      = weekly release date of this DEV branch
 -$version  = 2011090800.00;              // YYYYMMDD      = weekly release date of this DEV branch
++$version  = 2011091300.00;              // YYYYMMDD      = weekly release date of this DEV branch
                                          //         RR    = release increments - 00 in DEV branches
                                          //           .XX = incremental changes