diff --git a/src/main/java/org/olat/course/run/CourseRuntimeController.java b/src/main/java/org/olat/course/run/CourseRuntimeController.java index d5ab223059d8fa696967c7175eed198d9aa22b03..4cf8543bacb2524c105dd8585789bdbc8ff3ed12 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; @@ -624,8 +623,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 7035db4e9cc06fe5fb5dfa43279dad15b5f4cad9..6731ce8f194277c2b774437bef22ead1264ade48 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; @@ -91,9 +89,6 @@ public class UserDetailsController extends BasicController implements Activateab private final Identity assessedIdentity; - - @Autowired - private LectureModule lectureModule; @Autowired private LectureService lectureService; @Autowired @@ -134,12 +129,9 @@ public class UserDetailsController extends BasicController implements Activateab assessmentLink = LinkFactory.createLink("details.assessment", mainVC, this); 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 7da377a61231b9ceb4eac0aaf552dc48d3fddf70..4210b8ca101f16752493169e52e48359697bbba5 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);