HtmlTable groupTable = createGroupTable(container, 0);
HtmlTableRow htmlTableRow = groupTable.createRow();
htmlTableRow.setClasses(getRenderer().getGroupRowClasses());
htmlTableRow.createCell().setBody(new HtmlText("Other Curricular Units", false));
HtmlTableCell cell = htmlTableRow.createCell();
cell.setClasses("aright");
HtmlCheckBox checkBox = new HtmlCheckBox(false);
final String name = "degreeModuleToEnrolCheckBox";
checkBox.setName(name);
checkBox.setUserValue("true");
checkBox.setChecked(true);
cell.setBody(checkBox);
groupTable = createCoursesTable(container, 0);
NoCourseGroupCurriculumGroup group =
getBolonhaStudentEnrollmentBean().getStudentCurricularPlan().getNoCourseGroupCurriculumGroup(
NoCourseGroupCurriculumGroupType.STANDALONE);
HashSet<CurricularCourse> set = new HashSet<CurricularCourse>();
ErasmusBolonhaStudentEnrollmentBean erasmusBolonhaStudentEnrollmentBean =
(ErasmusBolonhaStudentEnrollmentBean) getBolonhaStudentEnrollmentBean();
set.addAll(erasmusBolonhaStudentEnrollmentBean.getCandidacy().getCurricularCoursesSet());
for (Enrolment enrolment : group.getEnrolments()) {
set.add(enrolment.getCurricularCourse());
}
for (CurricularCourse curricularCourse : set) {
if (erasmusBolonhaStudentEnrollmentBean.getStudentCurricularPlan().getEnrolmentByCurricularCourseAndExecutionPeriod(
curricularCourse, erasmusBolonhaStudentEnrollmentBean.getExecutionPeriod()) != null) {
if (!group.hasEnrolmentWithEnroledState(curricularCourse,
erasmusBolonhaStudentEnrollmentBean.getExecutionPeriod())) {
continue;
}
}
if (!isContextValid(curricularCourse)) {
continue;
}
htmlTableRow = groupTable.createRow();
HtmlTableCell cellName = htmlTableRow.createCell();
cellName.setClasses(getRenderer().getCurricularCourseToEnrolNameClasses());
String degreeName = curricularCourse.getName();
if (isAcademicRelationsOfficeMember() && curricularCourse instanceof CurricularCourse) {
if (!StringUtils.isEmpty(curricularCourse.getCode())) {
degreeName = curricularCourse.getCode() + " - " + degreeName;
}
degreeName +=
" (" + BundleUtil.getString(Bundle.STUDENT, "label.grade.scale") + " - "
+ curricularCourse.getGradeScaleChain().getDescription() + ") ";
}
cellName.setBody(new HtmlText(degreeName));
// Year
final HtmlTableCell yearCell = htmlTableRow.createCell();
yearCell.setClasses(getRenderer().getCurricularCourseToEnrolYearClasses());
yearCell.setColspan(2);
yearCell.setBody(new HtmlText(getBolonhaStudentEnrollmentBean().getExecutionPeriod().getQualifiedName()));
final HtmlTableCell ectsCell = htmlTableRow.createCell();
ectsCell.setClasses(getRenderer().getCurricularCourseToEnrolEctsClasses());
final StringBuilder ects = new StringBuilder();
ects.append(curricularCourse.getEctsCredits()).append(" ")
.append(BundleUtil.getString(Bundle.STUDENT, "label.credits.abbreviation"));
ectsCell.setBody(new HtmlText(ects.toString()));
HtmlTableCell checkBoxCell = htmlTableRow.createCell();
checkBoxCell.setClasses(getRenderer().getCurricularCourseToEnrolCheckBoxClasses());
checkBox = new HtmlCheckBox(false);
checkBox.setName("extraCurricularEnrolments" + curricularCourse.getClass().getCanonicalName() + ":"
+ curricularCourse.getExternalId());
checkBox.setUserValue(curricularCourse.getClass().getCanonicalName() + ":" + curricularCourse.getExternalId());
checkBoxCell.setBody(checkBox);
controller.addCheckBox(checkBox);
if (group.hasEnrolmentWithEnroledState(curricularCourse, erasmusBolonhaStudentEnrollmentBean.getExecutionPeriod())) {
cellName.setClasses(getRenderer().getEnrolmentNameClasses());
yearCell.setClasses(getRenderer().getEnrolmentYearClasses());
ectsCell.setClasses(getRenderer().getEnrolmentEctsClasses());
checkBoxCell.setClasses(getRenderer().getEnrolmentCheckBoxClasses());
checkBox.setChecked(true);
}
}