Merge branch 'MDL-35763' of git://github.com/netspotau/moodle-mod_assign
authorSam Hemelryk <sam@moodle.com>
Sun, 7 Oct 2012 21:44:10 +0000 (10:44 +1300)
committerSam Hemelryk <sam@moodle.com>
Sun, 7 Oct 2012 21:44:10 +0000 (10:44 +1300)
21 files changed:
admin/roles/lib.php
enrol/manual/manage.php
grade/report/user/lib.php
group/members.php
install/lang/es_mx/install.php
install/lang/uk/install.php [new file with mode: 0644]
lib/datalib.php
lib/grade/grade_category.php
lib/grade/tests/grade_category_test.php
lib/tests/datalib_test.php
lib/yui/dragdrop/dragdrop.js
message/renderer.php
mod/assign/lang/en/assign.php
mod/assign/renderer.php
mod/book/lang/en/book.php
mod/book/view.php
mod/workshop/locallib.php
report/stats/locallib.php
theme/standard/style/core.css
user/selector/lib.php
version.php

index 078d2ef..5765cf5 100644 (file)
@@ -1596,13 +1596,10 @@ class admins_existing_selector extends user_selector_base {
         }
 
         $mainadmin = array();
-        $adminids = explode(',', $CFG->siteadmins);
-        foreach ($adminids as $id) {
-            if (isset($availableusers[$id])) {
-                $mainadmin = array($id=>$availableusers[$id]);
-                unset($availableusers[$id]);
-                break;
-            }
+        $mainadminuser = get_admin();
+        if ($mainadminuser && isset($availableusers[$mainadminuser->id])) {
+            $mainadmin = array($mainadminuser->id => $availableusers[$mainadminuser->id]);
+            unset($availableusers[$mainadminuser->id]);
         }
 
         $result = array();
index 46d1b77..f7eab04 100644 (file)
@@ -63,7 +63,7 @@ $PAGE->set_heading($course->fullname);
 navigation_node::override_active_url(new moodle_url('/enrol/users.php', array('id'=>$course->id)));
 
 // Create the user selector objects.
-$options = array('enrolid' => $enrolid);
+$options = array('enrolid' => $enrolid, 'accesscontext' => $context);
 
 $potentialuserselector = new enrol_manual_potential_participant('addselect', $options);
 $currentuserselector = new enrol_manual_current_participant('removeselect', $options);
index 37486f0..8b7cfeb 100644 (file)
@@ -228,26 +228,6 @@ class grade_report_user extends grade_report {
         }
         $count = 1;
         foreach ($element['children'] as $key=>$child) {
-
-            $grade_object = $child['object'];
-            // If grade object isn't hidden
-            if ($grade_object->hidden != 1) {
-
-                // If grade object is an module instance
-                if (!empty($grade_object->itemmodule) && !empty($grade_object->iteminstance)) {
-
-                    $instances = $this->gtree->modinfo->get_instances();
-                    // If we can find the module instance
-                    if (!empty($instances[$grade_object->itemmodule][$grade_object->iteminstance])) {
-
-                        $cm = $instances[$grade_object->itemmodule][$grade_object->iteminstance];
-                        // Skip generating rowspans if the user cannot see the module instance
-                        if (!$cm->uservisible) {
-                            continue;
-                        }
-                    }
-                }
-            }
             $count += $this->inject_rowspans($element['children'][$key]);
         }
         $element['rowspan'] = $count;
index a8b74ef..9a013bd 100644 (file)
@@ -35,7 +35,7 @@ $group = $DB->get_record('groups', array('id'=>$groupid), '*', MUST_EXIST);
 $course = $DB->get_record('course', array('id'=>$group->courseid), '*', MUST_EXIST);
 
 $PAGE->set_url('/group/members.php', array('group'=>$groupid));
-$PAGE->set_pagelayout('standard');
+$PAGE->set_pagelayout('admin');
 
 require_login($course);
 $context = context_course::instance($course->id);
index 91a4a09..7de314e 100644 (file)
@@ -85,7 +85,7 @@ $string['phpversionhelp'] = '<p>Moodle requiere al menos una versión de PHP 4.3
 (En caso de 5.0.x podría también revertir a la versión 4.4.x)</p>';
 $string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
 $string['welcomep20'] = 'Si está viendo esta página es porque ha podido ejecutar el paquete <strong>{$a->packname} {$a->packversion}</strong> en su computadora. !Enhorabuena!';
-$string['welcomep30'] = 'Esta versión de <strong>{$a->installername}</strong> incluye las aplicaciones necesarias para que <strong>Moodle</strong> funcione en su computadora principalmente:';
+$string['welcomep30'] = 'Esta versión de <strong>{$a->installername}</strong> incluye las aplicaciones necesarias para que <strong>Moodle</strong> funcione en su computadora principalmente:';
 $string['welcomep40'] = 'El paquete también incluye <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
 $string['welcomep50'] = 'El uso de todas las aplicaciones del paquete está gobernado por sus respectivas
     licencias. El programa <strong>{$a->installername}</strong> es
diff --git a/install/lang/uk/install.php b/install/lang/uk/install.php
new file mode 100644 (file)
index 0000000..c132e32
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Automatically generated strings for Moodle installer
+ *
+ * Do not edit this file manually! It contains just a subset of strings
+ * needed during the very first steps of installation. This file was
+ * generated automatically by export-installer.php (which is part of AMOS
+ * {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
+ * list of strings defined in /install/stringnames.txt.
+ *
+ * @package   installer
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$string['databasehost'] = 'Сервер бази даних';
+$string['databasename'] = 'Ім’я бази даних';
index 2167d66..4e47268 100644 (file)
@@ -252,7 +252,7 @@ function users_order_by_sql($usertablealias = '', $search = null, context $conte
 
     $fieldstocheck = array_merge(array('firstname', 'lastname'), get_extra_user_fields($context));
     foreach ($fieldstocheck as $key => $field) {
-        $exactconditions[] = $tableprefix . $field . ' = :' . $paramkey;
+        $exactconditions[] = 'LOWER(' . $tableprefix . $field . ') = LOWER(:' . $paramkey . ')';
         $params[$paramkey] = $search;
         $paramkey++;
     }
index 10656f9..5cd052d 100644 (file)
@@ -913,7 +913,10 @@ class grade_category extends grade_object {
                 // We're looking for other grade items with the same grade value but a higher grademax
                 $i = 1;
                 while ($originalindex+$i < count($grade_keys)) {
+
                     $possibleitemid = $grade_keys[$originalindex+$i];
+                    $i++;
+
                     if ($grade_values[$founditemid] != $grade_values[$possibleitemid]) {
                         // The next grade item has a different grade value. Stop looking.
                         break;
@@ -930,8 +933,6 @@ class grade_category extends grade_object {
                         $founditemid = $possibleitemid;
                         // Continue searching to see if there is an even higher grademax
                     }
-
-                    $i++;
                 }
 
                 // Now drop whatever grade item we have found
index 727e698..e4281a0 100644 (file)
@@ -516,6 +516,21 @@ class grade_category_testcase extends grade_base_testcase {
         $this->assertEquals(count($grades), 1);
         $this->assertEquals($grades[$this->grade_items[2]->id], 6);
 
+        // MDL-35667 - There was an infinite loop if several items had the same grade and at least one was extra credit
+        $category = new grade_category();
+        $category->droplow     = 1;
+        $category->aggregation = GRADE_AGGREGATE_WEIGHTED_MEAN2; // simple weighted mean
+        $items[$this->grade_items[1]->id]->aggregationcoef = 1; // Mark grade item 1 as "extra credit"
+        $grades = array($this->grade_items[0]->id=>1, // 1 out of 110. Should be excluded from aggregation.
+                        $this->grade_items[1]->id=>1, // 1 out of 100. Extra credit. Should be retained.
+                        $this->grade_items[2]->id=>1, // 1 out of 6. Should be retained.
+                        $this->grade_items[4]->id=>1);// 1 out of 100. Should be retained.
+        $category->apply_limit_rules($grades, $items);
+        $this->assertEquals(count($grades), 3);
+        $this->assertEquals($grades[$this->grade_items[1]->id], 1);
+        $this->assertEquals($grades[$this->grade_items[2]->id], 1);
+        $this->assertEquals($grades[$this->grade_items[4]->id], 1);
+
     }
 
     /**
index 96e5ce8..2d88ea9 100644 (file)
@@ -63,8 +63,8 @@ class datalib_testcase extends advanced_testcase {
         list($sort, $params) = users_order_by_sql('', 'search', context_system::instance());
         $this->assert_same_sql('CASE WHEN
                     ' . $DB->sql_fullname() . ' = :usersortexact1 OR
-                    firstname = :usersortexact2 OR
-                    lastname = :usersortexact3
+                    LOWER(firstname) = LOWER(:usersortexact2) OR
+                    LOWER(lastname) = LOWER(:usersortexact3)
                 THEN 0 ELSE 1 END, lastname, firstname, id', $sort);
         $this->assertEquals(array('usersortexact1' => 'search', 'usersortexact2' => 'search',
                 'usersortexact3' => 'search'), $params);
@@ -79,10 +79,10 @@ class datalib_testcase extends advanced_testcase {
         list($sort, $params) = users_order_by_sql('u', 'search', context_system::instance());
         $this->assert_same_sql('CASE WHEN
                     ' . $DB->sql_fullname('u.firstname', 'u.lastname') . ' = :usersortexact1 OR
-                    u.firstname = :usersortexact2 OR
-                    u.lastname = :usersortexact3 OR
-                    u.email = :usersortexact4 OR
-                    u.idnumber = :usersortexact5
+                    LOWER(u.firstname) = LOWER(:usersortexact2) OR
+                    LOWER(u.lastname) = LOWER(:usersortexact3) OR
+                    LOWER(u.email) = LOWER(:usersortexact4) OR
+                    LOWER(u.idnumber) = LOWER(:usersortexact5)
                 THEN 0 ELSE 1 END, u.lastname, u.firstname, u.id', $sort);
         $this->assertEquals(array('usersortexact1' => 'search', 'usersortexact2' => 'search',
                 'usersortexact3' => 'search', 'usersortexact4' => 'search', 'usersortexact5' => 'search'), $params);
index 20c3a81..c46205b 100644 (file)
@@ -167,6 +167,10 @@ YUI.add('moodle-core-dragdrop', function(Y) {
             // this.lastdroptarget (ghost node we use for indicating where to drop)
             e.drag = e.target;
             e.drop = this.lastdroptarget;
+            // Check that drag object belongs to correct group
+            if (!this.in_group(e.drag)) {
+                return;
+            }
             // Check that drop object belong to correct group
             if (!e.drop || !e.drop.inGroup(this.groups)) {
                 return;
index c9a8259..f92022a 100644 (file)
@@ -226,97 +226,115 @@ class core_message_renderer extends plugin_renderer_base {
         $output .= html_writer::start_tag('fieldset', array('id' => 'providers', 'class' => 'clearfix'));
         $output .= html_writer::nonempty_tag('legend', get_string('providers_config', 'message'), array('class' => 'ftoggler'));
 
-        // Display the messging options table
-        $table = new html_table();
-        $table->attributes['class'] = 'generaltable';
-        $table->data        = array();
-        $table->head        = array('');
-
-        foreach ($readyprocessors as $processor) {
-            $table->head[]  = get_string('pluginname', 'message_'.$processor->name);
+        foreach($providers as $provider) {
+            if($provider->component != 'moodle') {
+                $components[] = $provider->component;
+            }
         }
+        // Lets arrange by components so that core settings (moodle) appear as the first table.
+        $components = array_unique($components);
+        asort($components);
+        array_unshift($components, 'moodle'); // pop it in front! phew!
+        asort($providers);
 
-        $number_procs = count($processors);
-        // Populate the table with rows
-        foreach ( $providers as $provider) {
-            $preferencebase = $provider->component.'_'.$provider->name;
+        $numprocs = count($processors);
+        // Display the messaging options table(s)
+        foreach ($components as $component) {
+            $table = new html_table();
+            $table->attributes['class'] = 'generaltable';
+            $table->data = array();
+            if ($component != 'moodle') {
+                $componentname = get_string('pluginname', $component);
+            } else {
+                $componentname = get_string('coresystem');
+            }
+            $table->head = array($componentname);
 
-            $headerrow = new html_table_row();
-            $providername = get_string('messageprovider:'.$provider->name, $provider->component);
-            $providercell = new html_table_cell($providername);
-            $providercell->header = true;
-            $providercell->colspan = $number_procs + 1;
-            $providercell->attributes['class'] = 'c0';
-            $headerrow->cells = array($providercell);
-            $table->data[] = $headerrow;
+            foreach ($readyprocessors as $processor) {
+                $table->head[]  = get_string('pluginname', 'message_'.$processor->name);
+            }
 
-            foreach (array('loggedin', 'loggedoff') as $state) {
-                $optionrow = new html_table_row();
-                $optionname = new html_table_cell(get_string($state.'description', 'message'));
-                $optionname->attributes['class'] = 'c0';
-                $optionrow->cells = array($optionname);
-                foreach ($readyprocessors as $processor) {
-                    // determine the default setting
-                    $permitted = MESSAGE_DEFAULT_PERMITTED;
-                    $defaultpreference = $processor->name.'_provider_'.$preferencebase.'_permitted';
-                    if (isset($defaultpreferences->{$defaultpreference})) {
-                        $permitted = $defaultpreferences->{$defaultpreference};
-                    }
-                    // If settings are disallowed or forced, just display the
-                    // corresponding message, if not use user settings.
-                    if (in_array($permitted, array('disallowed', 'forced'))) {
-                        if ($state == 'loggedoff') {
-                            // skip if we are rendering the second line
-                            continue;
-                        }
-                        $cellcontent = html_writer::nonempty_tag('div', get_string($permitted, 'message'), array('class' => 'dimmed_text'));
-                        $optioncell = new html_table_cell($cellcontent);
-                        $optioncell->rowspan = 2;
-                        $optioncell->attributes['class'] = 'disallowed';
-                    } else {
-                        // determine user preferences and use them.
-                        $disabled = array();
-                        $checked = false;
-                        if ($notificationsdisabled) {
-                            $disabled['disabled'] = 1;
+            // Populate the table with rows
+            foreach ( $providers as $provider) {
+                if( $provider->component != $component) {
+                    continue;
+                }
+                $preferencebase = $provider->component.'_'.$provider->name;
+
+                $headerrow = new html_table_row();
+                $providername = get_string('messageprovider:'.$provider->name, $provider->component);
+                $providercell = new html_table_cell($providername);
+                $providercell->header = true;
+                $providercell->colspan = $numprocs;
+                $providercell->attributes['class'] = 'c0';
+                $headerrow->cells = array($providercell);
+                $table->data[] = $headerrow;
+
+                foreach (array('loggedin', 'loggedoff') as $state) {
+                    $optionrow = new html_table_row();
+                    $optionname = new html_table_cell(get_string($state.'description', 'message'));
+                    $optionname->attributes['class'] = 'c0';
+                    $optionrow->cells = array($optionname);
+                    foreach ($readyprocessors as $processor) {
+                        // determine the default setting
+                        $permitted = MESSAGE_DEFAULT_PERMITTED;
+                        $defaultpreference = $processor->name.'_provider_'.$preferencebase.'_permitted';
+                        if (isset($defaultpreferences->{$defaultpreference})) {
+                            $permitted = $defaultpreferences->{$defaultpreference};
                         }
-                        // See if user has touched this preference
-                        if (isset($preferences->{$preferencebase.'_'.$state})) {
-                            // User have some preferneces for this state in the database, use them
-                            $checked = isset($preferences->{$preferencebase.'_'.$state}[$processor->name]);
+                        // If settings are disallowed or forced, just display the
+                        // corresponding message, if not use user settings.
+                        if (in_array($permitted, array('disallowed', 'forced'))) {
+                            if ($state == 'loggedoff') {
+                                // skip if we are rendering the second line
+                                continue;
+                            }
+                            $cellcontent = html_writer::nonempty_tag('div', get_string($permitted, 'message'), array('class' => 'dimmed_text'));
+                            $optioncell = new html_table_cell($cellcontent);
+                            $optioncell->rowspan = 2;
+                            $optioncell->attributes['class'] = 'disallowed';
                         } else {
-                            // User has not set this preference yet, using site default preferences set by admin
-                            $defaultpreference = 'message_provider_'.$preferencebase.'_'.$state;
-                            if (isset($defaultpreferences->{$defaultpreference})) {
-                                $checked = (int)in_array($processor->name, explode(',', $defaultpreferences->{$defaultpreference}));
+                            // determine user preferences and use them.
+                            $disabled = array();
+                            $checked = false;
+                            if ($notificationsdisabled) {
+                                $disabled['disabled'] = 1;
                             }
+                            // See if user has touched this preference
+                            if (isset($preferences->{$preferencebase.'_'.$state})) {
+                                // User have some preferneces for this state in the database, use them
+                                $checked = isset($preferences->{$preferencebase.'_'.$state}[$processor->name]);
+                            } else {
+                                // User has not set this preference yet, using site default preferences set by admin
+                                $defaultpreference = 'message_provider_'.$preferencebase.'_'.$state;
+                                if (isset($defaultpreferences->{$defaultpreference})) {
+                                    $checked = (int)in_array($processor->name, explode(',', $defaultpreferences->{$defaultpreference}));
+                                }
+                            }
+                            $elementname = $preferencebase.'_'.$state.'['.$processor->name.']';
+                            // prepare language bits
+                            $processorname = get_string('pluginname', 'message_'.$processor->name);
+                            $statename = get_string($state, 'message');
+                            $labelparams = array(
+                                'provider'  => $providername,
+                                'processor' => $processorname,
+                                'state'     => $statename
+                            );
+                            $label = get_string('sendingviawhen', 'message', $labelparams);
+                            $cellcontent = html_writer::label($label, $elementname, true, array('class' => 'accesshide'));
+                            $cellcontent .= html_writer::checkbox($elementname, 1, $checked, '', array_merge(array('id' => $elementname, 'class' => 'notificationpreference'), $disabled));
+                            $optioncell = new html_table_cell($cellcontent);
+                            $optioncell->attributes['class'] = 'mdl-align';
                         }
-                        $elementname = $preferencebase.'_'.$state.'['.$processor->name.']';
-                        // prepare language bits
-                        $processorname = get_string('pluginname', 'message_'.$processor->name);
-                        $statename = get_string($state, 'message');
-                        $labelparams = array(
-                            'provider'  => $providername,
-                            'processor' => $processorname,
-                            'state'     => $statename
-                        );
-                        $label = get_string('sendingviawhen', 'message', $labelparams);
-                        $cellcontent = html_writer::label($label, $elementname, true, array('class' => 'accesshide'));
-                        $cellcontent .= html_writer::checkbox($elementname, 1, $checked, '', array_merge(array('id' => $elementname, 'class' => 'notificationpreference'), $disabled));
-                        $optioncell = new html_table_cell($cellcontent);
-                        $optioncell->attributes['class'] = 'mdl-align';
+                        $optionrow->cells[] = $optioncell;
                     }
-                    $optionrow->cells[] = $optioncell;
+                    $table->data[] = $optionrow;
                 }
-                $table->data[] = $optionrow;
             }
+            $output .= html_writer::start_tag('div', array('class' => 'messagesettingcomponent'));
+            $output .= html_writer::table($table);
+            $output .= html_writer::end_tag('div');
         }
-        $output .= html_writer::start_tag('div');
-        $output .= html_writer::table($table);
-        $output .= html_writer::end_tag('div');
-
-        $disableallcheckbox = $this->output->help_icon('disableall', 'message') . get_string('disableall', 'message') . html_writer::checkbox('disableall', 1, $notificationsdisabled, '', array('class'=>'disableallcheckbox'));
-        $output .= html_writer::nonempty_tag('div', $disableallcheckbox, array('class'=>'disableall'));
 
         $output .= html_writer::end_tag('fieldset');
 
@@ -337,6 +355,8 @@ class core_message_renderer extends plugin_renderer_base {
         $output .= get_string('blocknoncontacts', 'message').': ';
         $output .= html_writer::checkbox('blocknoncontacts', 1, $preferences->blocknoncontacts, '');
         $output .= html_writer::end_tag('div');
+        $disableallcheckbox = $this->output->help_icon('disableall', 'message') . get_string('disableall', 'message') . html_writer::checkbox('disableall', 1, $notificationsdisabled, '', array('class'=>'disableallcheckbox'));
+        $output .= html_writer::nonempty_tag('div', $disableallcheckbox, array('class'=>'disableall'));
         $output .= html_writer::end_tag('fieldset');
         $output .= html_writer::start_tag('div', array('class' => 'mdl-align'));
         $output .= html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('updatemyprofile'), 'class' => 'form-submit'));
index 61d8624..15a397e 100644 (file)
@@ -103,6 +103,7 @@ $string['duedateno'] = 'No due date';
 $string['duedatereached'] = 'The due date for this assignment has now passed';
 $string['duedatevalidation'] = 'Due date must be after the allow submissions from date.';
 $string['editsubmission'] = 'Edit my submission';
+$string['editingstatus'] = 'Editing status';
 $string['editaction'] = 'Actions...';
 $string['extensionduedate'] = 'Extension due date';
 $string['extensionnotafterduedate'] = 'Extension date must be after the due date';
index 6122b6e..a2f94da 100644 (file)
@@ -541,7 +541,7 @@ class mod_assign_renderer extends plugin_renderer_base {
         // Show graders whether this submission is editable by students.
         if ($status->view == assign_submission_status::GRADER_VIEW) {
             $row = new html_table_row();
-            $cell1 = new html_table_cell(get_string('open', 'assign'));
+            $cell1 = new html_table_cell(get_string('editingstatus', 'assign'));
             if ($status->canedit) {
                 $cell2 = new html_table_cell(get_string('submissioneditable', 'assign'));
                 $cell2->attributes = array('class'=>'submissioneditable');
index 470e18e..e15de10 100644 (file)
@@ -47,6 +47,7 @@ $string['editingchapter'] = 'Editing chapter';
 $string['chaptertitle'] = 'Chapter title';
 $string['content'] = 'Content';
 $string['subchapter'] = 'Subchapter';
+$string['nocontent'] = 'No content has been added to this book yet.';
 $string['numbering'] = 'Chapter formatting';
 $string['numbering_help'] = '* None - Chapter and subchapter titles have no formatting
 * Numbers - Chapters and subchapter titles are numbered 1, 1.1, 1.2, 2, ...
index 91b83b8..6b9365d 100644 (file)
@@ -87,13 +87,16 @@ if ($chapterid == '0') { // Go to first chapter if no given.
     }
 }
 
-if (!$chapterid or !$chapter = $DB->get_record('book_chapters', array('id'=>$chapterid, 'bookid'=>$book->id))) {
-    print_error('errorchapter', 'mod_book', new moodle_url('/course/view.php', array('id'=>$course->id)));
-}
+$courseurl = new moodle_url('/course/view.php', array('id' => $course->id));
 
-// chapter is hidden for students
-if ($chapter->hidden and !$viewhidden) {
-    print_error('errorchapter', 'mod_book', new moodle_url('/course/view.php', array('id'=>$course->id)));
+// No content in the book.
+if (!$chapterid) {
+    $PAGE->set_url('/mod/book/view.php', array('id' => $id));
+    notice(get_string('nocontent', 'mod_book'), $courseurl->out(false));
+}
+// Chapter doesnt exist or it is hidden for students
+if ((!$chapter = $DB->get_record('book_chapters', array('id' => $chapterid, 'bookid' => $book->id))) or ($chapter->hidden and !$viewhidden)) {
+    print_error('errorchapter', 'mod_book', $courseurl);
 }
 
 $PAGE->set_url('/mod/book/view.php', array('id'=>$id, 'chapterid'=>$chapterid));
index b42b4c6..000f093 100644 (file)
@@ -500,7 +500,7 @@ class workshop {
             return array();
         }
 
-        list($sort, $sortparams) = users_order_by_sql('u');
+        list($sort, $sortparams) = users_order_by_sql();
         $sql .= " ORDER BY $sort";
 
         return $DB->get_records_sql($sql, array_merge($params, $sortparams), $limitfrom, $limitnum);
index bde2b0d..5eb60c2 100644 (file)
@@ -111,7 +111,7 @@ function report_stats_report($course, $report, $mode, $user, $roleid, $time) {
 
         list($sort, $moreparams) = users_order_by_sql('u');
         $moreparams['courseid'] = $course->id;
-        $sql = "SELECT DISTINCT s.userid, u.firstname, u.lastname, u.idnumber
+        $sql = "SELECT DISTINCT u.id, u.firstname, u.lastname, u.idnumber
                   FROM {stats_user_{$param->table}} s
                   JOIN {user} u ON u.id = s.userid
                  WHERE courseid = :courseid";
index d3410e7..7e24f07 100644 (file)
@@ -450,6 +450,7 @@ table#tag-management-list {margin: 10px auto;width: 80%;}
 .portfolio-add-icon {margin-left:5px;}
 
 /* Messaging options */
+#page-message-edit .mform fieldset div.messagesettingcomponent {float: left;}
 #page-message-edit table.generaltable th.c0 {text-align: left;}
 #page-message-edit table.generaltable td.c0 {text-align: right;}
 #page-message-edit table.generaltable td.disallowed {text-align: center;vertical-align:middle;}
index 52b1b1b..71cf131 100644 (file)
@@ -735,9 +735,13 @@ abstract class groups_user_selector_base extends user_selector_base {
 class group_members_selector extends groups_user_selector_base {
     public function find_users($search) {
         list($wherecondition, $params) = $this->search_sql($search, 'u');
+
+        list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
+
         $roles = groups_get_members_by_role($this->groupid, $this->courseid,
                 $this->required_fields_sql('u') . ', gm.component',
-                null, $wherecondition, $params);
+                $sort, $wherecondition, array_merge($params, $sortparams));
+
         return $this->convert_array_format($roles, $search);
     }
 }
index 461ec10..d56d10f 100644 (file)
 defined('MOODLE_INTERNAL') || die();
 
 
-$version  = 2012092700.00;              // YYYYMMDD      = weekly release date of this DEV branch
+$version  = 2012100500.00;              // YYYYMMDD      = weekly release date of this DEV branch
                                         //         RR    = release increments - 00 in DEV branches
                                         //           .XX = incremental changes
 
-$release  = '2.4dev (Build: 20120927)'; // Human-friendly version name
+$release  = '2.4dev (Build: 20121005)'; // Human-friendly version name
 
 $branch   = '24';                       // this version's branch
 $maturity = MATURITY_ALPHA;             // this version's maturity level