From 4c8bba6686e4ddf2393cfd8d353bc8a3b28de1a7 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Tue, 16 Jul 2013 18:27:35 +0200 Subject: [PATCH] MDL-39926 SCORM: Adapt report to alt name fields --- mod/scorm/report/objectives/report.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mod/scorm/report/objectives/report.php b/mod/scorm/report/objectives/report.php index da3de0573ae..39444d72d13 100644 --- a/mod/scorm/report/objectives/report.php +++ b/mod/scorm/report/objectives/report.php @@ -158,10 +158,10 @@ class scorm_objectives_report extends scorm_default_report { $params = array(); list($usql, $params) = $DB->get_in_or_equal($allowedlist, SQL_PARAMS_NAMED); - // Construct the SQL. + // Construct the SQL. $select = 'SELECT DISTINCT '.$DB->sql_concat('u.id', '\'#\'', 'COALESCE(st.attempt, 0)').' AS uniqueid, '; $select .= 'st.scormid AS scormid, st.attempt AS attempt, ' . - 'u.id AS userid, u.idnumber, u.firstname, u.lastname, u.picture, u.imagealt, u.email'. + user_picture::fields('u', array('idnumber'), 'userid') . get_extra_user_fields_sql($coursecontext, 'u', '', array('email', 'idnumber')) . ' '; // This part is the same for all cases - join users and scorm_scoes_track tables. @@ -423,9 +423,10 @@ class scorm_objectives_report extends scorm_default_report { 'id'=>$scouser->userid, 'picture'=>$scouser->picture, 'imagealt'=>$scouser->imagealt, - 'email'=>$scouser->email, - 'firstname'=>$scouser->firstname, - 'lastname'=>$scouser->lastname); + 'email'=>$scouser->email); + foreach (get_all_user_name_fields() as $addname) { + $user->$addname = $scouser->$addname; + } $row[] = $OUTPUT->user_picture($user, array('courseid'=>$course->id)); } if (!$download) { @@ -658,4 +659,4 @@ function get_scorm_objectives($scormid) { } $rs->close(); return $objectives; -} \ No newline at end of file +}