From fc370bb3875e6c388422bee17841e65aca860fbe Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Tue, 11 Apr 2017 15:05:11 +0200 Subject: [PATCH] Add email in list, setting "show_email_addresses" must be true #12603 --- main/lp/lp_report.php | 3 +++ main/template/default/learnpath/report.tpl | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/main/lp/lp_report.php b/main/lp/lp_report.php index e524bcbc9d..9eb74e253f 100644 --- a/main/lp/lp_report.php +++ b/main/lp/lp_report.php @@ -56,6 +56,7 @@ $lpInfo = Database::select( ); $userList = []; +$showEmail = api_get_setting('show_email_addresses'); if (!empty($users)) { foreach ($users as $user) { @@ -97,6 +98,7 @@ if (!empty($users)) { 'id' => $user['user_id'], 'first_name' => $userInfo['firstname'], 'last_name' => $userInfo['lastname'], + 'email' => $showEmail === 'true' ? $userInfo['email'] : '', 'lp_time' => api_time_to_hms($lpTime), 'lp_score' => is_numeric($lpScore) ? "$lpScore%" : $lpScore, 'lp_progress' => "$lpProgress%", @@ -126,6 +128,7 @@ $template->assign('user_list', $userList); $template->assign('session_id', api_get_session_id()); $template->assign('course_code', api_get_course_id()); $template->assign('lp_id', $lpId); +$template->assign('show_email', $showEmail === 'true'); $layout = $template->get_template('learnpath/report.tpl'); diff --git a/main/template/default/learnpath/report.tpl b/main/template/default/learnpath/report.tpl index 5ea21eac6f..bfa07191b6 100644 --- a/main/template/default/learnpath/report.tpl +++ b/main/template/default/learnpath/report.tpl @@ -4,6 +4,9 @@ {{ 'FirstName'|get_lang }} {{ 'LastName'|get_lang }} + {% if show_email %} + {{ 'Email'|get_lang }} + {% endif %} {{ 'ScormTime'|get_lang }} {{ 'Progress'|get_lang }} {{ 'ScormScore'|get_lang }} @@ -16,6 +19,9 @@ {{ user.first_name }} {{ user.last_name }} + {% if show_email %} + {{ user.email }} + {% endif %} {{ user.lp_time }} {{ user.lp_progress }} {{ user.lp_score }}