|
|
|
|
@ -4823,14 +4823,19 @@ class learnpath |
|
|
|
|
* |
|
|
|
|
* @param CLpCategory $category |
|
|
|
|
* @param User $user |
|
|
|
|
* @param int |
|
|
|
|
* @param int |
|
|
|
|
* |
|
|
|
|
* @return bool |
|
|
|
|
*/ |
|
|
|
|
public static function categoryIsVisibleForStudent( |
|
|
|
|
CLpCategory $category, |
|
|
|
|
User $user |
|
|
|
|
User $user, |
|
|
|
|
$courseId = 0, |
|
|
|
|
$sessionId = 0 |
|
|
|
|
) { |
|
|
|
|
$subscriptionSettings = self::getSubscriptionSettings(); |
|
|
|
|
|
|
|
|
|
if ($subscriptionSettings['allow_add_users_to_lp_category'] == false) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
@ -4851,6 +4856,9 @@ class learnpath |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$courseId = empty($courseId) ? api_get_course_int_id() : (int) $courseId; |
|
|
|
|
$sessionId = empty($sessionId) ? api_get_session_id() : (int) $sessionId; |
|
|
|
|
|
|
|
|
|
if ($category->hasUserAdded($user)) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
@ -4864,13 +4872,12 @@ class learnpath |
|
|
|
|
|
|
|
|
|
/** @var CourseRepository $courseRepo */ |
|
|
|
|
$courseRepo = $em->getRepository('ChamiloCoreBundle:Course'); |
|
|
|
|
$sessionId = api_get_session_id(); |
|
|
|
|
$session = null; |
|
|
|
|
if (!empty($sessionId)) { |
|
|
|
|
$session = $em->getRepository('ChamiloCoreBundle:Session')->find($sessionId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$course = $courseRepo->find(api_get_course_int_id()); |
|
|
|
|
$course = $courseRepo->find($courseId); |
|
|
|
|
|
|
|
|
|
// Subscribed groups to a LP |
|
|
|
|
$subscribedGroupsInLp = $itemRepo->getGroupsSubscribedToItem( |
|
|
|
|
|