return $this->short_name;
}
+ public function sortName()
+ {
+ return $this->sort_name;
+ }
+
public function firstName()
{
return $this->firstname_ordinary;
IF (ppn.firstname_ordinary = \'\', ppn.firstname_main, ppn.firstname_ordinary) AS firstname_ordinary,
IF (ppn.lastname_ordinary = \'\', ppn.lastname_main, ppn.lastname_ordinary) AS lastname_ordinary,
pd.yourself, pd.promo, pd.short_name, pd.public_name AS full_name,
- pd.directory_name, pd.public_name, pd.private_name,
+ pd.directory_name, pd.public_name, pd.private_name, pd.sort_name,
IF (pp.pub >= {?}, pp.display_tel, NULL) AS mobile,
(ph.pub >= {?} AND ph.attach IS NOT NULL) AS has_photo, ph.pub as photo_pub,
ph.x AS photo_width, ph.y AS photo_height,
IF(ef.email IS NULL, NULL, CONCAT(ef.email, \'@\', df.name)) AS forlife_alternate,
IF(eb.email IS NULL, NULL, CONCAT(eb.email, \'@\', mb.name)) AS bestalias,
(er.redirect IS NULL AND a.state = \'active\' AND FIND_IN_SET(\'mail\', at.perms)) AS lost,
- a.email, a.full_name, a.directory_name, a.display_name, a.sex = \'female\' AS gender,
+ a.email, a.full_name, a.directory_name, a.display_name, a.sort_name, a.sex = \'female\' AS gender,
IF(a.state = \'active\', CONCAT(at.perms, \',\', IF(a.user_perms IS NULL, \'\', a.user_perms)), \'\') AS perms,
a.user_perms, a.email_format, a.is_admin, a.state, a.type, at.description AS type_description, a.skin,
FIND_IN_SET(\'watch\', a.flags) AS watch, a.comment,
return $this->profile()->directory_name;
}
+ public function sortName()
+ {
+ if (!$this->hasProfile()) {
+ return $this->sort_name;
+ }
+ return $this->profile()->sort_name;
+ }
+
static public function compareDirectoryName($a, $b)
{
return strcasecmp(replace_accent($a->directoryName()), replace_accent($b->directoryName()));