Merge commit 'origin/master' into fusionax
[platal.git] / modules / profile / mentor.inc.php
index d8579e4..54858b9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -78,9 +78,9 @@ class ProfileCountry implements ProfileSetting
         $success = true;
         if (is_null($value)) {
             $value = array();
-            $res = XDB::iterRow("SELECT  m.country, p.pays
+            $res = XDB::iterRow("SELECT  m.country, gc.countryFR
                                    FROM  profile_mentor_country AS m
-                             INNER JOIN  geoloc_pays            AS p ON (m.country = p.a2)
+                             INNER JOIN  geoloc_countries       AS gc ON (m.country = gc.iso_3166_1_a2)
                                   WHERE  m.uid = {?}",
                                 S::i('uid'));
             while (list($id, $name) = $res->next()) {
@@ -153,6 +153,10 @@ class ProfileMentor extends ProfilePage
     {
         $page->assign('secteurs_sel', XDB::iterator("SELECT  id, name AS label
                                                        FROM  profile_job_sector_enum"));
+
+        $page->assign('countryList', XDB::iterator("SELECT  iso_3166_1_a2, countryFR
+                                                      FROM  geoloc_countries
+                                                  ORDER BY  countryFR"));
     }
 }