Change sorting order on ML display to use sort_name.
[platal.git] / classes / direnum.php
index f7100c5..777653b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2011 Polytechnique.org                              *
+ *  Copyright (C) 2003-2014 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -625,7 +625,9 @@ class DE_Localities extends DE_AddressesComponents
                                                                              AND pac1.groupid = pac2.groupid AND pac1.type = pac2.type)
                   INNER JOIN  profile_addresses_components_enum AS pace2 ON (pac2.component_id = pace2.id AND FIND_IN_SET('country', pace2.types))
                        WHERE  pace2.id = {?} AND FIND_IN_SET('locality', pace1.types) AND pac1.type = 'home' AND " . $where . "
-                    GROUP BY  pace1.long_name";
+                    GROUP BY  pace1.long_name
+                    ORDER BY  nb DESC, field
+                       LIMIT  " . self::AUTOCOMPLETE_LIMIT;
             return XDB::fetchAllAssoc($query, $sub_id);
         }
     }
@@ -752,5 +754,5 @@ class DE_Skins extends DirEnumeration
 }
 // }}}
 
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
 ?>