Avoid invisible LP if blocked for user/lp subscription.

See BT#10882
remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 22c549fbf1
commit b4ed8e9145
  1. 14
      main/lp/learnpathList.class.php

@ -108,10 +108,8 @@ class LearnpathList
$order
";
$learningPaths = Database::getManager()
->createQuery($dql)
->getResult();
$learningPaths = Database::getManager()->createQuery($dql)->getResult();
$showBlockedPrerequisite = api_get_configuration_value('show_prerequisite_as_blocked');
$names = [];
/** @var CLp $row */
foreach ($learningPaths as $row) {
@ -149,6 +147,14 @@ class LearnpathList
$session_id
);
// If option is not true then don't show invisible LP to user
if ($showBlockedPrerequisite !== true && !api_is_allowed_to_edit()) {
$lpVisibility = learnpath::is_lp_visible_for_student($row->getIid(), $user_id);
if ($lpVisibility === false) {
continue;
}
}
$this->list[$row->getIid()] = array(
'lp_type' => $row->getLpType(),
'lp_session' => $row->getSessionId(),

Loading…
Cancel
Save