From 97b71de5c0730bc045fc6dea492b6c2ff357d2e9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Sat, 20 Mar 2010 00:59:03 +0100 Subject: [PATCH] Fetch section and binets names MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- classes/profile.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/classes/profile.php b/classes/profile.php index 032c61a..4758abb 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -481,6 +481,13 @@ class Profile FROM profile_binets WHERE pid = {?}', $this->id()); } + public function getBinetsNames() + { + return XDB::fetchColumn('SELECT text + FROM profile_binets AS pb + LEFT JOIN profile_binet_enum AS pbe ON (pbe.id = pb.binet_id) + WHERE pb.pid = {?}', $this->id()); + } /* Medals */ @@ -538,7 +545,7 @@ class Profile } - $it = XDB::Iterator('SELECT p.*, p.sex = \'female\' AS sex, pe.entry_year, pe.grad_year, + $it = XDB::Iterator('SELECT p.*, p.sex = \'female\' AS sex, pe.entry_year, pe.grad_year, pse.text AS section, pn_f.name AS firstname, pn_l.name AS lastname, pn_n.name AS nickname, IF(pn_uf.name IS NULL, pn_f.name, pn_uf.name) AS firstname_ordinary, IF(pn_ul.name IS NULL, pn_l.name, pn_ul.name) AS lastname_ordinary, @@ -550,6 +557,7 @@ class Profile FROM profiles AS p INNER JOIN profile_display AS pd ON (pd.pid = p.pid) INNER JOIN profile_education AS pe ON (pe.pid = p.pid AND FIND_IN_SET(\'primary\', pe.flags)) + LEFT JOIN profile_section_enum AS pse ON (pse.id = p.section) INNER JOIN profile_name AS pn_f ON (pn_f.pid = p.pid AND pn_f.typeid = ' . self::getNameTypeId('firstname', true) . ') INNER JOIN profile_name AS pn_l ON (pn_l.pid = p.pid -- 2.1.4