Fix and rename student_follow_page_show_invisible_lp_students to student_follow_page_include_not_subscribed_lp_students - refs BT#18671

pull/3888/head
Angel Fernando Quiroz Campos 4 years ago
parent d8f758a4a2
commit 517abe3e03
  1. 9
      main/inc/lib/tracking.lib.php
  2. 2
      main/install/configuration.dist.php
  3. 6
      main/lp/learnpath.class.php
  4. 7
      main/lp/learnpathList.class.php

@ -7544,11 +7544,7 @@ class Tracking
}
$addLpInvisibleCheckbox = api_get_configuration_value('student_follow_page_add_LP_invisible_checkbox');
$showInvisibleLp = api_get_configuration_value('student_follow_page_show_invisible_lp_students');
if ($addLpInvisibleCheckbox && $showInvisibleLp) {
$addLpInvisibleCheckbox = false;
}
$includeNotsubscribedLp = api_get_configuration_value('student_follow_page_include_not_subscribed_lp_students');
$columnHeadersKeys = array_keys($columnHeaders);
@ -7568,7 +7564,8 @@ class Tracking
true,
$category->getId(),
false,
$showInvisibleLp
false,
$includeNotsubscribedLp === false
);
$lpList = $objLearnpathList->get_flat_list();

@ -400,7 +400,7 @@ INSERT INTO extra_field (extra_field_type, field_type, variable, display_text, d
*/
//$_configuration['student_follow_page_add_LP_invisible_checkbox'] = false;
// Show the LP not marked as invisible by teacher in tracking page
//$_configuration['student_follow_page_show_invisible_lp_students'] = false;
//$_configuration['student_follow_page_include_not_subscribed_lp_students'] = false;
// Allow change the order to show the tools in "My progress" page.
/*$_configuration['my_progress_course_tools_order'] = [
'order' => ['quizzes', 'learning_paths', 'skills'],

@ -2299,6 +2299,7 @@ class learnpath
* @param int $student_id
* @param array $courseInfo
* @param int $sessionId
* @param bool $checkSubscription Optional. Allow don't check if user is subscribed to the LP.
*
* @return bool
*/
@ -2306,7 +2307,8 @@ class learnpath
$lp_id,
$student_id,
$courseInfo = [],
$sessionId = 0
$sessionId = 0,
bool $checkSubscription = true
) {
$courseInfo = empty($courseInfo) ? api_get_course_info() : $courseInfo;
$lp_id = (int) $lp_id;
@ -2390,7 +2392,7 @@ class learnpath
}
}
if ($is_visible) {
if ($is_visible && $checkSubscription) {
$is_visible = self::isUserSubscribedToLp(
$row,
(int) $student_id,

@ -45,7 +45,7 @@ class LearnpathList
$categoryId = null,
$ignoreCategoryFilter = false,
$ignoreLpVisibility = false,
$ignoreLpSubscription = true
bool $includeSubscribedLp = true
) {
if (empty($courseInfo)) {
$courseInfo = api_get_course_info();
@ -169,7 +169,8 @@ class LearnpathList
$row->getId(),
$user_id,
$courseInfo,
$session_id
$session_id,
$includeSubscribedLp
);
if ($lpVisibility === false) {
continue;
@ -177,7 +178,7 @@ class LearnpathList
}
}
if (!$ignoreLpSubscription && $row->getSubscribeUsers()) {
if (!$includeSubscribedLp && $row->getSubscribeUsers() && $isAllowToEdit) {
$isSubscribedToLp = learnpath::isUserSubscribedToLp(
['subscribe_users' => $row->getSubscribeUsers(), 'id' => $row->getIid()],
(int) $this->user_id,

Loading…
Cancel
Save