Remove $_SESSION use.

pull/2487/head
jmontoyaa 7 years ago
parent 5d7750e0da
commit bd0848db36
  1. 12
      main/coursecopy/copy_course_session.php
  2. 18
      main/coursecopy/copy_course_session_selected.php
  3. 2
      main/document/create_document.php
  4. 5
      main/document/edit_document.php
  5. 2
      main/document/edit_draw.php
  6. 2
      main/document/edit_paint.php
  7. 8
      main/exercise/admin.php
  8. 14
      main/exercise/adminhp.php
  9. 12
      main/exercise/exercise.php
  10. 9
      main/exercise/exercise_admin.php
  11. 8
      main/exercise/exercise_result.php
  12. 8
      main/exercise/exercise_show.php
  13. 20
      main/exercise/exercise_submit.php
  14. 8
      main/exercise/hotpotatoes.php
  15. 7
      main/exercise/overview.php
  16. 11
      main/exercise/question_pool.php
  17. 9
      main/forum/editpost.php
  18. 10
      main/forum/editthread.php
  19. 11
      main/forum/forumqualify.php
  20. 9
      main/forum/forumsearch.php
  21. 12
      main/forum/index.php
  22. 10
      main/forum/newthread.php
  23. 13
      main/forum/reply.php
  24. 9
      main/forum/viewforum.php
  25. 10
      main/forum/viewforumcategory.php
  26. 10
      main/forum/viewpost.php
  27. 10
      main/forum/viewthread.php
  28. 31
      main/gradebook/gradebook.php
  29. 4
      main/gradebook/gradebook_add_cat.php
  30. 8
      main/gradebook/gradebook_add_eval.php
  31. 4
      main/gradebook/gradebook_add_link.php
  32. 2
      main/gradebook/gradebook_add_link_select_course.php
  33. 2
      main/gradebook/gradebook_add_result.php
  34. 2
      main/gradebook/gradebook_add_user.php
  35. 2
      main/gradebook/gradebook_display_certificate.php
  36. 13
      main/gradebook/gradebook_display_summary.php
  37. 8
      main/gradebook/gradebook_edit_all.php
  38. 4
      main/gradebook/gradebook_edit_cat.php
  39. 4
      main/gradebook/gradebook_edit_eval.php
  40. 4
      main/gradebook/gradebook_edit_link.php
  41. 2
      main/gradebook/gradebook_edit_result.php
  42. 2
      main/gradebook/gradebook_flatview.php
  43. 2
      main/gradebook/gradebook_scoring_system.php
  44. 4
      main/gradebook/gradebook_showlog_eval.php
  45. 4
      main/gradebook/gradebook_showlog_link.php
  46. 4
      main/gradebook/gradebook_statistics.php
  47. 4
      main/gradebook/gradebook_view_result.php
  48. 10
      main/gradebook/index.php
  49. 27
      main/gradebook/lib/be/category.class.php
  50. 108
      main/gradebook/lib/fe/displaygradebook.php
  51. 4
      main/gradebook/lib/fe/gradebooktable.class.php
  52. 2
      main/gradebook/lib/gradebook_data_generator.class.php
  53. 2
      main/gradebook/user_stats.php
  54. 2
      main/lp/learnpath.class.php
  55. 12
      main/lp/lp_add.php
  56. 9
      main/lp/lp_add_audio.php
  57. 9
      main/lp/lp_add_item.php
  58. 10
      main/lp/lp_admin_view.php
  59. 14
      main/lp/lp_build.php
  60. 8
      main/lp/lp_content.php
  61. 8
      main/lp/lp_edit.php
  62. 11
      main/lp/lp_edit_item.php
  63. 15
      main/lp/lp_edit_item_prereq.php
  64. 8
      main/lp/lp_list_search.php
  65. 9
      main/lp/lp_move_item.php

