MDL-31776 - lib: Alternate name fields

Add support for additional name fields and flexible formating of
user names.
This commit is contained in:
Adrian Greeve
2013-07-09 11:45:50 +08:00
committed by Damyon Wiese
parent 9d871499fe
commit a327f25ef1
37 changed files with 612 additions and 178 deletions
+2 -2
View File
@@ -131,7 +131,8 @@ class user_picture implements renderable {
* @var array List of mandatory fields in user record here. (do not include
* TEXT columns because it would break SELECT DISTINCT in MSSQL and ORACLE)
*/
protected static $fields = array('id', 'picture', 'firstname', 'lastname', 'imagealt', 'email');
protected static $fields = array('id', 'picture', 'firstname', 'lastname', 'firstnamephonetic', 'lastnamephonetic',
'middlename', 'alternatename', 'imagealt', 'email');
/**
* @var stdClass A user object with at least fields all columns specified
@@ -224,7 +225,6 @@ class user_picture implements renderable {
if ($tableprefix) {
$tableprefix .= '.';
}
$fields = array();
foreach (self::$fields as $field) {
if ($field === 'id' and $idalias and $idalias !== 'id') {
$fields[$field] = "$tableprefix$field AS $idalias";