X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Fgeneral.inc.php;h=5e70adc0853807156803f5e04652c9194d032963;hb=e5fb8f8716118e456b3318f3c9369e6aee037335;hp=9856dc83d588ec0c9487e42931f87d74fcf80b0d;hpb=6d1747b3dbcf944c995dc2d87e8561c7a66f3aa6;p=platal.git diff --git a/modules/profile/general.inc.php b/modules/profile/general.inc.php index 9856dc8..5e70adc 100644 --- a/modules/profile/general.inc.php +++ b/modules/profile/general.inc.php @@ -1,6 +1,6 @@ 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) { @@ -162,6 +165,7 @@ class ProfileSearchNames implements ProfileSetting Platal::page()->assign('public_name', $public_name); Platal::page()->assign('private_name', $private_name); } + return $value; } @@ -180,7 +184,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(); @@ -368,8 +372,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'] @@ -390,7 +392,7 @@ class ProfileGeneral extends ProfilePage pr.nationality1, pr.nationality2, pr.nationality3, pr.birthdate, t.display_tel as mobile, t.pub as mobile_pub, d.email_directory as email_directory, - pr.freetext, pr.freetext_pub as freetext_pub + pr.freetext, pr.freetext_pub, pr.ax_id AS matricule_ax, p.yourself FROM profiles AS pr INNER JOIN profile_display AS p ON (p.pid = pr.pid) INNER JOIN profile_education AS e ON (e.uid = pr.pid AND FIND_IN_SET('primary', e.flags)) @@ -404,8 +406,8 @@ class ProfileGeneral extends ProfilePage // Retreive photo informations $res = XDB::query("SELECT pub - FROM photo - WHERE uid = {?}", $this->pid()); + FROM profile_photos + WHERE pid = {?}", $this->pid()); $this->values['photo_pub'] = $res->fetchOneCell(); if ($this->owner) { @@ -446,11 +448,10 @@ class ProfileGeneral extends ProfilePage XDB::execute("UPDATE profiles SET nationality1 = {?}, nationality2 = {?}, nationality3 = {?}, birthdate = {?}, freetext = {?}, freetext_pub = {?} - WHERE user_id = {?}", + WHERE pid = {?}", $this->values['nationality1'], $this->values['nationality2'], $this->values['nationality3'], preg_replace('@(\d{2})/(\d{2})/(\d{4})@', '\3-\2-\1', $this->values['birthdate']), - $this->values['freetext'], $this->values['freetext_pub'], - $this->pid()); + $this->values['freetext'], $this->values['freetext_pub'], $this->pid()); } if ($this->changed['email_directory']) { $new_email = ($this->values['email_directory'] == "new@example.org") ? @@ -463,9 +464,9 @@ class ProfileGeneral extends ProfilePage $this->pid(), $new_email); } if ($this->changed['photo_pub']) { - XDB::execute("UPDATE photo + XDB::execute("UPDATE profile_photos SET pub = {?} - WHERE uid = {?}", + WHERE pid = {?}", $this->values['photo_pub'], $this->pid()); } if ($this->changed['yourself']) {