Admin: Config add hide_graph_in_my_progress BT#18720

Hides the graph in the main/auth/my_progress.php page.
pull/3888/head
Julio Montoya 4 years ago
parent 463330339f
commit 9d41b63eb5
  1. 13
      main/auth/my_progress.php
  2. 8
      main/inc/lib/tracking.lib.php
  3. 3
      main/install/configuration.dist.php

@ -41,6 +41,8 @@ $sessionId = isset($_GET['session_id']) ? (int) $_GET['session_id'] : 0;
$courseCode = isset($_GET['course']) ? Security::remove_XSS($_GET['course']) : null;
$allowCareerUser = api_get_configuration_value('allow_career_users');
$showGraph = false === api_get_configuration_value('hide_session_graph_in_my_progress');
if (!empty($courseUserList)) {
$items = MySpace::get_connections_from_course_list(
$user_id,
@ -81,12 +83,19 @@ if (!empty($courseUserList)) {
}
}
$content = Tracking::showUserProgress($user_id, $sessionId);
$content = Tracking::showUserProgress(
$user_id,
$sessionId,
'',
true,
true,
false,
$showGraph
);
$showAllSessionCourses = api_get_configuration_value('my_progress_session_show_all_courses');
if ($showAllSessionCourses && !empty($sessionId) && empty($courseCode)) {
$userSessionCourses = UserManager::get_courses_list_by_session($user_id, $sessionId);
foreach ($userSessionCourses as $userSessionCourse) {
$content .= Tracking::show_course_detail(
$user_id,

@ -4703,7 +4703,8 @@ class Tracking
$extra_params = '',
$show_courses = true,
$showAllSessions = true,
$returnArray = false
$returnArray = false,
$showGraph = true
) {
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
@ -5100,6 +5101,7 @@ class Tracking
$my_results_final[] = $my_results[$key];
$final_all_exercise_graph_list[] = $all_exercise_graph_list[$key];
}
if ($showGraph) {
$main_session_graph = '<div class="row"><div class="col-md-10 col-md-offset-1">'
.self::generate_session_exercise_graph(
$final_all_exercise_graph_name_list,
@ -5108,6 +5110,7 @@ class Tracking
)
.'</div></div>';
}
}
$sessionIcon = Display::return_icon('session.png', get_lang('Sessions'));
@ -5215,6 +5218,8 @@ class Tracking
}
$html .= Display::div($sessionsTable->toHtml(), ['class' => 'table-responsive']);
if ($showGraph) {
$html .= Display::div(
$main_session_graph,
[
@ -5222,6 +5227,7 @@ class Tracking
'class' => 'chart-session',
]
);
}
// Checking selected session.
if (isset($_GET['session_id'])) {

@ -1921,6 +1921,9 @@ ALTER TABLE gradebook_comment ADD CONSTRAINT FK_C3B70763AD3ED51C FOREIGN KEY (gr
// Replace the Chamilo logo URL.
//$_configuration['platform_logo_url'] = 'https://chamilo.org';
// Hides the session graph in the main/auth/my_progress.php page.
//$_configuration['hide_session_graph_in_my_progress'] = true;
// KEEP THIS AT THE END
// -------- Custom DB changes
// Add user activation by confirmation email

Loading…
Cancel
Save