From: Stéphane Jacob Date: Tue, 1 Mar 2011 14:29:27 +0000 (+0100) Subject: Displays grade if any in medal validation process (Closes #1403). X-Git-Tag: xorg/1.1.0~86 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=9a87e760f38a00c11a3afa6cbabd13f8ef7f716f;p=platal.git Displays grade if any in medal validation process (Closes #1403). Signed-off-by: Stéphane Jacob --- 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 . ')'; } // }}}