Hide unused nationalities
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 16 Apr 2007 19:50:51 +0000 (19:50 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 16 Apr 2007 19:50:51 +0000 (19:50 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1708 839d8a87-29fc-0310-9880-83ba4fa771e5

modules/search.php

index 5a64865..832786d 100644 (file)
@@ -363,7 +363,8 @@ class SearchModule extends PLModule
             $db = '`groupesx_def`';
             break;
           case 'nationalite':
-            $db = '`geoloc_pays`';
+            $db = '`geoloc_pays` INNER JOIN 
+                   `auth_user_md5` ON (`geoloc_pays`.`a2` = `auth_user_md5`.`nationalite`)';
             $field = 'IF(`nat`=\'\', `pays`, `nat`)';
             $id = '`a2`';
             break;
@@ -400,6 +401,7 @@ class SearchModule extends PLModule
         $page->assign('list', XDB::iterator('SELECT  '.$field.' AS field,
                                                      '.$id.' AS id
                                                FROM  '.$db.$where.'
+                                           GROUP BY  '.$field.'
                                            ORDER BY  '.$field));
     }
 }