From c3ddad3164920551d3a4723333fd8948b4e7f753 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 1 Nov 2016 15:12:03 -0500 Subject: [PATCH] Fix issue using course code instead of course ID in mySpace student time tracking page - fixes #1492 --- main/inc/ajax/myspace.ajax.php | 2 +- main/inc/lib/myspace.lib.php | 4 ++-- main/mySpace/access_details.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main/inc/ajax/myspace.ajax.php b/main/inc/ajax/myspace.ajax.php index 55c83fda8a..4f27f82ba5 100755 --- a/main/inc/ajax/myspace.ajax.php +++ b/main/inc/ajax/myspace.ajax.php @@ -55,7 +55,7 @@ switch ($action) { if (is_array($sql_result) && count($sql_result) > 0) { $db['is_empty'] = false; $db['result'] = convert_to_string($sql_result); - $rst = get_stats($user_id, $course_code, $start_date, $end_date); + $rst = get_stats($user_id, $courseId, $start_date, $end_date); $foo_stats = '' . get_lang('Total') . ': ' . $rst['total'] . '
'; $foo_stats .= '' . get_lang('Average') . ': ' . $rst['avg'] . '
'; $foo_stats .= '' . get_lang('Quantity') . ' : ' . $rst['times'] . '
'; diff --git a/main/inc/lib/myspace.lib.php b/main/inc/lib/myspace.lib.php index 3597c082a3..ef02f60b65 100644 --- a/main/inc/lib/myspace.lib.php +++ b/main/inc/lib/myspace.lib.php @@ -2798,10 +2798,10 @@ function grapher($sql_result, $start_date, $end_date, $type = "") $last_days = 5; $last_months = 3; for ($i = $last_days; $i >= 0; $i--) { - $main_day[date ('d-m-Y', mktime () - $i * 3600 * 24)] = 0; + $main_day[date ('d-m-Y', time () - $i * 3600 * 24)] = 0; } for ($i = $last_months; $i >= 0; $i--) { - $main_month_year[date ('m-Y', mktime () - $i * 30 * 3600 * 24)] = 0; + $main_month_year[date ('m-Y', time () - $i * 30 * 3600 * 24)] = 0; } $i = 0; diff --git a/main/mySpace/access_details.php b/main/mySpace/access_details.php index a5eef836e7..e441ea3c88 100755 --- a/main/mySpace/access_details.php +++ b/main/mySpace/access_details.php @@ -126,7 +126,7 @@ $result_to_print = convert_to_string($sql_result); echo Display::page_header(get_lang('DetailsStudentInCourse')); echo Display::page_subheader( - get_lang('User').': '.$userInfo['complete_name'].' - '.get_lang('Course').': '.$course_code + get_lang('User').': '.$userInfo['complete_name'].' - '.get_lang('Course').': '.$courseInfo['title'] . ' (' . $course_code . ')' ); $form->setDefaults(array('from' => $from, 'to' => $to));