Skip to content
Snippets Groups Projects
Commit c0e4d5bf authored by srosse's avatar srosse
Browse files

OO-4973: use the non-blocking method to know if lectures are enabled

parent 1d771cab
No related branches found
No related tags found
No related merge requests found
...@@ -139,7 +139,6 @@ import org.olat.instantMessaging.OpenInstantMessageEvent; ...@@ -139,7 +139,6 @@ import org.olat.instantMessaging.OpenInstantMessageEvent;
import org.olat.modules.assessment.ui.AssessmentToolSecurityCallback; import org.olat.modules.assessment.ui.AssessmentToolSecurityCallback;
import org.olat.modules.lecture.LectureModule; import org.olat.modules.lecture.LectureModule;
import org.olat.modules.lecture.LectureService; 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.LectureRepositoryAdminController;
import org.olat.modules.lecture.ui.LecturesSecurityCallback; import org.olat.modules.lecture.ui.LecturesSecurityCallback;
import org.olat.modules.lecture.ui.LecturesSecurityCallbackFactory; import org.olat.modules.lecture.ui.LecturesSecurityCallbackFactory;
...@@ -624,8 +623,7 @@ public class CourseRuntimeController extends RepositoryEntryRuntimeController im ...@@ -624,8 +623,7 @@ public class CourseRuntimeController extends RepositoryEntryRuntimeController im
} }
private boolean isLectureEnabled() { private boolean isLectureEnabled() {
RepositoryEntryLectureConfiguration lectureConfig = lectureService.getRepositoryEntryLectureConfiguration(getRepositoryEntry()); return lectureService.isRepositoryEntryLectureEnabled(getRepositoryEntry());
return lectureConfig != null && lectureConfig.isLectureEnabled();
} }
private void initToolsMenuStatistics(Dropdown tools, ICourse course, final UserCourseEnvironmentImpl uce) { private void initToolsMenuStatistics(Dropdown tools, ICourse course, final UserCourseEnvironmentImpl uce) {
......
...@@ -53,9 +53,7 @@ import org.olat.course.run.userview.UserCourseEnvironment; ...@@ -53,9 +53,7 @@ import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.course.run.userview.UserCourseEnvironmentImpl; import org.olat.course.run.userview.UserCourseEnvironmentImpl;
import org.olat.modules.assessment.ui.event.AssessmentFormEvent; import org.olat.modules.assessment.ui.event.AssessmentFormEvent;
import org.olat.modules.coach.model.EfficiencyStatementEntry; import org.olat.modules.coach.model.EfficiencyStatementEntry;
import org.olat.modules.lecture.LectureModule;
import org.olat.modules.lecture.LectureService; import org.olat.modules.lecture.LectureService;
import org.olat.modules.lecture.RepositoryEntryLectureConfiguration;
import org.olat.modules.lecture.ui.ParticipantLectureBlocksController; import org.olat.modules.lecture.ui.ParticipantLectureBlocksController;
import org.olat.repository.RepositoryEntry; import org.olat.repository.RepositoryEntry;
import org.olat.repository.RepositoryEntrySecurity; import org.olat.repository.RepositoryEntrySecurity;
...@@ -91,9 +89,6 @@ public class UserDetailsController extends BasicController implements Activateab ...@@ -91,9 +89,6 @@ public class UserDetailsController extends BasicController implements Activateab
private final Identity assessedIdentity; private final Identity assessedIdentity;
@Autowired
private LectureModule lectureModule;
@Autowired @Autowired
private LectureService lectureService; private LectureService lectureService;
@Autowired @Autowired
...@@ -134,12 +129,9 @@ public class UserDetailsController extends BasicController implements Activateab ...@@ -134,12 +129,9 @@ public class UserDetailsController extends BasicController implements Activateab
assessmentLink = LinkFactory.createLink("details.assessment", mainVC, this); assessmentLink = LinkFactory.createLink("details.assessment", mainVC, this);
segmentView.addSegment(assessmentLink, selectSegment == Segment.assessment); segmentView.addSegment(assessmentLink, selectSegment == Segment.assessment);
if(lectureModule.isEnabled()) { if(lectureService.isRepositoryEntryLectureEnabled(entry)) {
RepositoryEntryLectureConfiguration lectureConfig = lectureService.getRepositoryEntryLectureConfiguration(entry); lecturesLink = LinkFactory.createLink("details.lectures", mainVC, this);
if(lectureConfig != null && lectureConfig.isLectureEnabled()) { segmentView.addSegment(lecturesLink, selectSegment == Segment.lectures);
lecturesLink = LinkFactory.createLink("details.lectures", mainVC, this);
segmentView.addSegment(lecturesLink, selectSegment == Segment.lectures);
}
} }
if(selectSegment == Segment.assessment) { if(selectSegment == Segment.assessment) {
......
...@@ -62,7 +62,7 @@ public interface LectureService { ...@@ -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. * entry.
* *
* @param entry * @param entry
...@@ -72,9 +72,8 @@ public interface LectureService { ...@@ -72,9 +72,8 @@ public interface LectureService {
/** /**
* *
* * @param entry The course
* @param entry * @return true if the module is enabled and the course has the lectures enabled
* @return
*/ */
public boolean isRepositoryEntryLectureEnabled(RepositoryEntryRef entry); public boolean isRepositoryEntryLectureEnabled(RepositoryEntryRef entry);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment