Merge branch 'MDL-26647-master' of git://github.com/sammarshallou/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 11 Nov 2011 02:37:55 +0000 (03:37 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 11 Nov 2011 02:37:55 +0000 (03:37 +0100)
Conflicts:
lib/db/upgrade.php
report/completion/index.php
report/progress/index.php
version.php

1  2 
lang/en/admin.php
lib/db/upgrade.php
lib/moodlelib.php
mod/assignment/lib.php
mod/forum/lib.php
mod/scorm/report/basic/report.php
report/completion/index.php
report/progress/index.php
theme/base/style/core.css
version.php

Simple merge
      }
  
      if ($oldversion < 2011102700.01) {
 -        upgrade_main_savepoint(true, 2011102700.01);
 +        // purge everything related to abandoned experimental global search
 +
 +        // unset setting - this disables it in case user does not delete the dirs
 +        unset_config('enableglobalsearch');
 +
 +        // Delete block, instances and db table
 +        $table = new xmldb_table('block_search_documents');
 +        if ($dbman->table_exists($table)) {
 +            $instances = $DB->get_records('block_instances', array('blockname'=>'search'));
 +            foreach($instances as $instance) {
 +                context_helper::delete_instance(CONTEXT_BLOCK, $instance->id);
 +                $DB->delete_records('block_positions', array('blockinstanceid' => $instance->id));
 +                $DB->delete_records('block_instances', array('id' => $instance->id));
 +            }
 +            $DB->delete_records('block', array('name'=>'search'));
 +
 +            $dbman->drop_table($table);
 +        }
 +
 +        // purge all settings used by the search block
 +        $like = $DB->sql_like('name', '?', true, true, false, '|');
 +        $params = array($DB->sql_like_escape('block_search_', '|') . '%', $DB->sql_like_escape('search_in_', '|') . '%');
 +        $settings = $DB->get_records_select('config', "$like OR $like", $params);
 +        foreach ($settings as $setting) {
 +            unset_config($setting->name);
 +        }
 +
 +        upgrade_main_savepoint(true, 2011102700.01);
 +    }
 +
