Browse Source

Fix missing cid in gradebook links

Yannick Warnier 9 years ago
parent
commit
b18014ff31

+ 2 - 2
main/gradebook/lib/be/evallink.class.php

@@ -47,10 +47,10 @@ abstract class EvalLink extends AbstractLink
         $eval = $this->get_evaluation();
         // course/platform admin can go to the view_results page
         if (api_is_allowed_to_edit()) {
-            return 'gradebook_view_result.php?selecteval=' . $eval->get_id();
+            return 'gradebook_view_result.php?' . api_get_cidreq() . '&selecteval=' . $eval->get_id();
         } // students can go to the statistics page (if custom display enabled)
         elseif (ScoreDisplay :: instance()->is_custom()) {
-            return 'gradebook_statistics.php?selecteval=' . $eval->get_id();
+            return 'gradebook_statistics.php?' . api_get_cidreq() . '&selecteval=' . $eval->get_id();
         } else {
             return null;
         }

+ 1 - 1
main/gradebook/lib/fe/displaygradebook.php

@@ -110,7 +110,7 @@ class DisplayGradebook
         }
         if ($page != 'statistics') {
             if (api_is_allowed_to_edit(null, true)) {
-                $evalinfo .= '<br /><a href="gradebook_statistics.php?selecteval=' . Security::remove_XSS($_GET['selecteval']) . '"> ' . Display::return_icon(('statistics.png'), get_lang('ViewStatistics'), '', ICON_SIZE_MEDIUM) . '</a>';
+                $evalinfo .= '<br /><a href="gradebook_statistics.php?' . api_get_cidreq() . '&selecteval=' . Security::remove_XSS($_GET['selecteval']) . '"> ' . Display::return_icon(('statistics.png'), get_lang('ViewStatistics'), '', ICON_SIZE_MEDIUM) . '</a>';
             }
         }
         $evalinfo .= '</td><td><img style="float:right; position:relative;" src="../img/tutorial.gif"></td></table>';

+ 3 - 3
main/gradebook/lib/fe/gradebooktable.class.php

@@ -977,20 +977,20 @@ class GradebookTable extends SortableTable
                             $extra = '';
                         }
                         return '&nbsp;'
-                        . '<a href="gradebook_view_result.php?cidReq='.$course_id.'&amp;selecteval=' . $item->get_id() . '">'
+                        . '<a href="gradebook_view_result.php?' . api_get_cidreq() . '&selecteval=' . $item->get_id() . '">'
                         . $item->get_name()
                         . '</a>&nbsp;'.$extra;
                     }
                 } elseif (ScoreDisplay :: instance()->is_custom() && $show_message===false) {
                     // students can go to the statistics page (if custom display enabled)
                     return '&nbsp;'
-                    . '<a href="gradebook_statistics.php?selecteval=' . $item->get_id() . '">'
+                    . '<a href="gradebook_statistics.php?' . api_get_cidreq() . '&selecteval=' . $item->get_id() . '">'
                     . $item->get_name()
                     . '</a>';
 
                 } elseif ($show_message === false && !api_is_allowed_to_edit() && !ScoreDisplay :: instance()->is_custom()) {
                     return '&nbsp;'
-                    . '<a href="gradebook_statistics.php?selecteval=' . $item->get_id() . '">'
+                    . '<a href="gradebook_statistics.php?' . api_get_cidreq() . '&selecteval=' . $item->get_id() . '">'
                     . $item->get_name()
                     . '</a>';
                 } else {

+ 0 - 1
main/inc/lib/course.lib.php

@@ -310,7 +310,6 @@ class CourseManager
     {
         $courseInfo = api_get_course_info($course_code);
         $courseId = $courseInfo['real_id'];
-
         $result = Database::fetch_array(
             Database::query(
                 "SELECT status FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . "