use of org.olat.course.nodes.projectbroker.datamodel.ProjectEvent in project openolat by klemens.
the class ProjectBrokerManagerImpl method isEnrollmentDateOk.
private boolean isEnrollmentDateOk(Project project, ProjectBrokerModuleConfiguration moduleConfig) {
if (moduleConfig.isProjectEventEnabled(EventType.ENROLLMENT_EVENT)) {
ProjectEvent enrollmentEvent = project.getProjectEvent(EventType.ENROLLMENT_EVENT);
Date now = new Date();
if (enrollmentEvent.getStartDate() != null) {
if (now.before(enrollmentEvent.getStartDate())) {
return false;
}
}
if (enrollmentEvent.getEndDate() != null) {
if (now.after(enrollmentEvent.getEndDate())) {
return false;
}
}
if ((enrollmentEvent.getStartDate() == null) && (enrollmentEvent.getEndDate() == null)) {
// no enrollment date define => access ok
return true;
}
}
return true;
}
Aggregations