++    if ($oldversion < 2011110200.01) {
+         // Rename 'extrauserselectorfields' to 'showuseridentity' as it is
+         // being used more widely
+         if (isset($CFG->extrauserselectorfields)) {
+             set_config('showuseridentity', $CFG->extrauserselectorfields);
+             unset_config('extrauserselectorfields');
+         }
+         unset_config('grade_report_showuseridnumber');
++        upgrade_main_savepoint(true, 2011110200.01);
+     }
 +
      return true;
  }
  
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -45,8 -45,9 +45,9 @@@ $edituser = optional_param('edituser', 
  
  
  $course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
+ $context = context_course::instance($course->id);
  
 -$url = new moodle_url('/course/report/completion/index.php', array('course'=>$course->id));
 +$url = new moodle_url('/report/completion/index.php', array('course'=>$course->id));
  $PAGE->set_url($url);
  $PAGE->set_pagelayout('report');
  
@@@ -77,8 -79,7 +79,7 @@@ function csv_quote($value) 
  // Check permissions
  require_login($course);
  
- $context=get_context_instance(CONTEXT_COURSE, $course->id);
 -require_capability('coursereport/completion:view', $context);
 +require_capability('report/completion:view', $context);
  
  // Get group mode
  $group = groups_get_course_group($course, true); // Supposed to verify group
@@@ -552,10 -555,10 +555,10 @@@ if (!$csv) 
  foreach ($progress as $user) {
  
      // User name
 -    if($csv) {
 +    if ($csv) {
          print csv_quote(fullname($user));
-         if ($idnumbers) {
-             print $sep.csv_quote($user->idnumber);
+         foreach ($extrafields as $field) {
+             echo $sep . csv_quote($user->{$field});
          }
      } else {
          print PHP_EOL.'<tr id="user-'.$user->id.'">';
@@@ -30,10 -6,11 +30,11 @@@ define('COMPLETION_REPORT_PAGE', 25)
  
  // Get course
  $id = required_param('course',PARAM_INT);
 -$course=$DB->get_record('course',array('id'=>$id));
 -if(!$course) {
 +$course = $DB->get_record('course',array('id'=>$id));
 +if (!$course) {
      print_error('invalidcourseid');
  }
+ $context = context_course::instance($course->id);
  
  // Sort (default lastname, optionally firstname)
  $sort = optional_param('sort','',PARAM_ALPHA);
@@@ -48,13 -25,11 +49,11 @@@ $csv = $format == 'csv' || $excel
  $start   = optional_param('start', 0, PARAM_INT);
  $sifirst = optional_param('sifirst', 'all', PARAM_ALPHA);
  $silast  = optional_param('silast', 'all', PARAM_ALPHA);
 -$start = optional_param('start',0,PARAM_INT);
 +$start   = optional_param('start', 0, PARAM_INT);
  
- // Whether to show idnumber
- // TODO: This should really not be using a config option 'intended' for
- // gradebook, but that option is also used in quiz reports as well. There ought
- // to be a generic option somewhere.
- $idnumbers = $CFG->grade_report_showuseridnumber;
+ // Whether to show extra user identity information
+ $extrafields = get_extra_user_fields($context);
+ $leftcols = 1 + count($extrafields);
  
  function csv_quote($value) {
      global $excel;
@@@ -82,12 -57,11 +81,11 @@@ $PAGE->set_pagelayout('report')
  require_login($course);
  
  // Check basic permission
- $context = get_context_instance(CONTEXT_COURSE,$course->id);
 -require_capability('coursereport/progress:view',$context);
 +require_capability('report/progress:view',$context);
  
  // Get group mode
 -$group=groups_get_course_group($course,true); // Supposed to verify group
 -if($group===0 && $course->groupmode==SEPARATEGROUPS) {
 +$group = groups_get_course_group($course,true); // Supposed to verify group
 +if ($group===0 && $course->groupmode==SEPARATEGROUPS) {
      require_capability('moodle/site:accessallgroups',$context);
  }
  
@@@ -349,10 -326,10 +349,10 @@@ if ($csv) 
  // Row for each user
  foreach($progress as $user) {
      // User name
 -    if($csv) {
 +    if ($csv) {
          print csv_quote(fullname($user));
-         if ($idnumbers) {
-             print $sep.csv_quote($user->idnumber);
+         foreach ($extrafields as $field) {
+             echo $sep . csv_quote($user->{$field});
          }
      } else {
          print '<tr><th scope="row"><a href="'.$CFG->wwwroot.'/user/view.php?id='.
@@@ -361,9 -361,17 +361,10 @@@ table.mod_index {width:100%;
   */
  .completion-expired {background:#FFDDDD;}
  .completion-expected {font-size:0.75em;}
- .completion-sortchoice {font-size:0.75em;vertical-align:bottom;}
+ .completion-sortchoice,
+ .completion-identifyfield {font-size:0.75em;vertical-align:bottom;}
  .completion-progresscell {text-align:right;}
  .completion-expired .completion-expected {font-weight:bold;}
 -#page-course-report-progress-index th,
 -#page-course-report-progress-index td {padding:2px 4px;font-weight:normal;border-right: 1px solid #EEE;}
 -#page-course-report-progress-index .progress-actions {text-align:center;}
 -#page-course-report-progress-index .completion_pagingbar {margin:1em 0;text-align:center;}
 -#page-course-report-progress-index .completion_prev {display:inline;margin-right:2em;}
 -#page-course-report-progress-index .completion_pagingbar p {display:inline;margin:0;}
 -#page-course-report-progress-index .completion_next {display:inline;margin-left:2em;}
  
  /**
   * Tags
diff --cc version.php
@@@ -30,8 -30,7 +30,7 @@@
  defined('MOODLE_INTERNAL') || die();
  
  
- $version  = 2011110200.00;              // YYYYMMDD      = weekly release date of this DEV branch
 -$version  = 2011102700.01;              // YYYYMMDD      = weekly release date of this DEV branch
++$version  = 2011110200.01;              // YYYYMMDD      = weekly release date of this DEV branch
                                          //         RR    = release increments - 00 in DEV branches
                                          //           .XX = incremental changes