diff --git a/src/main/java/org/olat/course/run/CourseRuntimeController.java b/src/main/java/org/olat/course/run/CourseRuntimeController.java index 5f986f0352cb4dd745038becf5e476d357a106d0..5d7651349ef7a48813002712494e5708d6f4a55d 100644 --- a/src/main/java/org/olat/course/run/CourseRuntimeController.java +++ b/src/main/java/org/olat/course/run/CourseRuntimeController.java @@ -139,7 +139,6 @@ import org.olat.instantMessaging.OpenInstantMessageEvent; import org.olat.modules.assessment.ui.AssessmentToolSecurityCallback; import org.olat.modules.lecture.LectureModule; import org.olat.modules.lecture.LectureService; -import org.olat.modules.lecture.RepositoryEntryLectureConfiguration; import org.olat.modules.lecture.ui.LectureRepositoryAdminController; import org.olat.modules.lecture.ui.LecturesSecurityCallback; import org.olat.modules.lecture.ui.LecturesSecurityCallbackFactory; @@ -626,8 +625,7 @@ public class CourseRuntimeController extends RepositoryEntryRuntimeController im } private boolean isLectureEnabled() { - RepositoryEntryLectureConfiguration lectureConfig = lectureService.getRepositoryEntryLectureConfiguration(getRepositoryEntry()); - return lectureConfig != null && lectureConfig.isLectureEnabled(); + return lectureService.isRepositoryEntryLectureEnabled(getRepositoryEntry()); } private void initToolsMenuStatistics(Dropdown tools, ICourse course, final UserCourseEnvironmentImpl uce) { diff --git a/src/main/java/org/olat/modules/coach/ui/UserDetailsController.java b/src/main/java/org/olat/modules/coach/ui/UserDetailsController.java index 439d95ead87a5736f117bda11941f5cd9fbec450..fdb014fe8a6a8ae581b87ab6d84853d2a9c57307 100644 --- a/src/main/java/org/olat/modules/coach/ui/UserDetailsController.java +++ b/src/main/java/org/olat/modules/coach/ui/UserDetailsController.java @@ -53,9 +53,7 @@ import org.olat.course.run.userview.UserCourseEnvironment; import org.olat.course.run.userview.UserCourseEnvironmentImpl; import org.olat.modules.assessment.ui.event.AssessmentFormEvent; import org.olat.modules.coach.model.EfficiencyStatementEntry; -import org.olat.modules.lecture.LectureModule; import org.olat.modules.lecture.LectureService; -import org.olat.modules.lecture.RepositoryEntryLectureConfiguration; import org.olat.modules.lecture.ui.ParticipantLectureBlocksController; import org.olat.repository.RepositoryEntry; import org.olat.repository.RepositoryEntrySecurity; @@ -92,9 +90,6 @@ public class UserDetailsController extends BasicController implements Activateab private final Identity assessedIdentity; - - @Autowired - private LectureModule lectureModule; @Autowired private LectureService lectureService; @Autowired @@ -138,12 +133,9 @@ public class UserDetailsController extends BasicController implements Activateab segmentView.addSegment(assessmentLink, selectSegment == Segment.assessment); } - if(lectureModule.isEnabled()) { - RepositoryEntryLectureConfiguration lectureConfig = lectureService.getRepositoryEntryLectureConfiguration(entry); - if(lectureConfig != null && lectureConfig.isLectureEnabled()) { - lecturesLink = LinkFactory.createLink("details.lectures", mainVC, this); - segmentView.addSegment(lecturesLink, selectSegment == Segment.lectures); - } + if(lectureService.isRepositoryEntryLectureEnabled(entry)) { + lecturesLink = LinkFactory.createLink("details.lectures", mainVC, this); + segmentView.addSegment(lecturesLink, selectSegment == Segment.lectures); } if(selectSegment == Segment.assessment) { diff --git a/src/main/java/org/olat/modules/lecture/LectureService.java b/src/main/java/org/olat/modules/lecture/LectureService.java index 72058236ce77b088d45476806ccf49fc95e387d9..d9345b9507c90daf3e7bb988d6674a31299145f3 100644 --- a/src/main/java/org/olat/modules/lecture/LectureService.java +++ b/src/main/java/org/olat/modules/lecture/LectureService.java @@ -62,7 +62,7 @@ public interface LectureService { /** - * Get (or create) the configuration object for the specified repossitory + * Get (or create) the configuration object for the specified repository * entry. * * @param entry @@ -72,9 +72,8 @@ public interface LectureService { /** * - * - * @param entry - * @return + * @param entry The course + * @return true if the module is enabled and the course has the lectures enabled */ public boolean isRepositoryEntryLectureEnabled(RepositoryEntryRef entry);