Fixes some primary education issues.
authorStéphane Jacob <jacou@melix.net>
Tue, 23 Dec 2008 23:54:56 +0000 (00:54 +0100)
committerStéphane Jacob <jacou@melix.net>
Tue, 23 Dec 2008 23:55:09 +0000 (00:55 +0100)
include/user.func.inc.php
upgrade/newdirectory-0.0.1/10_promotion.sql

index 38b17ad..126569a 100644 (file)
@@ -357,7 +357,7 @@ function &get_user_details($login, $from_uid = '', $view = 'private')
                       LEFT JOIN  profile_education_enum        AS en ON (en.id = ed.eduid)
                       LEFT JOIN  profile_education_degree_enum AS d  ON (d.id  = ed.degreeid)
                       LEFT JOIN  profile_education_field_enum  AS f  ON (f.id  = ed.fieldid)
-                          WHERE  uid={?}
+                          WHERE  uid = {?} AND NOT FIND_IN_SET('primary', flags)
                        ORDER BY  ed.grad_year", $uid);
 
     if (list($name, $url, $degree, $grad_year, $field, $program) = $res->next()) {
index fb3b7b5..9eaaf28 100644 (file)
@@ -1,6 +1,8 @@
 INSERT INTO  profile_education (id, uid, grad_year, entry_year, eduid, degreeid, flags)
-     SELECT  100, user_id, promo_sortie, promo, 20, 2, 'primary'
-       FROM  auth_user_md5;
+     SELECT  100, u.user_id, u.promo_sortie, u.promo, e.id, d.id, 'primary'
+       FROM  auth_user_md5                 AS u
+  LEFT JOIN  profile_education_enum        AS e ON (e.abbreviation = "X")
+  LEFT JOIN  profile_education_degree_enum AS d ON (d.degree = "Ingénieur");
 
 CREATE TABLE  profile_display (
   uid INT(11) NOT NULL DEFAULT 0,