table.setClasses(getTablesClasses());
table.setStyle("width: " + (getInitialWidth() - depth) + "em; margin-left: " + depth + "em;");
for (DegreeModuleScope scope : scopes) {
final HtmlTableRow htmlTableRow = table.createRow();
HtmlTableCell cellName = htmlTableRow.createCell();
cellName.setClasses(getCurricularCourseNameClasses());
cellName.setBody(new HtmlText(scope.getCurricularCourse().getName(getExecutionSemester())));
// Year
final HtmlTableCell yearCell = htmlTableRow.createCell();
yearCell.setClasses(getCurricularCourseYearClasses());
yearCell.setBody(new HtmlText(RenderUtils.getResourceString("ACADEMIC_OFFICE_RESOURCES",
"label.scope.curricular.semester",
new Object[] { scope.getCurricularYear(), scope.getCurricularSemester() })));
// Ects
final HtmlTableCell ectsCell = htmlTableRow.createCell();
ectsCell.setClasses(getCurricularCourseEctsClasses());
final StringBuilder ects = new StringBuilder();
ects.append(scope.getCurricularCourse().getEctsCredits(getExecutionSemester())).append(" ")
.append(BundleUtil.getString(Bundle.ACADEMIC, "credits.abbreviation"));
ectsCell.setBody(new HtmlText(ects.toString()));
// enrolment link
final HtmlTableCell linkTableCell = htmlTableRow.createCell();
linkTableCell.setClasses(getCurricularCourseLinkClasses());
final HtmlActionLink actionLink = new HtmlActionLink();
actionLink.setText(BundleUtil.getString(Bundle.ACADEMIC, "link.option.enrol.curricular.course"));
actionLink.setName("curricularCourseEnrolLink" + scope.getCurricularCourse().getExternalId());
actionLink.setOnClick(String.format(
"$(this).closest('form').find('input[name=\\'method\\']').attr('value', '%s');", getMethodName()));
//actionLink.setOnClick(String.format("document.forms[0].method.value='%s';", getMethodName()));
actionLink.setController(new UpdateSelectedCurricularCourseController(scope.getCurricularCourse()));
linkTableCell.setBody(actionLink);
}
}