From 9a87e760f38a00c11a3afa6cbabd13f8ef7f716f Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Tue, 1 Mar 2011 15:29:27 +0100 Subject: [PATCH] Displays grade if any in medal validation process (Closes #1403). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- ChangeLog | 1 + include/validations/medals.inc.php | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 16f815d..4c9d4bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ Bug/Wish: * Admin: - #1399: Displays all similar entreprises only on demand -JAC - #1362: List last profile modifications for secretary -JAC + - #1403: Displays grade if any in medal validation process -JAC * Core: - #1352: Fixes csv downloading with IE8. -JAC diff --git a/include/validations/medals.inc.php b/include/validations/medals.inc.php index 92b821d..0d29063 100644 --- a/include/validations/medals.inc.php +++ b/include/validations/medals.inc.php @@ -74,10 +74,17 @@ class MedalReq extends ProfileValidate public function medal_name() { - $res = XDB::query('SELECT m.text - FROM profile_medal_enum AS m - WHERE m.id = {?}', $this->mid); - return $res->fetchOneCell(); + $name = XDB::fetchOneCell('SELECT text + FROM profile_medal_enum + WHERE id = {?}', $this->mid); + $grade = XDB::fetchOneCell('SELECT text + FROM profile_medal_grade_enum + WHERE mid = {?} AND gid = {?}', + $this->mid, $this->gid); + if (is_null($grade)) { + return $name; + } + return $name . ' (' . $grade . ')'; } // }}} -- 2.1.4