From 0c9e7301361e3ecbedcd3945b7cc4aa447ea1e56 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 11 Jan 2012 14:05:37 +0100 Subject: [PATCH] Minor fixing SQL error when loading the course list and the myspace list (SESSION bug) --- main/mySpace/index.php | 8 ++++---- main/mySpace/myspace.lib.php | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/main/mySpace/index.php b/main/mySpace/index.php index 6d303eead0..79fafe2ad9 100644 --- a/main/mySpace/index.php +++ b/main/mySpace/index.php @@ -361,7 +361,7 @@ if (api_is_allowed_to_create_course() && $view == 'teacher') { echo Display::tag('h2', $title); - $table = new SortableTable('courses', 'get_number_of_courses' ,array('MySpace','get_course_data')); + $table = new SortableTable('courses_my_space', 'get_number_of_courses', array('MySpace','get_course_data')); $parameters['view'] = 'teacher'; $parameters['class'] = 'data_table'; $table->set_additional_parameters($parameters); @@ -385,13 +385,13 @@ if (api_is_allowed_to_create_course() && $view == 'teacher') { get_lang('AvgMessages', ''), get_lang('AvgAssignments', '') ); - $table->display(); + $table->display(); } // Display list of sessions if ($count_sessions > 0 && !isset($_GET['session_id'])) { echo '

 '.get_lang('Sessions').' ('.$count_sessions.')'.'

'; - $table = new SortableTable('tracking_sessions', 'count_sessions_coached'); + $table = new SortableTable('tracking_sessions_myspace', 'count_sessions_coached'); $table->set_header(0, get_lang('Title'), false); $table->set_header(1, get_lang('Date'), false); $table->set_header(2, get_lang('NbCoursesPerSession'), false); @@ -545,7 +545,7 @@ if ($is_platform_admin && $view == 'admin' && $display != 'yourstudents') { } else { $order = array(0 => 'lastname', 1 => 'firstname', 2 => ($sort_by_first_name ? 'firstname' : 'lastname'), 3 => 'login_date', 4 => ($sort_by_first_name ? 'firstname' : 'lastname'), 5 => ($sort_by_first_name ? 'firstname' : 'lastname')); } - $table = new SortableTable('tracking_list_coaches', 'count_coaches', null, ($is_western_name_order xor $sort_by_first_name) ? 1 : 0); + $table = new SortableTable('tracking_list_coaches_myspace', 'count_coaches', null, ($is_western_name_order xor $sort_by_first_name) ? 1 : 0); $parameters['view'] = 'admin'; $table->set_additional_parameters($parameters); if ($is_western_name_order) { diff --git a/main/mySpace/myspace.lib.php b/main/mySpace/myspace.lib.php index 6fbebc5706..3a4c41f911 100644 --- a/main/mySpace/myspace.lib.php +++ b/main/mySpace/myspace.lib.php @@ -1220,6 +1220,7 @@ class MySpace { * @return array */ function get_course_data($from, $number_of_items, $column, $direction) { + global $courses, $csv_content, $charset, $session_id; @@ -1240,6 +1241,7 @@ class MySpace { $sql = "SELECT course.code as col1, course.title as col2 FROM $tbl_course course WHERE course.code IN (".implode(',',$courses_code).")"; + if (!in_array($direction, array('ASC','DESC'))) $direction = 'ASC'; $column = intval($column);