Displays users without profile in alphabetic lists (Closes #1504).
authorStéphane Jacob <sj@m4x.org>
Wed, 1 Jun 2011 16:48:47 +0000 (18:48 +0200)
committerStéphane Jacob <sj@m4x.org>
Wed, 1 Jun 2011 16:48:47 +0000 (18:48 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
ChangeLog
classes/userfilter/conditions.inc.php

index 10f4165..cc04a38 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,7 @@ Bug/Wish:
     * XnetGrp:
         - #947: Lists group former members to group admins                 -JAC
         - #1481: Adds group nl subscription from group profile edition     -JAC
+        - #1504: Displays users without profile in alphabetic lists        -JAC
 
     * XnetEvent:
         - #1487: Removes link to event attending users to group outsiders  -JAC
index e931395..ad4dfb2 100644 (file)
@@ -598,8 +598,15 @@ class UFC_NameInitial extends UserFilterCondition
 
     public function buildCondition(PlFilter $uf)
     {
-        $sub = $uf->addDisplayFilter();
-        return 'SUBSTRING(pd.sort_name, 1, 1) ' . XDB::formatWildcards(XDB::WILDCARD_PREFIX, $this->initial);
+        $table = 'sort_name';
+        if ($uf->accountsRequired()) {
+            $table = Profile::getAccountEquivalentName($table);
+            $sub = 'a';
+        } else {
+            $uf->addDisplayFilter();
+            $sub = 'pd';
+        }
+        return 'SUBSTRING(' . $sub . '.' . $table . ', 1, 1) ' . XDB::formatWildcards(XDB::WILDCARD_PREFIX, $this->initial);
     }
 
     public function export()