From: Stéphane Jacob Date: Sun, 28 Nov 2010 11:23:26 +0000 (+0100) Subject: Allows admin profile edition even if birthdate is unknown (Closes #1368). X-Git-Tag: xorg/1.0.2~124 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=c56a253e5a51c7953be1224225e1b1190f8f1c1d;p=platal.git Allows admin profile edition even if birthdate is unknown (Closes #1368). Signed-off-by: Stéphane Jacob --- diff --git a/modules/profile/general.inc.php b/modules/profile/general.inc.php index bc8582d..fadbbce 100644 --- a/modules/profile/general.inc.php +++ b/modules/profile/general.inc.php @@ -522,7 +522,6 @@ class ProfilePageGeneral extends ProfilePage parent::__construct($wiz); $this->settings['search_names'] = new ProfileSettingSearchNames(); - $this->settings['birthdate'] = new ProfileSettingDate(); $this->settings['nationality1'] = $this->settings['nationality2'] = $this->settings['nationality3'] @@ -544,9 +543,10 @@ class ProfilePageGeneral extends ProfilePage /* Some fields editable under condition */ if (!S::user()->isMe($this->owner)) { $this->settings['deathdate'] = new ProfileSettingDate(true); - } - if (S::user()->isMe($this->owner)) { + $this->settings['birthdate'] = new ProfileSettingDate(true); + } else { $this->settings['yourself'] = null; + $this->settings['birthdate'] = new ProfileSettingDate(); } if (S::user()->checkPerms('directory_private') || S::user()->isMyProfile($this->owner)) { @@ -562,7 +562,7 @@ class ProfilePageGeneral extends ProfilePage protected function _fetchData() { // Checkout all data... - $res = XDB::query("SELECT p.nationality1, p.nationality2, p.nationality3, p.birthdate, + $res = XDB::query("SELECT p.nationality1, p.nationality2, p.nationality3, IF(p.birthdate = 0, '', p.birthdate) AS birthdate, p.email_directory as email_directory, pd.promo AS promo_display, p.freetext, p.freetext_pub, p.ax_id AS matricule_ax, pd.yourself, p.deathdate