Merge commit 'origin/master' into fusionax
[platal.git] / modules / profile / general.inc.php
index 7620240..945c54f 100644 (file)
@@ -82,9 +82,7 @@ class ProfileSearchName implements ProfileSetting
 
 class ProfileEdu implements ProfileSetting
 {
-    public function __construct()
-    {
-    }
+    public function __construct(){}
 
     static function sortByGradYear($line1, $line2) {
         $a = (int) $line1['grad_year'];
@@ -142,14 +140,12 @@ class ProfileEdu implements ProfileSetting
             }
         }
     }
-
 }
 
 class ProfileEmailDirectory implements ProfileSetting
 {
-    public function __construct()
-    {
-    }
+    public function __construct(){}
+    public function save(ProfilePage &$page, $field, $value){}
 
     public function value(ProfilePage &$page, $field, $value, &$success)
     {
@@ -169,10 +165,6 @@ class ProfileEmailDirectory implements ProfileSetting
         }
         return $value;
     }
-
-    public function save(ProfilePage &$page, $field, $value)
-    {
-    }
 }
 
 class ProfileNetworking implements ProfileSetting
@@ -298,7 +290,7 @@ class ProfileGeneral extends ProfilePage
     protected function _fetchData()
     {
         // Checkout all data...
-        $res = XDB::query("SELECT  p.promo_display, e.entry_year AS entry_year, e.grad_year AS grad_year,
+        $res = XDB::query("SELECT  p.promo AS promo_display, e.entry_year AS entry_year, e.grad_year AS grad_year,
                                    u.nom_usage, u.nationalite, u.nationalite2, u.nationalite3, u.naissance,
                                    t.display_tel as mobile, t.pub as mobile_pub,
                                    d.email_directory as email_directory,
@@ -309,7 +301,7 @@ class ProfileGeneral extends ProfilePage
                              FROM  auth_user_md5         AS u
                        INNER JOIN  auth_user_quick       AS q ON (u.user_id = q.user_id)
                        INNER JOIN  profile_names_display AS n ON (n.user_id = u.user_id)
-                       INNER JOIN  profile_display       AS p ON (p.uid = u.user_id)
+                       INNER JOIN  profile_display       AS p ON (p.pid = u.user_id)
                        INNER JOIN  profile_education     AS e ON (e.uid = u.user_id AND FIND_IN_SET('primary', e.flags))
                         LEFT JOIN  profile_phones        AS t ON (u.user_id = t.uid AND link_type = 'user')
                         LEFT JOIN  profile_directory     AS d ON (d.uid = u.user_id)
@@ -336,14 +328,6 @@ class ProfileGeneral extends ProfilePage
                             ORDER BY  sn.name_type, search_score, search_name",
                           S::v('uid'));
 
-        // Retreive phones
-        $res = XDB::iterator("SELECT t.display_tel AS tel, t.tel_type AS type, t.pub, t.comment
-                                FROM profile_phones AS t
-                               WHERE t.uid = {?} AND t.link_type = 'user'
-                            ORDER BY t.tel_id",
-                             S::v('uid'));
-        $this->values['tels'] = $res->fetchAllAssoc();
-
         // Proposes choice for promo_display
         if ($this->values['entry_year'] != $this->values['grad_year'] - 3) {
             for ($i = $this->values['entry_year']; $i < $this->values['grad_year'] - 2; $i++) {
@@ -423,8 +407,8 @@ class ProfileGeneral extends ProfilePage
         }
         if ($this->changed['promo_display']) {
             XDB::execute("UPDATE  profile_display
-                             SET  promo_display = {?}
-                           WHERE  uid = {?}",
+                             SET  promo = {?}
+                           WHERE  pid = {?}",
                          $this->values['promo_display'], S::v('uid'));
         }
     }