Merge branch 'wip-MDL-46921-master' of git://github.com/abgreeve/moodle

This commit is contained in:
Damyon Wiese 2014-10-09 09:57:58 +08:00
commit e6b00f032d
9 changed files with 145 additions and 44 deletions

View file

@ -410,11 +410,9 @@ list($esql, $params) = get_enrolled_sql($context, null, $currentgroup, true);
$joins = array("FROM {user} u");
$wheres = array();
$extrasql = get_extra_user_fields_sql($context, 'u', '', array(
'id', 'username', 'firstname', 'lastname', 'email', 'city', 'country',
'picture', 'lang', 'timezone', 'maildisplay', 'imagealt', 'lastaccess'));
$mainuserfields = user_picture::fields('u', array('username', 'email', 'city', 'country', 'lang', 'timezone', 'maildisplay'));
$alreadyretrievedfields = explode(',', $mainuserfields);
$extrasql = get_extra_user_fields_sql($context, 'u', '', $alreadyretrievedfields);
if ($isfrontpage) {
$select = "SELECT $mainuserfields, u.lastaccess$extrasql";

View file

@ -0,0 +1,55 @@
@core
Feature: Tables can be sorted by additional names
In order to sort fields by additional names
As a user
I need to browse to a page with users in a table.
Background:
Given the following "users" exist:
| username | firstname | lastname | middlename | alternatename | email | idnumber |
| student1 | Annie | Edison | Faith | Anne | student1@mail.com | s1 |
| student2 | George | Bradley | David | gman | student2@mail.com | s2 |
| student3 | Travis | Sutcliff | Peter | Mr T | student3@mail.com | s3 |
And I log in as "admin"
And I navigate to "User policies" node in "Site administration > Users > Permissions"
And I set the following administration settings values:
| Full name format | firstname middlename lastname |
| Alternative full name format | firstname middlename alternatename lastname |
@javascript
Scenario: All user names are show and sortable in the administration user list.
Given I navigate to "Browse list of users" node in "Site administration > Users > Accounts"
# And I should see "First name / Middle name / Alternate name / Surname"
Then the following should exist in the "users" table:
| First name / Middle name / Alternate name / Surname | Email address |
| Admin User | moodle@moodlemoodle.com |
| Annie Faith Anne Edison | student1@mail.com |
| George David gman Bradley | student2@mail.com |
| Travis Peter Mr T Sutcliff | student3@mail.com |
And "Admin User" "table_row" should appear before "Annie Faith Anne Edison" "table_row"
And "Annie Faith Anne Edison" "table_row" should appear before "George David gman Bradley" "table_row"
And "George David gman Bradley" "table_row" should appear before "Travis Peter Mr T Sutcliff" "table_row"
And I follow "Middle name"
And "George David gman Bradley" "table_row" should appear before "Annie Faith Anne Edison" "table_row"
And "Annie Faith Anne Edison" "table_row" should appear before "Travis Peter Mr T Sutcliff" "table_row"
And "Travis Peter Mr T Sutcliff" "table_row" should appear before "Admin User" "table_row"
And I follow "Middle name"
And "George David gman Bradley" "table_row" should appear after "Annie Faith Anne Edison" "table_row"
And "Annie Faith Anne Edison" "table_row" should appear after "Travis Peter Mr T Sutcliff" "table_row"
And "Travis Peter Mr T Sutcliff" "table_row" should appear after "Admin User" "table_row"
And I follow "Alternate name"
And "Annie Faith Anne Edison" "table_row" should appear before "George David gman Bradley" "table_row"
And "George David gman Bradley" "table_row" should appear before "Travis Peter Mr T Sutcliff" "table_row"
And "Travis Peter Mr T Sutcliff" "table_row" should appear before "Admin User" "table_row"
And I follow "Alternate name"
And "Annie Faith Anne Edison" "table_row" should appear after "George David gman Bradley" "table_row"
And "George David gman Bradley" "table_row" should appear after "Travis Peter Mr T Sutcliff" "table_row"
And "Travis Peter Mr T Sutcliff" "table_row" should appear after "Admin User" "table_row"
And I follow "Surname"
And "George David gman Bradley" "table_row" should appear before "Annie Faith Anne Edison" "table_row"
And "Annie Faith Anne Edison" "table_row" should appear before "Travis Peter Mr T Sutcliff" "table_row"
And "Travis Peter Mr T Sutcliff" "table_row" should appear before "Admin User" "table_row"
And I follow "Surname"
And "George David gman Bradley" "table_row" should appear after "Annie Faith Anne Edison" "table_row"
And "Annie Faith Anne Edison" "table_row" should appear after "Travis Peter Mr T Sutcliff" "table_row"
And "Travis Peter Mr T Sutcliff" "table_row" should appear after "Admin User" "table_row"