@ -1,6 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
use Chamilo\CourseBundle\Component\CourseCopy\CourseSelectForm;
use Chamilo\CourseBundle\Component\CourseCopy\CourseBuilder;
use Chamilo\CourseBundle\Component\CourseCopy\CourseRestorer;
@ -170,8 +171,8 @@ function search_courses($id_session, $type)
}
$return .= '</select>';
$_SESSION['course_list'] = $temp_course_list;
$_SESSION['session_origin'] = $id_session;
Session::write('course_list', $temp_course_list);
Session::write('session_origin', $id_session);
// Build select for destination sessions where is not included current session from select origin
if (!empty($id_session)) {
@ -204,10 +205,6 @@ function search_courses($id_session, $type)
$xajax_response -> addAssign('ajax_list_courses_origin', 'innerHTML', api_utf8_encode($return));
$xajax_response -> addAssign('ajax_list_courses_destination', 'innerHTML', api_utf8_encode($select_multiple_empty));
} else {
//Left Select - Destination
$list_courses_origin = implode(',', $_SESSION['course_list']);
$session_origin = $_SESSION['session_origin'];
// Search courses by id_session where course codes is include en courses list destination
$sql = "SELECT c.code, c.visual_code, c.title, src.session_id
FROM $tbl_course c, $tbl_session_rel_course src
@ -223,7 +220,8 @@ function search_courses($id_session, $type)
$return .= '<option value="'.$course['code'].'" title="'.@htmlspecialchars($course['title'].' ('.$course['visual_code'].')', ENT_QUOTES, api_get_system_encoding()).'">'.$course['title'].' ('.$course['visual_code'].')</option>';
}
$return .= '</select>';
$_SESSION['course_list_destination'] = $course_list_destination;
Session::write('course_list_destination', $course_list_destination);
// Send response by ajax
$xajax_response->addAssign(

@ -1,6 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
use Chamilo\CourseBundle\Component\CourseCopy\CourseSelectForm;
use Chamilo\CourseBundle\Component\CourseCopy\CourseBuilder;
use Chamilo\CourseBundle\Component\CourseCopy\CourseRestorer;
@ -216,11 +217,13 @@ function searchCourses($idSession, $type)
$course['title'].' ('.$course['visual_code'].')</option>';
}
$return .= '</select>';
$_SESSION['course_list_destination'] = $course_list_destination;
Session::write('course_list_destination', $course_list_destination);
// Send response by ajax
$xajaxResponse->addAssign(
'ajax_list_courses_destination', 'innerHTML', api_utf8_encode($return)
'ajax_list_courses_destination',
'innerHTML',
api_utf8_encode($return)
);
}
return $xajaxResponse;
@ -278,22 +281,21 @@ Display::display_header($nameTools);
if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') ||
(isset($_POST['copy_option']) && $_POST['copy_option'] == 'full_copy')
) {
$destinationCourse = $destinationSession = '';
$originCourse = api_get_course_id();
$originSession = api_get_session_id();
if (isset($_POST['action']) && $_POST['action'] == 'course_select_form') {
$destinationCourse = $_POST['destination_course'];
$destinationSession = $_POST['destination_session'];
$course = CourseSelectForm::get_posted_course(
'copy_course', $originSession, $originCourse
'copy_course',
$originSession,
$originCourse
);
$cr = new CourseRestorer($course);
$cr->restore($destinationCourse, $destinationSession);
echo Display::return_message(get_lang('CopyFinished'), 'confirmation');
displayForm();
@ -329,11 +331,11 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') ||
$cb = new CourseBuilder('', $courseInfo);
$course = $cb->build(
$originSession, $courseCode
$originSession,
$courseCode
);
$cr = new CourseRestorer($course);
$cr->restore($courseDestination, $destinationSession);
echo Display::return_message(get_lang('CopyFinished'), 'confirmation');
}

@ -216,7 +216,7 @@ if (!$is_certificate_mode) {
);
} else {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('Gradebook'),
);
}

@ -164,7 +164,10 @@ if (!$is_certificate_mode) {
"name" => get_lang('Documents'),
);
} else {
$interbreadcrumb[] = array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
$interbreadcrumb[] = array(
'url' => Category::getUrl(),
'name' => get_lang('Gradebook')
);
}
if (empty($document_data['parents'])) {

@ -103,7 +103,7 @@ if (!$is_certificate_mode) {
);
} else {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('Gradebook')
);
}

@ -99,7 +99,7 @@ if (!$is_certificate_mode) {
);
} else {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('Gradebook')
);
}

@ -279,13 +279,9 @@ if ($editQuestion || $modifyQuestion || $newQuestion || $modifyAnswers) {
$nameTools = get_lang('QuestionManagement');
}
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -37,19 +37,17 @@ if (!$is_allowedToEdit) {
api_not_allowed(true);
}
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook'),
);
}
$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises'));
$interbreadcrumb[] = array(
"url" => "exercise.php",
"name" => get_lang('Exercises')
);
$nameTools = get_lang('adminHP');
Display::display_header($nameTools, "Exercise");

