for (final PhdIndividualProgramProcess phdProcess : student.getPerson().getPhdIndividualProgramProcessesSet()) {
if (!phdProcess.isAllowedToManageProcess(Authenticate.getUser())) {
continue;
}
if ((phdProcess.isProcessActive() && student.hasValidInsuranceEvent())) {
phdRegistrationWrapperResult.add(new PhdRegistrationWrapper(phdProcess));
} else if (phdProcess.isConcluded()) {
ExecutionYear conclusionYear = phdProcess.getConclusionYear();
if (matchesRecentExecutionYear(currentExecutionYear, conclusionYear)) {
phdRegistrationWrapperResult.add(new PhdRegistrationWrapper(phdProcess));
}
}
}
for (Registration registration : student.getActiveRegistrations()) {
if (!registration.getDegreeType().isEmpty() && registration.isAllowedToManageRegistration()) {
phdRegistrationWrapperResult.add(new PhdRegistrationWrapper(registration));
}
}
for (Registration registration : student.getConcludedRegistrations()) {
if (!registration.getDegreeType().isEmpty() && registration.isBolonha()
&& registration.isAllowedToManageRegistration()) {
RegistrationConclusionBean conclusionBean = null;
CycleType cycleType = registration.getDegreeType().getLastOrderedCycleType();
if (cycleType != null) {
conclusionBean = new RegistrationConclusionBean(registration, cycleType);
} else {
conclusionBean = new RegistrationConclusionBean(registration);
}
ExecutionYear conclusionYear = conclusionBean.getConclusionYear();
if (matchesRecentExecutionYear(currentExecutionYear, conclusionYear)) {
phdRegistrationWrapperResult.add(new PhdRegistrationWrapper(registration));
}
}
}
return phdRegistrationWrapperResult;
}