Merge branch 'master' into fusionax
[platal.git] / modules / profile / general.inc.php
index 33e9915..708c2dc 100644 (file)
@@ -56,6 +56,7 @@ class ProfileSearchNames implements ProfileSetting
     {
         $success     = true;
         $success_tmp = true;
+
         if (is_null($value)) {
             $sn_all = XDB::iterator("SELECT  CONCAT(sn.particle, sn.name) AS name,
                                              sn.particle, sn.typeid, e.type, e.name AS type_name,
@@ -82,12 +83,14 @@ class ProfileSearchNames implements ProfileSetting
                     $value[] = $sn;
                     $sn = $sn_all->next();
                 } else {
-                    $value[] = array('typeid'    => $sn_type['id'],
-                                     'type'      => $sn_type['type'],
-                                     'type_name' => $sn_type['name'],
-                                     'pub'       => 1,
+                    $value[] = array('name'             => '',
+                                     'particle'         => '',
+                                     'typeid'           => $sn_type['id'],
+                                     'type'             => $sn_type['type'],
+                                     'type_name'        => $sn_type['name'],
                                      'has_particle'     => $sn_type['has_particle'],
-                                     'always_displayed' => 1);
+                                     'always_displayed' => 1,
+                                     'pub'              => 1);
                 }
             }
             if ($sn) {
@@ -159,6 +162,7 @@ class ProfileSearchNames implements ProfileSetting
             Platal::page()->assign('public_name', $public_name);
             Platal::page()->assign('private_name', $private_name);
         }
+
         return $value;
     }
 
@@ -177,7 +181,7 @@ class ProfileSearchNames implements ProfileSetting
         if ($has_new) {
             $new_names = new NamesReq(S::user(), $this->search_names, $this->private_name_end);
             $new_names->submit();
-            Platal::page()->trigWarning("La demande de modification de tes noms a bien été prises en compte." .
+            Platal::page()->trigWarning("La demande de modification de tes noms a bien été prise en compte." .
                                         " Tu recevras un email dès que ces changements auront été effectués.");
         } else {
             $display_names = array();
@@ -376,8 +380,6 @@ class ProfileGeneral extends ProfilePage
                                   = $this->settings['yourself']
                                   = $this->settings['promo']
                                   = null;
-        $this->settings['synchro_ax']
-                                  = new ProfileBool();
         $this->settings['email_directory']
                                   = new ProfileEmail();
         $this->settings['email_directory_new']
@@ -399,7 +401,7 @@ class ProfileGeneral extends ProfilePage
                                    t.display_tel as mobile, t.pub as mobile_pub,
                                    d.email_directory as email_directory,
                                    q.profile_freetext as freetext, q.profile_freetext_pub as freetext_pub,
-                                   q.profile_from_ax as synchro_ax, u.matricule_ax, p.yourself
+                                   u.matricule_ax, p.yourself
                              FROM  auth_user_md5         AS u
                        INNER JOIN  auth_user_quick       AS q ON (u.user_id = q.user_id)
                        INNER JOIN  profile_display       AS p ON (p.pid = u.user_id)
@@ -453,12 +455,11 @@ class ProfileGeneral extends ProfilePage
                          preg_replace('@(\d{2})/(\d{2})/(\d{4})@', '\3-\2-\1', $this->values['naissance']),
                          S::v('uid'));
         }
-        if ($this->changed['freetext'] || $this->changed['freetext_pub'] || $this->changed['synchro_ax']) {
+        if ($this->changed['freetext'] || $this->changed['freetext_pub']) {
             XDB::execute("UPDATE  auth_user_quick
-                             SET  profile_freetext={?}, profile_freetext_pub={?}, profile_from_ax = {?}
+                             SET  profile_freetext={?}, profile_freetext_pub={?}
                            WHERE  user_id = {?}",
-                         $this->values['freetext'], $this->values['freetext_pub'],
-                         $this->values['synchro_ax'], S::v('uid'));
+                         $this->values['freetext'], $this->values['freetext_pub'], S::v('uid'));
         }
         if ($this->changed['email_directory']) {
             $new_email = ($this->values['email_directory'] == "new@example.org") ?