@ -87,17 +87,9 @@ if ($page < 0) {
$page = 1;
}
if (!empty($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
$_SESSION['gradebook'] = Security::remove_XSS($_GET['gradebook']);
$gradebook = $_SESSION['gradebook'];
} elseif (empty($_GET['gradebook'])) {
unset($_SESSION['gradebook']);
$gradebook = '';
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -163,14 +163,9 @@ if ($form->validate()) {
header('Location:admin.php?exerciseId='.$exercise_id.'&'.api_get_cidreq());
exit;
} else {
// DISPLAY FORM
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -56,13 +56,9 @@ if (empty($objExercise)) {
api_not_allowed();
}
$gradebook = '';
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook'),
);
}

@ -135,16 +135,12 @@ if (!$is_allowedToEdit) {
}
}
if (isset($_SESSION['gradebook'])) {
$gradebook = Security::remove_XSS($_SESSION['gradebook']);
}
$allowRecordAudio = api_get_setting('enable_record_audio') === 'true';
$allowTeacherCommentAudio = api_get_configuration_value('allow_teacher_comment_audio') === true;
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -775,19 +775,17 @@ if ($question_count != 0) {
}
}
if (!empty ($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
$_SESSION['gradebook'] = Security::remove_XSS($_GET['gradebook']);
$gradebook = $_SESSION['gradebook'];
} elseif (empty ($_GET['gradebook'])) {
unset($_SESSION['gradebook']);
$gradebook = '';
}
if (!empty ($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array('url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('ToolGradebook'));
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}
$interbreadcrumb[] = array("url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises'));
$interbreadcrumb[] = array(
"url" => "exercise.php?".api_get_cidreq(),
"name" => get_lang('Exercises')
);
$interbreadcrumb[] = array("url" => "#", "name" => $objExercise->selectTitle(true));
if ($origin != 'learnpath') { //so we are not in learnpath tool

@ -19,13 +19,9 @@ if (!api_is_allowed_to_edit(null, true)) {
api_not_allowed();
}
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -36,7 +36,10 @@ $learnpath_item_id = isset($_REQUEST['learnpath_item_id']) ? intval($_REQUEST['l
$learnpathItemViewId = isset($_REQUEST['learnpath_item_view_id']) ? intval($_REQUEST['learnpath_item_view_id']) : null;
$origin = api_get_origin();
$interbreadcrumb[] = array("url" => "exercise.php?gradebook=$gradebook", "name" => get_lang('Exercises'));
$interbreadcrumb[] = array(
"url" => "exercise.php?".api_get_path(),
"name" => get_lang('Exercises')
);
$interbreadcrumb[] = array("url" => "#", "name" => $objExercise->selectTitle(true));
$time_control = false;
@ -125,7 +128,7 @@ if (isset($exercise_stat_info['exe_id'])) {
// 2. Exercise button
// Notice we not add there the lp_item_view_id because is not already generated
$exercise_url = api_get_path(WEB_CODE_PATH).'exercise/exercise_submit.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&origin='.$origin.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&learnpath_item_view_id='.$learnpathItemViewId.$extra_params;
$exercise_url = api_get_path(WEB_CODE_PATH).'exercise/exercise_submit.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&learnpath_item_view_id='.$learnpathItemViewId.$extra_params;
$exercise_url_button = Display::url(
$label,
$exercise_url,

@ -171,12 +171,11 @@ if ($is_allowedToEdit) {
}
}
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array('url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('ToolGradebook'));
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}
// if admin of course

@ -64,14 +64,9 @@ if (!$isEditable) {
api_not_allowed(true);
}
/* Header and Breadcrumbs */
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -34,15 +34,9 @@ $currentForumCategory = get_forumcategory_information($currentForum['forum_categ
// the variable $forum_settings is declared in forumconfig.inc.php
$forumSettings = $forum_setting;
/* Breadcrumbs */
if (isset($_SESSION['gradebook'])) {
$gradebook = Security::remove_XSS($_SESSION['gradebook']);
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -90,16 +90,9 @@ $currentForumCategory = get_forumcategory_information(
);
$groupId = api_get_group_id();
/*
Header and Breadcrumbs
*/
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -39,14 +39,9 @@ $origin = api_get_origin();
// Name of the tool
$nameTools = get_lang('ToolForum');
// Breadcrumbs
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -52,17 +52,9 @@ $_user = api_get_user_info();
require_once 'forumconfig.inc.php';
require_once 'forumfunction.inc.php';
if (!empty($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
$_SESSION['gradebook'] = Security::remove_XSS($_GET['gradebook']);
$gradebook = $_SESSION['gradebook'];
} elseif (empty($_GET['gradebook'])) {
unset($_SESSION['gradebook']);
$gradebook = '';
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook'),
);
}

@ -45,15 +45,9 @@ $origin = api_get_origin();
$current_forum = get_forum_information($_GET['forum']);
$current_forum_category = get_forumcategory_information($current_forum['forum_category']);
/* Breadcrumbs */
if (isset($_SESSION['gradebook'])) {
$gradebook = Security::remove_XSS($_SESSION['gradebook']);
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -77,23 +77,16 @@ if ($current_forum['forum_of_group'] != 0) {
}
}
/* Breadcrumbs */
$gradebook = null;
if (isset($_SESSION['gradebook'])) {
$gradebook = Security::remove_XSS($_SESSION['gradebook']);
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}
$groupId = api_get_group_id();
if (!empty($groupId)) {
$_clean['toolgroup'] = $groupId;
$group_properties = GroupManager :: get_group_properties($_clean['toolgroup']);
$group_properties = GroupManager::get_group_properties($_clean['toolgroup']);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(),
'name' => get_lang('Groups'),

@ -107,14 +107,9 @@ if (!empty($groupId)) {
$my_search = isset($_GET['search']) ? $_GET['search'] : '';
$my_action = isset($_GET['action']) ? $_GET['action'] : '';
$gradebook = null;
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -54,15 +54,9 @@ require_once 'forumfunction.inc.php';
// Are we in a lp ?
$origin = api_get_origin();
/* Header and Breadcrumbs */
$gradebook = null;
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -41,15 +41,9 @@ $current_forum = get_forum_information($current_thread['forum_id']); // Note: Th
$current_forum_category = get_forumcategory_information($current_forum['forum_category']);
$whatsnew_post_info = $_SESSION['whatsnew_post_info'];
/* Header and Breadcrumbs */
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -38,16 +38,10 @@ $current_thread = get_thread_information($_GET['forum'], $_GET['thread']);
$current_forum = get_forum_information($current_thread['forum_id']);
$current_forum_category = get_forumcategory_information($current_forum['forum_category']);
$whatsnew_post_info = isset($_SESSION['whatsnew_post_info']) ? $_SESSION['whatsnew_post_info'] : null;
/* Header and Breadcrumbs */
if (!empty($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
$_SESSION['gradebook'] = Security::remove_XSS($_GET['gradebook']);
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -13,10 +13,10 @@ $_in_course = false;
//make sure the destination for scripts is index.php instead of gradebook.php
require_once __DIR__.'/../inc/global.inc.php';
if (!empty($_GET['course'])) {
$_SESSION['gradebook_dest'] = 'index.php';
Category::setUrl('index.php');
$this_section = SECTION_COURSES;
} else {
$_SESSION['gradebook_dest'] = 'gradebook.php';
Category::setUrl('gradebook.php');
$this_section = SECTION_MYGRADEBOOK;
unset($_GET['course']);
}
@ -65,7 +65,7 @@ if (isset($_GET['createallcategories'])) {
unset($cat);
}
}
header('Location: '.$_SESSION['gradebook_dest'].'?addallcat=&selectcat=0');
header('Location: '.Category::getUrl().'addallcat=&selectcat=0');
exit;
}
@ -421,24 +421,27 @@ if (isset($move_form)) {
if (!isset($_GET['exportpdf']) && !isset($_GET['export_certificate'])) {
if (isset($_GET['studentoverview'])) {
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectcat.'&'.api_get_cidreq(),
'url' => Category::getUrl().'selectcat='.$selectcat,
'name' => get_lang('ToolGradebook')
);
Display :: display_header(get_lang('FlatView'));
} elseif (isset ($_GET['search'])) {
if ($_SESSION['gradebook_dest'] == 'index.php') {
$gradebook_dest = Security::remove_XSS($_SESSION['gradebook_dest']).'?'.api_get_cidreq().'&amp;';
} else {
$gradebook_dest = Security::remove_XSS($_SESSION['gradebook_dest']);
}
$interbreadcrumb[] = array('url' => $gradebook_dest, 'name' => get_lang('Gradebook'));
} elseif (isset($_GET['search'])) {
$interbreadcrumb[] = array(
'url' => Category::getUrl(),
'name' => get_lang('Gradebook')
);
if ((isset($_GET['selectcat']) && $_GET['selectcat'] > 0)) {
if (!empty($_GET['course'])) {
$interbreadcrumb[] = array('url' => $gradebook_dest.'selectcat='.$selectcat, 'name' => get_lang('Details'));
$interbreadcrumb[] = array(
'url' => Category::getUrl().'selectcat='.$selectcat,
'name' => get_lang('Details')
);
} else {
$interbreadcrumb[] = array('url' => $_SESSION['gradebook_dest'].'?selectcat=0', 'name' => get_lang('Details'));
$interbreadcrumb[] = array(
'url' => Category::getUrl().'selectcat=0',
'name' => get_lang('Details')
);
}
}
Display :: display_header('');

@ -89,13 +89,13 @@ if ($form->validate()) {
}
$cat->set_visible($visible);
$result = $cat->add();
header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?addcat=&selectcat='.$cat->get_parent_id().'&'.api_get_cidreq());
header('Location: '.Category::getUrl().'addcat=&selectcat='.$cat->get_parent_id());
exit;
}
if (!$_in_course) {
$interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$get_select_cat.'&'.api_get_cidreq(),
'url' => Category::getUrl().'selectcat='.$get_select_cat,
'name' => get_lang('Gradebook')
);
}

@ -69,7 +69,7 @@ if ($form->validate()) {
//header('Location: gradebook_add_user.php?selecteval=' . $eval->get_id());
exit;
} else {
header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$eval->get_category_id().'&'.api_get_cidreq());
header('Location: '.Category::getUrl().'selectcat='.$eval->get_category_id());
exit;
}
} else {
@ -78,19 +78,19 @@ if ($form->validate()) {
header('Location: gradebook_add_result.php?selecteval='.$eval->get_id().'&'.api_get_cidreq());
exit;
} else {
header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$eval->get_category_id().'&'.api_get_cidreq());
header('Location: '.Category::getUrl().'selectcat='.$eval->get_category_id());
exit;
}
}
}
$interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$select_cat.'&'.api_get_cidreq(),
'url' => Category::getUrl().'selectcat='.$select_cat,
'name' => get_lang('Gradebook'))
;
$this_section = SECTION_COURSES;
$htmlHeadXtra[] = '<script type="text/javascript">
$htmlHeadXtra[] = '<script>
$(document).ready( function() {
$("#hid_category_id").change(function() {
$("#hid_category_id option:selected").each(function () {

@ -134,14 +134,14 @@ if (isset($typeSelected) && $typeSelected != '0') {
header('Location: gradebook_add_result.php?selecteval='.$link->get_ref_id().'&'.api_get_cidreq());
exit;
} else {
header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?linkadded=&selectcat='.$selectCat.'&'.api_get_cidreq());
header('Location: '.Category::getUrl().'linkadded=&selectcat='.$selectCat);
exit;
}
}
}
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectCat.'&'.api_get_cidreq(),
'url' => Category::getUrl().'selectcat='.$selectCat,
'name' => get_lang('Gradebook')
);
$this_section = SECTION_COURSES;

@ -37,7 +37,7 @@ if ($form->validate()) {
}
$interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$selectCat.'&'.api_get_cidreq(),
'url' => Category::getUrl().'selectcat='.$selectCat,
'name' => get_lang('Gradebook')
);
Display :: display_header(get_lang('NewCategory'));

@ -51,7 +51,7 @@ if ($add_result_form->validate()) {
exit;
}
$interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']),
'url' => Category::getUrl(),
'name' => get_lang('Gradebook')
);
Display :: display_header(get_lang('AddResult'));

@ -65,7 +65,7 @@ if (isset($_POST['submit_button'])) {
}
}
$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('Gradebook'));
$interbreadcrumb[] = array('url' => Category::getUrl(), 'name' => get_lang('Gradebook'));
$interbreadcrumb[] = array(
'url' => 'gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(),
'name' => get_lang('ViewResult')

@ -160,7 +160,7 @@ switch ($action) {
}
$interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?',
'url' => Category::getUrl(),
'name' => get_lang('Gradebook'),
);
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('GradebookListOfStudentsCertificates'));

@ -111,15 +111,18 @@ switch ($action) {
$course_code = api_get_course_id();
$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('GradebookListOfStudentsReports'));
$interbreadcrumb[] = array(
'url' => Category::getUrl(),
'name' => get_lang('Gradebook')
);
$interbreadcrumb[] = array(
'url' => '#',
'name' => get_lang('GradebookListOfStudentsReports')
);
$this_section = SECTION_COURSES;
Display::display_header('');
$token = Security::get_token();
echo Display::page_header(get_lang('GradebookListOfStudentsReports'));
echo '<div class="btn-group">';

@ -227,19 +227,19 @@ if ($form->validate()) {
if (!isset($_GET['exportpdf']) and !isset($_GET['export_certificate'])) {
if (isset($_GET['studentoverview'])) {
$interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$my_selectcat,
'url' => Category::getUrl().'selectcat='.$my_selectcat,
'name' => get_lang('Gradebook'),
);
Display:: display_header(get_lang('FlatView'));
} elseif (isset($_GET['search'])) {
$interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$my_selectcat,
'url' => Category::getUrl().'selectcat='.$my_selectcat,
'name' => get_lang('Gradebook'),
);
Display:: display_header(get_lang('SearchResults'));
} else {
$interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat=1',
'url' => Category::getUrl().'selectcat=1',
'name' => get_lang('Gradebook'),
);
$interbreadcrumb[] = array(
@ -251,7 +251,7 @@ if (!isset($_GET['exportpdf']) and !isset($_GET['export_certificate'])) {
}
?>
<div class="actions">
<a href="<?php echo Security::remove_XSS($_SESSION['gradebook_dest']).'?'.$my_api_cidreq ?>&selectcat=<?php echo $my_selectcat ?>">
<a href="<?php echo Category::getUrl(); ?>selectcat=<?php echo $my_selectcat ?>">
<?php echo Display::return_icon(
'back.png',
get_lang('FolderView'),

@ -80,12 +80,12 @@ if ($form->validate()) {
$cat->setIsRequirement(false);
}
$cat->save();
header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?editcat=&selectcat='.$cat->get_parent_id().'&'.api_get_cidreq());
header('Location: '.Category::getUrl().'editcat=&selectcat='.$cat->get_parent_id());
exit;
}
$selectcat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : '';
$interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$selectcat.'&'.api_get_cidreq(),
'url' => Category::getUrl().'selectcat='.$selectcat,
'name' => get_lang('Gradebook')
);
$this_section = SECTION_COURSES;

@ -44,12 +44,12 @@ if ($form->validate()) {
}
$eval->set_visible($visible);
$eval->save();
header('Location: '.$_SESSION['gradebook_dest'].'?editeval=&selectcat='.$eval->get_category_id().'&'.api_get_cidreq());
header('Location: '.Category::getUrl().'editeval=&selectcat='.$eval->get_category_id());
exit;
}
$selectcat_inter = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectcat_inter,
'url' => Category::getUrl().'selectcat='.$selectcat_inter,
'name' => get_lang('Gradebook')
);

@ -104,12 +104,12 @@ if ($form->validate()) {
'type' => LINK_STUDENTPUBLICATION
]);
header('Location: '.$_SESSION['gradebook_dest'].'?linkedited=&selectcat='.$link->get_category_id().'&'.api_get_cidreq());
header('Location: '.Category::getUrl().'linkedited=&selectcat='.$link->get_category_id());
exit;
}
$interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$linkcat,
'url' => Category::getUrl().'selectcat='.$linkcat,
'name' => get_lang('Gradebook')
);

@ -48,7 +48,7 @@ if ($edit_result_form->validate()) {
$table = $edit_result_form->toHtml();
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('Gradebook')
);
$interbreadcrumb[] = array(

@ -28,7 +28,7 @@ if (isset($_POST['submit']) && isset($_POST['keyword'])) {
}
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat=1',
'url' => Category::getUrl().'selectcat=1',
'name' => get_lang('ToolGradebook')
);

@ -40,7 +40,7 @@ function minItem(item) {
</script>';
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat=1',
'url' => Category::getUrl().'selectcat=1',
'name' => get_lang('ToolGradebook')
);

@ -12,11 +12,11 @@ GradebookUtils::block_students();
$selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?',
'url' => Category::getUrl(),
'name' => get_lang('Gradebook')
);
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectCat,
'url' => Category::getUrl().'selectcat='.$selectCat,
'name' => get_lang('Details')
);
$interbreadcrumb[] = array(

@ -14,11 +14,11 @@ GradebookUtils::block_students();
$selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
$interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?',
'url' => Category::getUrl(),
'name' => get_lang('Gradebook'),
);
$interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$selectCat,
'url' => Category::getUrl().'selectcat='.$selectCat,
'name' => get_lang('Details')
);
$interbreadcrumb[] = array(

@ -19,7 +19,9 @@ if ($eval[0]->get_category_id() < 0) {
}
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$currentcat[0]->get_id(), 'name' => get_lang('ToolGradebook'));
'url' => Category::getUrl().'selectcat='.$currentcat[0]->get_id(),
'name' => get_lang('ToolGradebook')
);
if (api_is_allowed_to_edit()) {
$interbreadcrumb[] = array(

@ -19,7 +19,7 @@ if (!$isDrhOfCourse) {
}
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('Gradebook')
);
@ -513,7 +513,7 @@ if (isset($_GET['deleteall'])) {
if (!isset($_GET['export']) && (!isset($_GET['import']))) {
if (!isset($_GET['selectcat'])) {
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$currentcat[0]->get_id().'&'.api_get_cidreq(),
'url' => Category::getUrl().'selectcat='.$currentcat[0]->get_id(),
'name' => get_lang('Details')
);
}

@ -22,7 +22,7 @@ $stud_id = api_get_user_id();
$session_id = api_get_session_id();
//make sure the destination for scripts is index.php instead of gradebook.php
$_SESSION['gradebook_dest'] = 'index.php';
Category::setUrl('index.php');
$this_section = SECTION_COURSES;
@ -150,7 +150,7 @@ if (isset($_GET['createallcategories'])) {
unset($cat);
}
}
header('Location: '.$_SESSION['gradebook_dest'].'?addallcat=&selectcat=0');
header('Location: '.Category::getUrl().'addallcat=&selectcat=0');
exit;
}
@ -575,15 +575,15 @@ $viewTitle = '';
// DISPLAY HEADERS AND MESSAGES
if (!isset($_GET['exportpdf'])) {
if (isset ($_GET['studentoverview'])) {
if (isset($_GET['studentoverview'])) {
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectCat,
'url' => Category::getUrl().'selectcat='.$selectCat,
'name' => get_lang('ToolGradebook')
);
$viewTitle = get_lang('FlatView');
} elseif (isset($_GET['search'])) {
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectCat,
'url' => Category::getUrl().'selectcat='.$selectCat,
'name' => get_lang('ToolGradebook')
);
$viewTitle = get_lang('SearchResults');

@ -2,6 +2,7 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\GradebookCategory;
use ChamiloSession as Session;
/**
* Class Category
@ -2561,4 +2562,30 @@ class Category implements GradebookItem
$this->studentList = $list;
}
/**
* @return string
*/
public static function getUrl()
{
$url = Session::read('gradebook_dest');
return $url;
}
/**
* Destination is index.php or gradebook.php
* @param string $url
*/
public static function setUrl($url)
{
switch ($url) {
case 'gradebook.php':
$url = api_get_path(WEB_CODE_PATH).'gradebook/gradebook.php?';
break;
case 'index.php':
$url = api_get_path(WEB_CODE_PATH).'gradebook/index.php?'.api_get_cidreq().'&';
break;
}
Session::write('gradebook_dest', $url);
}
}

