From 9ede50566e03195b3087919217c5bfbfd88422a5 Mon Sep 17 00:00:00 2001 From: Thomas Minvielle Date: Sat, 8 Feb 2014 17:20:32 +0100 Subject: [PATCH] Add a freetext field for admin use. --- classes/profile.php | 3 ++- modules/profile/general.inc.php | 9 +++++---- templates/profile/general.tpl | 14 ++++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/classes/profile.php b/classes/profile.php index 280da45..29de2b1 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -134,6 +134,7 @@ class Profile implements PlExportable 'yourself' => 'Nom affiché', 'freetext' => 'Commentaire', 'freetext_pub' => 'Affichage du commentaire', + 'axfreetext' => 'Commentaire AX', 'photo' => 'Photographie', 'photo_pub' => 'Affichage de la photographie', 'addresses' => 'Adresses', @@ -499,7 +500,7 @@ class Profile implements PlExportable } XDB::execute("UPDATE profiles - SET cv = NULL, freetext = NULL, freetext_pub = 'private', + SET cv = NULL, freetext = NULL, freetext_pub = 'private', axfreetext = NULL, medals_pub = 'private', alias_pub = 'hidden', email_directory = NULL WHERE pid = {?}", diff --git a/modules/profile/general.inc.php b/modules/profile/general.inc.php index 857e2e9..c11abf4 100644 --- a/modules/profile/general.inc.php +++ b/modules/profile/general.inc.php @@ -645,6 +645,7 @@ class ProfilePageGeneral extends ProfilePage $this->settings['deathdate'] = new ProfileSettingDate(true); $this->settings['birthdate'] = new ProfileSettingDate(true); $this->settings['birthdate_ref'] = new ProfileSettingDate(true); + $this->settings['axfreetext'] = null; } else { $this->settings['yourself'] = null; $this->settings['birthdate'] = new ProfileSettingDate(); @@ -665,7 +666,7 @@ class ProfilePageGeneral extends ProfilePage // Checkout all data... $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.freetext, p.freetext_pub, p.axfreetext, p.ax_id AS matricule_ax, pd.yourself, p.deathdate, IF(p.birthdate_ref = 0, '', p.birthdate_ref) AS birthdate_ref, p.title AS profile_title FROM profiles AS p @@ -698,7 +699,7 @@ class ProfilePageGeneral extends ProfilePage { if ($this->changed['nationality1'] || $this->changed['nationality2'] || $this->changed['nationality3'] || $this->changed['birthdate'] || $this->changed['freetext'] || $this->changed['freetext_pub'] - || $this->changed['email_directory'] || $this->changed['profile_title']) { + || $this->changed['axfreetext'] || $this->changed['email_directory'] || $this->changed['profile_title']) { if ($this->values['nationality3'] == "") { $this->values['nationality3'] = NULL; } @@ -731,11 +732,11 @@ class ProfilePageGeneral extends ProfilePage XDB::execute("UPDATE profiles SET nationality1 = {?}, nationality2 = {?}, nationality3 = {?}, birthdate = {?}, - freetext = {?}, freetext_pub = {?}, email_directory = {?}, title = {?} + freetext = {?}, freetext_pub = {?}, axfreetext = {?}, email_directory = {?}, title = {?} WHERE pid = {?}", $this->values['nationality1'], $this->values['nationality2'], $this->values['nationality3'], ProfileSettingDate::toSQLDate($this->values['birthdate']), - $this->values['freetext'], $this->values['freetext_pub'], $new_email, + $this->values['freetext'], $this->values['freetext_pub'], $this->values['axfreetext'], $new_email, $this->values['profile_title'], $this->pid()); } if ($this->changed['photo_pub']) { diff --git a/templates/profile/general.tpl b/templates/profile/general.tpl index 6cd4838..5266aba 100644 --- a/templates/profile/general.tpl +++ b/templates/profile/general.tpl @@ -423,6 +423,20 @@ {/if} + {if !t($isMe)} + + +
+ Commentaire AX +
+ + + + + + + {/if} {* vim:set et sw=2 sts=2 sws=2 fenc=utf-8: *} -- 2.1.4