@ -20,7 +20,7 @@ class DisplayGradebook
if (api_is_allowed_to_edit(null, true)) {
$header = '<div class="actions">';
if ($page != 'statistics') {
$header .= '<a href="'.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$selectcat.'&'.api_get_cidreq().'">'.
$header .= '<a href="'.Category::getUrl().'selectcat='.$selectcat.'">'.
Display::return_icon(('back.png'), get_lang('FolderView'), '', ICON_SIZE_MEDIUM).'</a>';
if (($evalobj->get_course_code() != null) && !$evalobj->has_results()) {
$header .= '<a href="gradebook_add_result.php?'.api_get_cidreq().'&selectcat='.$selectcat.'&selecteval='.$evalobj->get_id().'">
@ -110,15 +110,25 @@ class DisplayGradebook
if ($page != 'statistics') {
if (api_is_allowed_to_edit(null, true)) {
$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>';
Display::return_icon(
'statistics.png',
get_lang('ViewStatistics'),
'',
ICON_SIZE_MEDIUM
).'</a>';
}
}
$evalinfo .= '</td><td>'.Display::return_icon('tutorial.gif', '', ['style' => 'float:right; position:relative;']).'</td></table>';
$evalinfo .= '</td><td>'.
Display::return_icon(
'tutorial.gif',
'',
['style' => 'float:right; position:relative;']
)
.'</td></table>';
echo $evalinfo;
echo $header;
}
/**
* Displays the header for the flatview page containing filters
* @param $catobj
@ -130,7 +140,7 @@ class DisplayGradebook
$header = '<div class="actions">';
if ($catobj->get_parent_id() == 0) {
$select_cat = $catobj->get_id();
$url = Security::remove_XSS($_SESSION['gradebook_dest']);
$url = Category::getUrl();
} else {
$select_cat = $catobj->get_parent_id();
$url = 'gradebook_flatview.php';
@ -149,7 +159,12 @@ class DisplayGradebook
]);
$header .= Display::url(
Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM),
Display::return_icon(
'export_csv.png',
get_lang('ExportAsCSV'),
'',
ICON_SIZE_MEDIUM
),
$exportCsvUrl
);
@ -160,7 +175,12 @@ class DisplayGradebook
]);
$header .= Display::url(
Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM),
Display::return_icon(
'export_excel.png',
get_lang('ExportAsXLS'),
'',
ICON_SIZE_MEDIUM
),
$exportXlsUrl
);
@ -171,7 +191,12 @@ class DisplayGradebook
]);
$header .= Display::url(
Display::return_icon('export_doc.png', get_lang('ExportAsDOC'), '', ICON_SIZE_MEDIUM),
Display::return_icon(
'export_doc.png',
get_lang('ExportAsDOC'),
'',
ICON_SIZE_MEDIUM
),
$exportDocUrl
);
@ -181,7 +206,12 @@ class DisplayGradebook
]);
$header .= Display::url(
Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM),
Display::return_icon(
'printer.png',
get_lang('Print'),
'',
ICON_SIZE_MEDIUM
),
$exportPrintUrl,
['target' => '_blank']
);
@ -195,7 +225,12 @@ class DisplayGradebook
]);
$header .= Display::url(
Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM),
Display::return_icon(
'pdf.png',
get_lang('ExportToPDF'),
'',
ICON_SIZE_MEDIUM
),
$exportPdfUrl
);
@ -306,7 +341,13 @@ class DisplayGradebook
$header .= '<tr>';
if (!$selectcat == '0') {
$header .= '<td><a href="'.api_get_self().'?selectcat='.$catobj->get_parent_id().'">'.
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('RootCat'), '', ICON_SIZE_MEDIUM).'</a></td>';
Display::return_icon(
'back.png',
get_lang('BackTo').' '.get_lang('RootCat'),
'',
ICON_SIZE_MEDIUM
).
'</a></td>';
}
$header .= '<td>'.get_lang('CurrentCategory').'</td>'.
'<td><form name="selector"><select name="selectcat" onchange="document.selector.submit()">';
@ -347,13 +388,18 @@ class DisplayGradebook
}
// for course admin & platform admin add item buttons are added to the header
$actionsLeft = '';
$actionsRight = '';
$my_api_cidreq = api_get_cidreq();
if (api_is_allowed_to_edit(null, true)) {
if (empty($grade_model_id) || $grade_model_id == -1) {
$actionsLeft .= '<a href="gradebook_add_cat.php?'.api_get_cidreq().'&selectcat='.$catobj->get_id().'">'.
Display::return_icon('new_folder.png', get_lang('AddGradebook'), array(), ICON_SIZE_MEDIUM).'</a></td>';
Display::return_icon(
'new_folder.png',
get_lang('AddGradebook'),
array(),
ICON_SIZE_MEDIUM
).'</a></td>';
}
if ($selectcat != '0') {
$my_category = $catobj->showAllCategoryInfo($catobj->get_id());
@ -424,7 +470,6 @@ class DisplayGradebook
$actionsRight .= '<a href="gradebook_scoring_system.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'.
Display::return_icon('ranking.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM).'</a>';
}
}
}
} elseif (isset($_GET['search'])) {
@ -437,12 +482,21 @@ class DisplayGradebook
);
if ($isDrhOfCourse) {
$$actionsLeft .= '<a href="gradebook_flatview.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'.
Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a href="gradebook_flatview.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'.
Display::return_icon(
'stats.png',
get_lang('FlatView'),
'',
ICON_SIZE_MEDIUM
).
'</a>';
}
if (api_is_allowed_to_edit(null, true)) {
echo $toolbar = Display::toolbarAction('gradebook-actions', array($actionsLeft, $actionsRight));
echo $toolbar = Display::toolbarAction(
'gradebook-actions',
array($actionsLeft, $actionsRight)
);
}
if (api_is_allowed_to_edit(null, true)) {
@ -486,15 +540,17 @@ class DisplayGradebook
$catcourse = Category::load($catobj->get_id());
$scoredisplay = ScoreDisplay::instance();
$scorecourse = $catcourse[0]->calc_score(api_get_user_id());
$scorecourse_display = (isset($scorecourse) ? $scoredisplay->display_score($scorecourse, SCORE_AVERAGE) : get_lang('NoResultsAvailable'));
$scorecourse_display = isset($scorecourse) ? $scoredisplay->display_score($scorecourse, SCORE_AVERAGE) : get_lang('NoResultsAvailable');
$cattotal = Category::load(0);
$scoretotal = $cattotal[0]->calc_score(api_get_user_id());
$scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable'));
$scoretotal_display = isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable');
$scoreinfo = get_lang('StatsStudent').' :<b> '.$user['complete_name'].'</b><br />';
if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search'])))
$scoreinfo .= '<br />'.get_lang('TotalForThisCategory').' : <b>'.$scorecourse_display.'</b>';
$scoreinfo .= '<br />'.get_lang('Total').' : <b>'.$scoretotal_display.'</b>';
Display::addFlash(Display::return_message($scoreinfo, 'normal', false));
Display::addFlash(
Display::return_message($scoreinfo, 'normal', false)
);
}
// show navigation tree and buttons?
$header = '<div class="actions">';
@ -527,8 +583,16 @@ class DisplayGradebook
$scoredisplay = ScoreDisplay::instance();
// generating the total score for a course
$allevals = $catcourse[0]->get_evaluations($userId, true, api_get_course_id());
$alllinks = $catcourse[0]->get_links($userId, true, api_get_course_id());
$allevals = $catcourse[0]->get_evaluations(
$userId,
true,
api_get_course_id()
);
$alllinks = $catcourse[0]->get_links(
$userId,
true,
api_get_course_id()
);
$evals_links = array_merge($allevals, $alllinks);
$item_value = 0;
$item_total = 0;

@ -985,7 +985,7 @@ class GradebookTable extends SortableTable
switch ($item->get_item_type()) {
// category
case 'C':
$prms_uri = '?selectcat='.$item->get_id().'&amp;view='.$view;
$prms_uri = '?selectcat='.$item->get_id().'&view='.$view;
if (isset($_GET['isStudentView'])) {
if (isset($is_student) || (isset($_SESSION['studentview']) && $_SESSION['studentview'] == 'studentview')) {
$prms_uri = $prms_uri.'&amp;isStudentView='.Security::remove_XSS($_GET['isStudentView']);
@ -995,7 +995,7 @@ class GradebookTable extends SortableTable
$cat = new Category();
$show_message = $cat->show_message_resource_delete($item->get_course_code());
return '&nbsp;<a href="'.Security::remove_XSS($_SESSION['gradebook_dest']).$prms_uri.'">'
return '&nbsp;<a href="'.Category::getUrl().$prms_uri.'">'
.$item->get_name()
.'</a>'
.($item->is_course() ? ' &nbsp;['.$item->get_course_code().']'.$show_message : '');

@ -410,7 +410,7 @@ class GradebookDataGenerator
{
if (is_a($item, 'Category')) {
if ($item->is_certificate_available(api_get_user_id())) {
$link = '<a href="'.Security::remove_XSS($_SESSION['gradebook_dest']).'?export_certificate=1&cat='.$item->get_id().'&user='.api_get_user_id().'">'.
$link = '<a href="'.Category::getUrl().'export_certificate=1&cat='.$item->get_id().'&user='.api_get_user_id().'">'.
get_lang('Certificate').'</a>';
return $link;
}

@ -17,7 +17,7 @@ if (!$isDrhOfCourse) {
GradebookUtils::block_students();
}
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('Gradebook')
);

@ -5746,9 +5746,7 @@ class learnpath
error_log('New LP - In learnpath::overview()', 0);
}
$_SESSION['gradebook'] = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null;
$return = '';
$update_audio = isset($_GET['updateaudio']) ? $_GET['updateaudio'] : null;
// we need to start a form when we want to update all the mp3 files

@ -54,18 +54,18 @@ if ((!$is_allowed_to_edit) || ($isStudentView)) {
Course admin section
- all the functions not available for students - always available in this case (page only shown to admin)
*/
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}
$interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths'));
$interbreadcrumb[] = array(
'url' => 'lp_controller.php?action=list',
'name' => get_lang('LearningPaths')
);
Display::display_header(get_lang('LearnpathAddLearnpath'), 'Path');

@ -25,15 +25,10 @@ if ((!$is_allowed_to_edit) || ($isStudentView)) {
header('location:lp_controller.php?action=view&lp_id='.$learnpath_id);
exit;
}
/* SHOWING THE ADMIN TOOLS */
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -85,14 +85,9 @@ $(function() {
});
</script>";
/* SHOWING THE ADMIN TOOLS */
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -37,15 +37,9 @@ $sql_query = "SELECT * FROM $tbl_lp WHERE c_id = $course_id AND id = $learnpath_
$result = Database::query($sql_query);
$therow = Database::fetch_array($result);
/* SHOWING THE ADMIN TOOLS */
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -53,19 +53,9 @@ $sql_query = "SELECT * FROM $tbl_lp WHERE c_id = $course_id AND id = $learnpath_
$result = Database::query($sql_query);
$therow = Database::fetch_array($result);
/* SHOWING THE ADMIN TOOLS */
if (!empty($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
$_SESSION['gradebook'] = Security::remove_XSS($_GET['gradebook']);
$gradebook = $_SESSION['gradebook'];
} elseif (empty($_GET['gradebook'])) {
unset($_SESSION['gradebook']);
$gradebook = '';
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -90,13 +90,9 @@ if ($debug > 0) {
}
$_SESSION['oLP']->set_previous_item($lp_item_id);
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -15,13 +15,9 @@ $nameTools = get_lang('Doc');
$this_section = SECTION_COURSES;
Event::event_access_tool(TOOL_LEARNPATH);
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -80,16 +80,9 @@ $therow = Database::fetch_array($result);
Course admin section
- all the functions not available for students - always available in this case (page only shown to admin)
*/
/* SHOWING THE ADMIN TOOLS */
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -37,20 +37,17 @@ $show_learn_path = true;
$lp = $_SESSION['oLP'];
$lp_theme_css = $lp->get_theme();
/* SHOWING THE ADMIN TOOLS */
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}
$interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths'));
$interbreadcrumb[] = array(
'url' => 'lp_controller.php?action=list',
'name' => get_lang('LearningPaths')
);
$interbreadcrumb[] = array(
'url' => api_get_self()."?action=build&lp_id=$learnpath_id",
'name' => stripslashes($lp->get_name()),

@ -17,13 +17,9 @@ require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
Event::event_access_tool(TOOL_SEARCH);
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

@ -78,15 +78,10 @@ $therow = Database::fetch_array($result);
Course admin section
- all the functions not available for students - always available in this case (page only shown to admin)
*/
/* SHOWING THE ADMIN TOOLS */
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
if (api_is_in_gradebook()) {
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'url' => Category::getUrl(),
'name' => get_lang('ToolGradebook')
);
}

Loading…
Cancel
Save